diff --git a/web/src/App.tsx b/web/src/App.tsx index 60488cb56..93e980f2c 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -41,7 +41,7 @@ function App() { > - } /> + } /> } /> } /> } /> diff --git a/web/src/components/navigation/Sidebar.tsx b/web/src/components/navigation/Sidebar.tsx index 27ea9805c..af9a3bc5c 100644 --- a/web/src/components/navigation/Sidebar.tsx +++ b/web/src/components/navigation/Sidebar.tsx @@ -1,7 +1,7 @@ import Logo from "../Logo"; import NavItem from "./NavItem"; import { CameraGroupSelector } from "../filter/CameraGroupSelector"; -import { useLocation } from "react-router-dom"; +import { Link, useMatch } from "react-router-dom"; import GeneralSettings from "../menu/GeneralSettings"; import AccountSettings from "../menu/AccountSettings"; import useNavigation from "@/hooks/use-navigation"; @@ -9,20 +9,23 @@ import { baseUrl } from "@/api/baseUrl"; import { useMemo } from "react"; function Sidebar() { - const location = useLocation(); const basePath = useMemo(() => new URL(baseUrl).pathname, []); + const isRootMatch = useMatch("/"); + const isBasePathMatch = useMatch(basePath); + const navbarLinks = useNavigation(); return (