diff --git a/src/Geopilot.Frontend/src/Header.tsx b/src/Geopilot.Frontend/src/Header.tsx index 168da72e..c5db478d 100644 --- a/src/Geopilot.Frontend/src/Header.tsx +++ b/src/Geopilot.Frontend/src/Header.tsx @@ -42,6 +42,13 @@ export const Header: FC = ({ clientSettings, hasDrawerToggle, handl setUserMenuOpen(newOpen); }; + const isActive = (path: string) => { + if (path === "") { + return location.pathname === "/"; + } + return location.pathname.split("/").includes(path); + }; + return ( <> @@ -119,6 +126,7 @@ export const Header: FC = ({ clientSettings, hasDrawerToggle, handl { navigate("/"); }}> @@ -128,6 +136,7 @@ export const Header: FC = ({ clientSettings, hasDrawerToggle, handl { navigate("/admin"); }}> @@ -136,6 +145,7 @@ export const Header: FC = ({ clientSettings, hasDrawerToggle, handl { window.open("/browser", "_blank"); }}> diff --git a/src/Geopilot.Frontend/src/pages/admin/Admin.tsx b/src/Geopilot.Frontend/src/pages/admin/Admin.tsx index 821ea8bf..abdeb286 100644 --- a/src/Geopilot.Frontend/src/pages/admin/Admin.tsx +++ b/src/Geopilot.Frontend/src/pages/admin/Admin.tsx @@ -37,6 +37,13 @@ export const Admin: FC = ({ clientSettings }) => { } }; + const isActive = (path: string) => { + if (path === "") { + return location.pathname === "/"; + } + return location.pathname.split("/").includes(path); + }; + const drawerWidth = "250px"; const drawerContent = (
@@ -45,6 +52,7 @@ export const Admin: FC = ({ clientSettings }) => { { navigateTo("delivery-overview"); }}> @@ -57,6 +65,7 @@ export const Admin: FC = ({ clientSettings }) => { {["users", "mandates", "organisations"].map(link => ( { navigateTo(link); }}>