Skip to content

Commit

Permalink
fixes the issue with collaped menuitems
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 authored Jun 7, 2024
1 parent 823d3c9 commit 44eaac8
Showing 1 changed file with 42 additions and 30 deletions.
72 changes: 42 additions & 30 deletions studio/src/components/GlobalNav/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,37 +117,37 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
});

const getSubMenuItems = (menu, index, Icon) => (
<Skeleton
paragraph={false}
loading={loading}
style={{ padding: '12px' }}
active
round
avatar={{ shape: 'circle' }}
// <Skeleton
// paragraph={false}
// loading={loading}
// style={{ padding: '12px' }}
// active
// round
// avatar={{ shape: 'circle' }}
// >
<SubMenu
key={index}
title={menu.title}
icon={<Icon style={{ color: '#000', fontSize: '15px', fontWeight: '700' }} />}
>
<SubMenu
key={index}
title={menu.title}
icon={<Icon style={{ color: '#000', fontSize: '15px', fontWeight: '700' }} />}
>
{menu.submenu && menu.submenu.length > 0 ? (
<>
{menu.submenu.map((submenuItem, index) => {
return orgs[0]?.permission.role === 'owner' ? (
<SubMenu key={submenuItem.title + index} title={submenuItem.title}>
{getMenuItems(submenuItem.children, index, submenuItem.title)}
</SubMenu>
) : (
<SubMenu key={submenuItem.title + index} title={submenuItem.title}>
{getMenuItems(submenuItem.children, index, submenuItem.title)}
</SubMenu>
);
})}
</>
) : null}
{getMenuItems(menu.children, index, menu.title)}
</SubMenu>
</Skeleton>
{menu.submenu && menu.submenu.length > 0 ? (
<>
{menu.submenu.map((submenuItem, index) => {
return orgs[0]?.permission.role === 'owner' ? (
<SubMenu key={submenuItem.title + index} title={submenuItem.title}>
{getMenuItems(submenuItem.children, index, submenuItem.title)}
</SubMenu>
) : (
<SubMenu key={submenuItem.title + index} title={submenuItem.title}>
{getMenuItems(submenuItem.children, index, submenuItem.title)}
</SubMenu>
);
})}
</>
) : null}
{getMenuItems(menu.children, index, menu.title)}
</SubMenu>
// </Skeleton>
);

return (
Expand Down Expand Up @@ -250,6 +250,18 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
>
{sidebarMenu.map((menu, index) => {
const { Icon } = menu;
if (loading) {
return (
<Skeleton
paragraph={false}
loading={loading}
style={{ padding: '12px' }}
active
round
avatar={{ shape: 'circle' }}
/>
);
}
return menu.title === 'CORE' && !showCoreMenu
? null
: !menu.isService
Expand Down

0 comments on commit 44eaac8

Please sign in to comment.