File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/components/layout/Navigation Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,19 @@ const Navigation: React.FC = () => {
150150 < nav className = { styles [ "sidebar-nav" ] } >
151151 < ul >
152152 { ! isRoleLoading && filteredNavItems . map ( ( item ) => {
153- const isActive = location . pathname === item . path ||
154- ( item . path !== "/" && location . pathname . startsWith ( item . path + "/" ) ) ;
153+ let isActive : boolean ;
154+
155+ if ( item . path === "/events" ) {
156+ isActive = location . pathname === "/events" ||
157+ ( location . pathname . startsWith ( "/events/" ) && ! location . pathname . startsWith ( "/events/approval" ) ) ;
158+ } else if ( item . path === "/users" ) {
159+ isActive = location . pathname === "/users" ||
160+ location . pathname . startsWith ( "/users/" ) ||
161+ location . pathname . startsWith ( "/repair/" ) ;
162+ } else {
163+ isActive = location . pathname === item . path ||
164+ ( item . path !== "/" && location . pathname . startsWith ( item . path + "/" ) ) ;
165+ }
155166
156167 return (
157168 < li key = { item . path } className = { isActive ? styles [ "active" ] : "" } >
You can’t perform that action at this time.
0 commit comments