From 84ffc999f471e0083db67cb213ae224211cc450a Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sun, 14 Jan 2024 13:32:38 +0330 Subject: [PATCH] fixed bug --- .../layouts/Dashboard/Sidebar/SidebarList.jsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/layouts/Dashboard/Sidebar/SidebarList.jsx b/src/components/layouts/Dashboard/Sidebar/SidebarList.jsx index c8ad33c..f21b69a 100644 --- a/src/components/layouts/Dashboard/Sidebar/SidebarList.jsx +++ b/src/components/layouts/Dashboard/Sidebar/SidebarList.jsx @@ -64,18 +64,21 @@ export default function SidebarList({handleDrawerToggle}) { }, [selectedKey]); return ( - {itemMenu.map((itemArr, index) => ( + {itemMenu.map((itemArr, index) => { + let isDividerVisible = false; + return ( {itemArr.map((item) => - {(item.permissions.some((permission) => user?.permissions?.includes(permission)) || item.permissions.includes('all')) && + {(item.permissions.some((permission) => user?.permissions?.includes(permission)) || item.permissions.includes('all')) && <> } + /> + {isDividerVisible = true} + } )} - - ))} - - - ); + {isDividerVisible && } + ) + })} + ); }