From ae7795508a9a737129b368c44b25cd5b00467f02 Mon Sep 17 00:00:00 2001 From: Felix Habib Date: Mon, 23 Dec 2024 14:26:02 +1100 Subject: [PATCH] Refactor --- .../lib/components/MenuItem/useMenuItem.tsx | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/braid-design-system/src/lib/components/MenuItem/useMenuItem.tsx b/packages/braid-design-system/src/lib/components/MenuItem/useMenuItem.tsx index 4c532448712..af5a01c65b5 100644 --- a/packages/braid-design-system/src/lib/components/MenuItem/useMenuItem.tsx +++ b/packages/braid-design-system/src/lib/components/MenuItem/useMenuItem.tsx @@ -26,7 +26,6 @@ import { iconSlotSpace } from '../private/iconSlotSpace'; import { badgeSlotSpace } from '../private/badgeSlotSpace'; import { virtualTouchable } from '../private/touchable/virtualTouchable.css'; import { DefaultBadgePropsProvider } from '../Badge/defaultBadgeProps'; -import { Inline } from '../Inline/Inline'; const { MENU_ITEM_UP, @@ -181,19 +180,25 @@ export function MenuItemLeftSlot({ children }: { children?: ReactNode }) { const iconSpace = useBraidTheme().legacy ? 'small' : iconSlotSpace; return ( - - - - -   - + + +   + + {children ? ( + + {children} - {children ? ( - - {children} - - ) : null} - + ) : null} ); } @@ -229,7 +234,7 @@ function MenuItemChildren({ const { size, reserveIconSpace } = menuRendererContext; return ( - + {!formElement && (icon || reserveIconSpace) ? ( {badge} ) : null} - + ); }