Skip to content

Commit

Permalink
feat: close navbar on click
Browse files Browse the repository at this point in the history
  • Loading branch information
Thechi2000 committed Feb 1, 2024
1 parent 3cfb1b6 commit f30863c
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions app/src/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ function Entry({ title, href }: { title: string; href: string }) {
);
}

function NavMenu(props: { visible: boolean }) {
return (
<div
className={
styles.navigationMenu + " " + (!props.visible ? styles.hidden : "")
}
>
<div className={styles.menuList}>
<Entry title="L'Association" href="/" />
<Entry title="Commissions" href="/commissions" />
<Entry title="News" href="/news" />
</div>
</div>
);
}

/* TODO the socials should be dynamically loaded from Strapi.
This would probably require to migrate to an App Router to use
server-side components. */
Expand Down Expand Up @@ -63,7 +47,17 @@ export default function NavigationBar() {
</Link>
</div>

<NavMenu visible={visible} />
<div
className={
styles.navigationMenu + " " + (!visible ? styles.hidden : "")
}
>
<div className={styles.menuList} onClick={(e) => setVisible(false)}>
<Entry title="L'Association" href="/" />
<Entry title="Commissions" href="/commissions" />
<Entry title="News" href="/news" />
</div>
</div>
</div>
);
}

0 comments on commit f30863c

Please sign in to comment.