Skip to content

Commit

Permalink
fix: console warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lsantos1873 committed Oct 4, 2023
1 parent 0d4d5ee commit 888f55a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ render(() => {
</NavigationMenu.Header>

<NavigationMenu.Items>
{itemGroups.map(group => (
<NavigationMenu.ItemsGroup>
{itemGroups.map((group, index) => (
<NavigationMenu.ItemsGroup key={index}>
{group.map(item => (
<NavigationMenu.Item
key={item.label}
active={item.active}
expanded={item.expanded}
icon={<IconComponent icon={item.icon} />}
Expand All @@ -121,6 +122,7 @@ render(() => {
{item.subitems &&
item.subitems.map(({ label }) => (
<NavigationMenu.Subitem
key={label}
label={label}
wrapper={renderWrapper}
/>
Expand Down Expand Up @@ -237,10 +239,11 @@ render(() => {
</NavigationMenu.Header>

<NavigationMenu.Items>
{itemGroups.map(group => (
<NavigationMenu.ItemsGroup>
{itemGroups.map((group, index) => (
<NavigationMenu.ItemsGroup key={index}>
{group.map(item => (
<NavigationMenu.Item
key={item.label}
active={item.active}
expanded={item.expanded}
icon={<IconComponent icon={item.icon} />}
Expand All @@ -251,6 +254,7 @@ render(() => {
{item.subitems &&
item.subitems.map(({ label }) => (
<NavigationMenu.Subitem
key={label}
label={label}
wrapper={renderWrapper}
/>
Expand All @@ -275,6 +279,7 @@ render(() => {
<NavigationMenu.BottomItems>
{bottomItems.map(({ active, icon, label, wrapper }) => (
<NavigationMenu.BottomItem
key={label}
active={active}
icon={icon}
label={label}
Expand Down Expand Up @@ -342,8 +347,9 @@ render(() => {
<NavigationMenu.Switcher
actions={actions}
avatar={<StyledAvatar fill="vibin" />}
title="User"
sideOffset={36}
subtitle="Admin, Supervisor"
title="User"
/>
</NavigationMenu.Footer>
</NavigationMenu>
Expand Down
9 changes: 6 additions & 3 deletions packages/yoga/src/NavigationMenu/web/NavigationMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ describe('<NavigationMenu />', () => {
</NavigationMenu.Header>

<NavigationMenu.Items>
{itemGroups.map(group => (
<NavigationMenu.ItemsGroup>
{itemGroups.map((group, index) => (
<NavigationMenu.ItemsGroup key={index}>
{group.map(item => (
<NavigationMenu.Item
key={item.label}
active={item.active}
expanded={item.expanded}
icon={<IconComponent icon={item.icon} />}
Expand All @@ -70,6 +71,7 @@ describe('<NavigationMenu />', () => {
{item.subitems &&
item.subitems.map(({ label }) => (
<NavigationMenu.Subitem
key={label}
label={label}
wrapper={renderWrapper}
/>
Expand Down Expand Up @@ -134,8 +136,9 @@ describe('<NavigationMenu />', () => {
<NavigationMenu.Switcher
actions={actions}
avatar={<Avatar.Circle />}
title="User"
sideOffset={36}
subtitle="Admin, Supervisor"
title="User"
/>
</NavigationMenu.Footer>
</NavigationMenu>
Expand Down
2 changes: 1 addition & 1 deletion packages/yoga/src/NavigationMenu/web/Switcher/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Styles from './Actions.styles';

type ActionsProps = {
actions: SwitcherActionsProps[];
sideOffset: string;
sideOffset: number;
};

const Actions = ({ actions, sideOffset }: ActionsProps) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/yoga/src/NavigationMenu/web/Switcher/Switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type SwitcherProps = {
actions?: SwitcherActionsProps[];
avatar: React.ReactElement;
fill?: string;
sideOffset?: string;
sideOffset?: number;
subtitle?: string;
title: string;
};
Expand All @@ -23,7 +23,7 @@ const Switcher = ({
actions,
avatar: Avatar,
fill = 'transparent',
sideOffset = '4',
sideOffset = 36,
subtitle,
title,
}: SwitcherProps) => {
Expand Down

0 comments on commit 888f55a

Please sign in to comment.