File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed
Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ const en = {
113113 joins : "Join Requests" ,
114114 invitations : "Invitations" ,
115115 home : "Home" ,
116- feedback : "Feedback"
116+ feedback : "Feedback" ,
117+ profile : "Profile"
117118 } ,
118119 welcome : {
119120 greeting : "Welcome {{name}}" ,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const Profile = ({setIsAuthenticated}) => {
2424 useAppStore . setState ( {
2525 breadcrumbPaths : [
2626 { path : "/home" , value : I18n . t ( "profile.title" ) , menuItemName : mainMenuItems . home } ,
27- { value : I18n . t ( "breadCrumb.applications " ) }
27+ { value : I18n . t ( "breadCrumb.profile " ) }
2828 ]
2929 } ) ;
3030 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -116,20 +116,13 @@ export const allMenuGroups = [
116116]
117117
118118export const activeMenuItem = currentLocation => {
119- let path = currentLocation . pathname ;
120- if ( path === "/" ) {
121- path = "/home"
122- } else if ( path . startsWith ( "/users/" ) ) {
123- path = path . substring ( 0 , 7 )
124- } else if ( path . startsWith ( "/organization/" ) ) {
125- path = path . substring ( 0 , 13 )
126- } else if ( path . startsWith ( "/idp/" ) ) {
127- path = path . substring ( 0 , 5 )
128- }
119+ const path = currentLocation . pathname ;
120+ const secondSlash = path . indexOf ( '/' , 1 ) ;
121+ const strippedPath = secondSlash === - 1 ? path : path . substring ( 0 , secondSlash ) ;
129122 const activeItem = allMenuGroups
130123 . map ( group => group . items )
131124 . flat ( )
132- . find ( item => item . path . startsWith ( path ) ) ;
125+ . find ( item => item . path . startsWith ( strippedPath ) ) ;
133126 return activeItem ?. name || mainMenuItems . home ;
134127}
135128
You can’t perform that action at this time.
0 commit comments