From 2a051dce6bff17884b47beab8332136052c03aac Mon Sep 17 00:00:00 2001 From: Dominik Stumpf Date: Tue, 3 Dec 2024 05:30:33 +0100 Subject: [PATCH] fix: close nav menu after navigating --- src/components/NavMenu.tsx | 202 +++++++++++++++++++++---------------- 1 file changed, 115 insertions(+), 87 deletions(-) diff --git a/src/components/NavMenu.tsx b/src/components/NavMenu.tsx index 72749fa951..58decd17f1 100644 --- a/src/components/NavMenu.tsx +++ b/src/components/NavMenu.tsx @@ -22,99 +22,127 @@ import { import { useIsClient } from "foxact/use-is-client"; import { useTheme } from "next-themes"; import { usePathname } from "next/navigation"; -import type { ComponentProps, ReactNode } from "react"; +import { type ComponentProps, type ReactNode, useState } from "react"; import GuildLogo from "static/logo.svg"; import { Anchor } from "./ui/Anchor"; import { Button, buttonVariants } from "./ui/Button"; import { Popover, PopoverContent, PopoverTrigger } from "./ui/Popover"; import { ToggleGroup, ToggleGroupItem } from "./ui/ToggleGroup"; -export const NavMenu = () => ( - - - - - - - -
- Theme: - -
-
-
-); +export const NavMenu = () => { + const [open, setOpen] = useState(false); + + return ( + + + + + + + +
+ Theme: + +
+
+
+ ); +}; const NavGroup = ({ title,