From 7738817799f9765c6e4f0f5b78b880bb81cd9f93 Mon Sep 17 00:00:00 2001 From: Amr Hamdy Date: Mon, 21 Oct 2024 12:25:56 +0300 Subject: [PATCH] fix(MenuItem): showing subList --- packages/ui/src/core/menu-item/menu-item.component.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/core/menu-item/menu-item.component.tsx b/packages/ui/src/core/menu-item/menu-item.component.tsx index 9960aa07..ae44d527 100644 --- a/packages/ui/src/core/menu-item/menu-item.component.tsx +++ b/packages/ui/src/core/menu-item/menu-item.component.tsx @@ -17,6 +17,7 @@ const MenuItem = intrinsicComponent((props: MenuI active, value, dividerStyle, + depth = 0, } = props; const menuItemRef = useRef(null); @@ -68,13 +69,15 @@ const MenuItem = intrinsicComponent((props: MenuI enableOverlay={false} {...option.subMenuProps} > - + ); } + if (option.content === 'divider') { return ; } + return ( ((props: MenuI ); } - return <>{renderItems(list, 0)}; + return <>{renderItems(list, depth)}; }); MenuItem.displayName = 'MenuItem';