@@ -78,56 +78,42 @@ class MenuLoaderContainer extends React.Component {
78
78
// eslint-disable-next-line global-require
79
79
const { TopNav, LoginNav } = require ( 'navigation-component' ) ;
80
80
const logoToUse = ! _ . isEmpty ( menuLogo ) ? < img src = { menuLogo . fields . file . url } alt = "menu logo" /> : < Logo /> ;
81
+ const comboMenu = _ . clone ( config . HEADER_MENU ) ;
82
+ comboMenu [ 1 ] . subMenu = _ . clone ( menu [ 0 ] . subMenu ) ;
83
+ let normalizedProfile = auth . profile && _ . clone ( auth . profile ) ;
84
+ if ( auth . profile ) {
85
+ normalizedProfile . photoURL = ( _ . has ( auth . profile , 'photoURL' ) && auth . profile . photoURL !== null )
86
+ ? `${ config . CDN . PUBLIC } /avatar/${ encodeURIComponent ( auth . profile . photoURL ) } ?size=32` : '' ;
87
+ } else {
88
+ normalizedProfile = null ;
89
+ }
81
90
return (
82
91
< div >
83
92
< TopNav
84
- menu = { menu }
85
- logo = { logoToUse }
86
- currentLevel1Id = { activeLevel1Id }
87
- onChangeLevel1Id = { this . handleChangeLevel1Id }
88
- path = { path }
89
- openMore = { openMore }
90
- setOpenMore = { this . handleChangeOpenMore }
91
- loggedIn = { ! _ . isEmpty ( auth . profile ) }
92
- // profileHandle={auth.profile ? auth.profile.handle : ''}
93
+ menu = { comboMenu }
93
94
rightMenu = { (
94
95
< LoginNav
95
96
loggedIn = { ! _ . isEmpty ( auth . profile ) }
96
97
notificationButtonState = "none"
97
98
notifications = { [ ] }
98
- accountMenu = { [
99
- {
100
- title : 'Settings' ,
101
- href : '/settings/profile' ,
102
- } ,
103
- { separator : true } ,
104
- {
105
- title : 'Help' ,
106
- href : config . URL . HELP ,
107
- } ,
108
- {
109
- title : 'About Topcoder' ,
110
- href : `${ config . URL . BASE } /about/` ,
111
- } ,
112
- {
113
- title : 'Log Out' ,
114
- href : `${ config . URL . BASE } /logout` ,
115
- } ,
116
- ] }
99
+ accountMenu = { config . ACCOUNT_MENU }
117
100
switchText = { config . ACCOUNT_MENU_SWITCH_TEXT }
118
101
onSwitch = { this . handleSwitchMenu }
119
102
onMenuOpen = { this . handleCloseOpenMore }
120
103
showNotification = { false }
121
- profile = { {
122
- ...auth . profile ,
123
- roles : auth . user ? auth . user . roles : [ ] ,
124
- } }
125
- authURLs = { {
126
- href : `${ config . URL . AUTH } /member/registration?utm_source=community-app-main` ,
127
- location : `${ config . URL . AUTH } /member?retUrl=%S&utm_source=community-app-main` ,
128
- } }
104
+ profile = { normalizedProfile }
105
+ authURLs = { config . HEADER_AUTH_URLS }
129
106
/>
130
107
) }
108
+ logo = { logoToUse }
109
+ theme = { config . HEADER_MENU_THEME }
110
+ currentLevel1Id = { activeLevel1Id }
111
+ onChangeLevel1Id = { this . handleChangeLevel1Id }
112
+ path = { path }
113
+ openMore = { openMore }
114
+ setOpenMore = { this . handleChangeOpenMore }
115
+ loggedIn = { ! _ . isEmpty ( auth . profile ) }
116
+ profileHandle = { auth . profile ? auth . profile . handle : '' }
131
117
/>
132
118
</ div >
133
119
) ;
0 commit comments