Skip to content

Commit

Permalink
Merge pull request #436 from semaphore-protocol/fix/menu-links
Browse files Browse the repository at this point in the history
The navbar menu closes after clicking on links
  • Loading branch information
vplasencia authored Nov 8, 2023
2 parents 81e21b0 + 3581bc2 commit cd3c29b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/website/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function Navbar() {

<DrawerBody>
<VStack spacing="8" mt="20">
<NavbarLinks />
<NavbarLinks onClick={onClose} />
</VStack>
</DrawerBody>

Expand Down
9 changes: 8 additions & 1 deletion apps/website/src/components/NavbarLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ import NextLink from "next/link"
import { usePathname } from "next/navigation"
import IconArrowUpRight from "../icons/IconArrowUpRight"

export default function NavbarLinks() {
export type NavbarProps = {
onClick?: () => void
}

export default function NavbarLinks({ onClick }: NavbarProps) {
const pathname = usePathname()

return (
<>
<Link
onClick={onClick}
as={NextLink}
href="/projects"
variant="navlink"
Expand All @@ -21,6 +26,7 @@ export default function NavbarLinks() {
</Heading>
</Link>
<Link
onClick={onClick}
as={NextLink}
href="/learn"
variant="navlink"
Expand All @@ -31,6 +37,7 @@ export default function NavbarLinks() {
</Heading>
</Link>
<Link
onClick={onClick}
as={NextLink}
href="/build"
variant="navlink"
Expand Down

0 comments on commit cd3c29b

Please sign in to comment.