From 01cdbd90b8028961384b47480c53da400dccfdee Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 5 Apr 2025 15:38:13 +0200 Subject: [PATCH] Show "nav bar item" as active for child routes --- src/modules/navigation-bar/components/DesktopSideBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/navigation-bar/components/DesktopSideBar.tsx b/src/modules/navigation-bar/components/DesktopSideBar.tsx index 052940ed..2bf88301 100644 --- a/src/modules/navigation-bar/components/DesktopSideBar.tsx +++ b/src/modules/navigation-bar/components/DesktopSideBar.tsx @@ -43,7 +43,7 @@ const NavigationBarItem = ({ path, title, IconComponent, SelectedIconComponent } const { isCollapsed } = useNavBarContext(); const theme = useTheme(); - const isActive = path === location.pathname; + const isActive = location.pathname.startsWith(path); const Icon = isActive ? SelectedIconComponent : IconComponent; const { listItemProps, listItemIconProps } = useMemo(