Skip to content

Commit 49b4f39

Browse files
igorrm19ovflowd
andauthored
feat(navigation): don't render navItems when no children (#8722)
* chore: update next-env.d.ts * feat: minimize mobile nav empty space (#8719) Only render the navItems container when the array has items to prevent an empty padded container from creating unwanted space in the mobile navigation. * Update import path for routes type definitions Signed-off-by: Igor Rodrigues Machado <107290125+igorrm19@users.noreply.github.com> * Update packages/ui-components/src/Containers/NavBar/index.tsx Co-authored-by: Claudio Wunder <cwunder@gnome.org> Signed-off-by: Igor Rodrigues Machado <107290125+igorrm19@users.noreply.github.com> * Fix conditional rendering of navItems in NavBar Is this breaking the build with navItems?.length > 0 && Signed-off-by: Igor Rodrigues Machado <107290125+igorrm19@users.noreply.github.com> * Remove blank line in NavBar component Removed unnecessary blank line before the main navigation items div. Signed-off-by: Igor Rodrigues Machado <107290125+igorrm19@users.noreply.github.com> * style: fix prettier formatting in NavBar --------- Signed-off-by: Igor Rodrigues Machado <107290125+igorrm19@users.noreply.github.com> Co-authored-by: Claudio Wunder <cwunder@gnome.org>
1 parent c9a5b32 commit 49b4f39

File tree

1 file changed

+1
-2
lines changed
  • packages/ui-components/src/Containers/NavBar

1 file changed

+1
-2
lines changed

packages/ui-components/src/Containers/NavBar/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ const NavBar: FC<PropsWithChildren<NavbarProps>> = ({
7373
aria-label={sidebarItemTogglerAriaLabel}
7474
tabIndex={-1}
7575
/>
76-
7776
<div className={classNames(styles.main, `hidden peer-checked:flex`)}>
78-
{navItems && (
77+
{navItems && navItems.length > 0 && (
7978
<div className={styles.navItems}>
8079
{navItems.map(({ text, link, target }) => (
8180
<NavItem

0 commit comments

Comments
 (0)