diff --git a/apps/frontend/src/routes/admin/AdminLayout.tsx b/apps/frontend/src/routes/admin/AdminLayout.tsx index 33f477d..919675a 100644 --- a/apps/frontend/src/routes/admin/AdminLayout.tsx +++ b/apps/frontend/src/routes/admin/AdminLayout.tsx @@ -1,3 +1,4 @@ +import { useEffect, useState } from "react"; import { Link, Outlet, useRouterState } from "@tanstack/react-router"; const NAV_ITEMS = [ @@ -13,17 +14,65 @@ const NAV_ITEMS = [ export function AdminLayout() { const pathname = useRouterState({ select: (s) => s.location.pathname }); + const [mobileOpen, setMobileOpen] = useState(false); + + // Drawer schließen, wenn per Navigation die Seite wechselt + useEffect(() => { + setMobileOpen(false); + }, [pathname]); return ( -