diff --git a/apps/link/app/(main)/_components/InternalLayout.tsx b/apps/link/app/(main)/_components/InternalLayout.tsx index 36062cd..3748592 100644 --- a/apps/link/app/(main)/_components/InternalLayout.tsx +++ b/apps/link/app/(main)/_components/InternalLayout.tsx @@ -24,6 +24,7 @@ import { import { fonts } from "@link-stack/ui"; import Image from "next/image"; import LinkLogo from "public/link-logo-small.png"; +import { usePathname } from 'next/navigation'; interface InternalLayoutProps extends PropsWithChildren { setupModeActive: boolean; @@ -44,6 +45,15 @@ export const InternalLayout: FC = ({ const [openWidth, setOpenWidth] = useState(0); const [closedWidth, setClosedWidth] = useState(0); + const pathname = usePathname(); + + useEffect(() => { + // On mobile, close menu when stuff is selected + if (mobile) { + setOpen(false); + } + }, [pathname]); + useEffect(() => { setClosedWidth(mobile ? 0 : 70); setOpenWidth(270);