File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ const TopcoderHeader = () => {
58
58
59
59
tcUniNav ( 'init' , headerElId . current , {
60
60
type : navType ,
61
- toolName : getSubPageConfiguration ( ) . toolName ,
62
- toolRoot : getSubPageConfiguration ( ) . toolRoot ,
61
+ toolName : getSubPageConfiguration ( user . handle ) . toolName ,
62
+ toolRoot : getSubPageConfiguration ( user . handle ) . toolRoot ,
63
63
user : 'auto' ,
64
64
signOut : ( ) => {
65
65
window . location = `${ config . URL . BASE } /logout?ref=nav` ;
@@ -73,6 +73,13 @@ const TopcoderHeader = () => {
73
73
} ) ;
74
74
} , [ navType ] ) ;
75
75
76
+ useEffect ( ( ) => {
77
+ tcUniNav ( 'update' , headerElId . current , {
78
+ toolName : getSubPageConfiguration ( user . handle ) . toolName ,
79
+ user : isAuthenticated ? navigationUserInfo : null ,
80
+ } ) ;
81
+ } , [ isAuthenticated , navigationUserInfo ] ) ;
82
+
76
83
return (
77
84
< div styleName = "header-container" id = { headerElId . current } ref = { headerRef } />
78
85
) ;
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