Skip to content

Commit

Permalink
Merge pull request #70 from now-u/fix/close-navbar-mobile
Browse files Browse the repository at this point in the history
Fix nav bar won't close issue on mobile, again
  • Loading branch information
JElgar authored Nov 4, 2024
2 parents 08dbc2b + f9fd8bc commit a29680b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const NavbarLink = (

export const Navbar = (): JSX.Element => {
return (
<Disclosure as="nav" className="flex flex-col bg-white w-full items-center sticky top-0 z-10 bg-opacity-90 backdrop-blur-lg shadow shadow-sm">
<Disclosure as="nav" className="flex flex-col bg-white w-full items-center sticky top-0 z-10 bg-opacity-90 backdrop-blur-lg shadow-sm">
{({ open, close }) => (
<>
<div className="max-w-screen-2xl flex w-full justify-between">
Expand All @@ -45,7 +45,7 @@ export const Navbar = (): JSX.Element => {
<div className="flex flex-1 items-center lg:items-stretch lg:justify-start">
<div className="flex flex-shrink-0 items-center">
{/* Mobile Icon */}
<Link href="/">
<Link href="/" onClick={() => { close() }}>
<Image
className="block h-5 w-auto lg:hidden"
src={NowULogo}
Expand Down Expand Up @@ -88,7 +88,7 @@ export const Navbar = (): JSX.Element => {
<Disclosure.Panel className="relative md:hidden flex flex-col w-full items-end">
<div className="absolute bg-white w-full space-y-1 px-2 pt-2 pb-3 text-right border-t-2 border-orange drop-shadow-lg">
{navigationRoutes.map((item) => (
<NavbarLink key={item.to} isMobile={true} {...item} />
<NavbarLink key={item.to} isMobile={true} {...item} onClick={() => { close() }} />
))}
</div>
</Disclosure.Panel>
Expand Down

0 comments on commit a29680b

Please sign in to comment.