From 2825eb98ed253825ef69e63c261c7c9605b15f4f Mon Sep 17 00:00:00 2001 From: lorumic Date: Wed, 17 Jul 2024 18:38:36 +0200 Subject: [PATCH] fix(app-layout): prevent display of empty app navigation panel --- .../ApplicationLayout.stories.tsx | 21 ++- .../ApplicationLayout.test.tsx | 5 + .../ApplicationLayout/ApplicationLayout.tsx | 153 +++++++++--------- 3 files changed, 104 insertions(+), 75 deletions(-) diff --git a/src/components/ApplicationLayout/ApplicationLayout.stories.tsx b/src/components/ApplicationLayout/ApplicationLayout.stories.tsx index 6c71a657a..cff01a00a 100644 --- a/src/components/ApplicationLayout/ApplicationLayout.stories.tsx +++ b/src/components/ApplicationLayout/ApplicationLayout.stories.tsx @@ -59,8 +59,9 @@ export const Default: Story = { ]} aside={ showAside ? ( - + - - - } - controlsClassName="u-hide--large" - stickyHeader - logo={logo} - > - {navItems ? ( - + {(navItems || sideNavigation) && ( + <> + + dark={dark} - items={navItems} - linkComponent={navLinkComponent} + logo={logo} + toggle={{ + label: "Menu", + onClick: () => setMenuCollapsed(!menuIsCollapsed), + }} /> - ) : ( - sideNavigation - )} - - + + + + dark={dark} + controls={ + <> + + + + } + controlsClassName="u-hide--large" + stickyHeader + logo={logo} + > + {navItems ? ( + + dark={dark} + items={navItems} + linkComponent={navLinkComponent} + /> + ) : ( + sideNavigation + )} + + + + )} {children} {aside} - {status ? ( - {status} - ) : null} + {status && {status}} ); };