diff --git a/src/components/common/dynamic-logo.tsx b/src/components/common/dynamic-logo.tsx index d56e1cf..7f40030 100644 --- a/src/components/common/dynamic-logo.tsx +++ b/src/components/common/dynamic-logo.tsx @@ -1,6 +1,5 @@ 'use client' -import Image from 'next/image' import Link from 'next/link' import { usePathname } from 'next/navigation' import * as React from 'react' diff --git a/src/components/common/navigation-menu.tsx b/src/components/common/navigation-menu.tsx index 94d2cc3..34f4998 100644 --- a/src/components/common/navigation-menu.tsx +++ b/src/components/common/navigation-menu.tsx @@ -4,13 +4,22 @@ import { Button } from '@components/ui/button' import { Sheet, SheetContent } from '@components/ui/sheet' import { Tooltip, TooltipContent, TooltipTrigger } from '@components/ui/tooltip' import Link from 'next/link' +import { usePathname } from 'next/navigation' import * as React from 'react' import { sideNavMenus } from '~/constants/menu' import { socials } from '~/constants/social' export function NavigationMenu() { + const pathname = usePathname() const [isOpen, setOpen] = React.useState(false) + React.useEffect( + function closeSheetOnPathChange() { + setOpen(false) + }, + [pathname], + ) + return ( <>