File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ const TopcoderHeader = ({ auth }) => {
68
68
69
69
tcUniNav ( 'init' , headerElId . current , {
70
70
type : navType ,
71
- toolName : getSubPageConfiguration ( ) . toolName ,
72
- toolRoot : getSubPageConfiguration ( ) . toolRoot ,
71
+ toolName : getSubPageConfiguration ( user . handle ) . toolName ,
72
+ toolRoot : getSubPageConfiguration ( user . handle ) . toolRoot ,
73
73
signOut : ( ) => {
74
74
window . location = `${ config . URL . BASE } /logout?ref=nav` ;
75
75
} ,
@@ -84,6 +84,7 @@ const TopcoderHeader = ({ auth }) => {
84
84
85
85
useEffect ( ( ) => {
86
86
tcUniNav ( 'update' , headerElId . current , {
87
+ toolName : getSubPageConfiguration ( user . handle ) . toolName ,
87
88
user : isAuthenticated ? navigationUserInfo : null ,
88
89
} ) ;
89
90
} , [ isAuthenticated , navigationUserInfo ] ) ;
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export function getInitials(firstName = '', lastName = '') {
164
164
165
165
export const DEFAULT_AVATAR_URL = 'https://images.ctfassets.net/b5f1djy59z3a/4PTwZVSf3W7qgs9WssqbVa/4c51312671a4b9acbdfd7f5e22320b62/default_avatar.svg' ;
166
166
167
- export const getSubPageConfiguration = ( ) => {
167
+ export const getSubPageConfiguration = ( loginUserHandle ) => {
168
168
let toolName = 'Community' ;
169
169
let toolRoot = '/' ;
170
170
let loginRedirect = '/' ;
@@ -206,7 +206,8 @@ export const getSubPageConfiguration = () => {
206
206
}
207
207
208
208
if ( url . includes ( '/members' ) ) {
209
- toolName = 'My Profile' ;
209
+ const handle = url . substring ( url . lastIndexOf ( '/' ) + 1 ) ;
210
+ toolName = loginUserHandle && handle && loginUserHandle . toLowerCase ( ) === handle . toLocaleLowerCase ( ) ? 'My Profile' : 'Profiles' ;
210
211
toolRoot = url ;
211
212
loginRedirect = url ;
212
213
type = 'tool' ;
You can’t perform that action at this time.
0 commit comments