diff --git a/src/shared/SideBar.tsx b/src/shared/SideBar.tsx index 590608b..3abbea0 100644 --- a/src/shared/SideBar.tsx +++ b/src/shared/SideBar.tsx @@ -20,8 +20,10 @@ const SideBar: FC = () => { const { openSidebar, setOpenSidebar, hasSubMenu, setSubMenuName, setSubtMenu, subMenuName } = useSharedStore() const location = useLocation() - const isActive = (name: string) => { - return window.location.href.includes(name) + const isActive = (path: string) => { + const pathname = location.pathname + if (path === '/') return pathname === '/' + return pathname === path || pathname.startsWith(path + '/') } useEffect(() => {