Skip to content

Commit 54dd7e1

Browse files
authored
feat(navigation): keep default style for child components (#259)
1 parent 45470db commit 54dd7e1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/navigation/item/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import React, {
99
useMemo,
1010
} from 'react';
1111
import { useTheme } from '../../../theme/theme';
12+
import * as R from 'ramda';
1213

1314
// Context
1415
import NavigationContext from '../context/navigation.context';
@@ -46,6 +47,7 @@ const NavigationItem: FC<NavigationItemProps> = (
4647
mainTooltipText = '',
4748
secondaryTooltipText = '',
4849
href,
50+
sx,
4951
...restProps
5052
} = props;
5153
const isOpen =
@@ -83,7 +85,7 @@ const NavigationItem: FC<NavigationItemProps> = (
8385
<Box
8486
tx={tx}
8587
variant={getVariant(disabled, isActiveItem)}
86-
sx={styles}
88+
sx={R.mergeDeepLeft(styles, sx ?? {}) as object}
8789
onClick={!disabled ? handleClick : undefined}
8890
className={key == 'oldui' ? 'oldui' : ''}
8991
{...restProps}

src/components/navigation/navigation.stories.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const TreeObject: Story<NavigationProps> = () => {
133133
title: 'Data',
134134
icon: <GetIcon icon={IconName.folder} />,
135135
id: '8',
136+
sx: { color: 'red', backgroundColor: 'blue' },
136137
},
137138
{
138139
title: 'Activity',

0 commit comments

Comments
 (0)