File tree 4 files changed +93
-18
lines changed
4 files changed +93
-18
lines changed Original file line number Diff line number Diff line change @@ -211,27 +211,37 @@ module.exports = {
211
211
GRANT_TYPE : '' ,
212
212
} ,
213
213
} ,
214
- HEADER_AUTH_URLS : {
215
- href : 'https://accounts.topcoder-dev.com/member/registration?utm_source=community-app-main' ,
216
- location : 'https://accounts.topcoder-dev.com/member?retUrl=%S&utm_source=community-app-main' ,
217
- } ,
218
- ACCOUNT_MENU : [
214
+ SECONDARY_MENU_FOR_LOGGED_USER : [
215
+ {
216
+ title : 'Dashboard' ,
217
+ href : '/my-dashboard' ,
218
+ } ,
219
+ {
220
+ id : 'myprofile' ,
221
+ title : 'My Profile' ,
222
+ href : '/members/' ,
223
+ } ,
224
+ {
225
+ title : 'Payments' ,
226
+ href : 'https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false' ,
227
+ } ,
228
+ ] ,
229
+ SECONDARY_MENU_FOR_GUEST : [
219
230
{
220
- title : 'Settings ' ,
221
- href : '/settings/profile ' ,
231
+ title : 'Overview ' ,
232
+ href : 'https://www.topcoder-dev.com/about ' ,
222
233
} ,
223
- { separator : true } ,
224
234
{
225
- title : 'Help ' ,
226
- href : 'https://help .topcoder-dev.com/' ,
235
+ title : 'How It Works ' ,
236
+ href : 'https://www .topcoder-dev.com/how-it-works/faqs /' ,
227
237
} ,
228
238
{
229
- title : 'About Topcoder ' ,
230
- href : 'https://www.topcoder.com/about/ ' ,
239
+ title : 'Tracks ' ,
240
+ href : '/community/learn ' ,
231
241
} ,
232
242
{
233
- title : 'Log Out ' ,
234
- href : 'https://www.topcoder-dev.com/logout ' ,
243
+ title : 'Why Join ' ,
244
+ href : 'https://www.topcoder-dev.com/about/why-crowdsourcing/ ' ,
235
245
} ,
236
246
] ,
237
247
ACCOUNT_MENU_SWITCH_TEXT : {
Original file line number Diff line number Diff line change @@ -56,4 +56,41 @@ module.exports = {
56
56
FILESTACK : {
57
57
SUBMISSION_CONTAINER : 'topcoder-submissions-dmz' ,
58
58
} ,
59
+ SECONDARY_MENU_FOR_LOGGED_USER : [
60
+ {
61
+ title : 'Dashboard' ,
62
+ href : '/my-dashboard' ,
63
+ } ,
64
+ {
65
+ id : 'myprofile' ,
66
+ title : 'My Profile' ,
67
+ href : '/members/' ,
68
+ } ,
69
+ {
70
+ title : 'Payments' ,
71
+ href : 'https://community.topcoder.com/PactsMemberServlet?module=PaymentHistory&full_list=false' ,
72
+ } ,
73
+ ] ,
74
+ SECONDARY_MENU_FOR_GUEST : [
75
+ {
76
+ title : 'Overview' ,
77
+ href : 'https://www.topcoder.com/about' ,
78
+ } ,
79
+ {
80
+ title : 'How It Works' ,
81
+ href : 'https://www.topcoder.com/how-it-works/faqs/' ,
82
+ } ,
83
+ {
84
+ title : 'Tracks' ,
85
+ href : '/community/learn' ,
86
+ } ,
87
+ {
88
+ title : 'Why Join' ,
89
+ href : 'https://www.topcoder.com/about/why-crowdsourcing/' ,
90
+ } ,
91
+ ] ,
92
+ ACCOUNT_MENU_SWITCH_TEXT : {
93
+ title : 'Switch to BUSINESS' ,
94
+ href : 'https://connect.topcoder.com' ,
95
+ } ,
59
96
} ;
Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
2
import { getService } from 'services/contentful' ;
3
- import { redux } from 'topcoder-react-utils' ;
3
+ import { redux , config } from 'topcoder-react-utils' ;
4
4
import { removeTrailingSlash } from 'utils/url' ;
5
5
import { menuItemBuilder , target as urlTarget } from 'utils/contentful' ;
6
6
import { services } from 'topcoder-react-lib' ;
@@ -228,6 +228,9 @@ async function getMenuDone(menuProps) {
228
228
} else {
229
229
menu = menuData ;
230
230
}
231
+ // add the preconfigured secondary menus
232
+ menu [ 0 ] . secondaryMenuForLoggedInUser = config . SECONDARY_MENU_FOR_LOGGED_USER ;
233
+ menu [ 0 ] . secondaryMenuForGuest = config . SECONDARY_MENU_FOR_GUEST ;
231
234
232
235
return {
233
236
id : menuProps . id ,
Original file line number Diff line number Diff line change @@ -87,18 +87,43 @@ class MenuLoaderContainer extends React.Component {
87
87
openMore = { openMore }
88
88
setOpenMore = { this . handleChangeOpenMore }
89
89
loggedIn = { ! _ . isEmpty ( auth . profile ) }
90
+ // profileHandle={auth.profile ? auth.profile.handle : ''}
90
91
rightMenu = { (
91
92
< LoginNav
92
93
loggedIn = { ! _ . isEmpty ( auth . profile ) }
93
94
notificationButtonState = "none"
94
95
notifications = { [ ] }
95
- accountMenu = { config . ACCOUNT_MENU }
96
+ accountMenu = { [
97
+ {
98
+ title : 'Settings' ,
99
+ href : '/settings/profile' ,
100
+ } ,
101
+ { separator : true } ,
102
+ {
103
+ title : 'Help' ,
104
+ href : config . URL . HELP ,
105
+ } ,
106
+ {
107
+ title : 'About Topcoder' ,
108
+ href : `${ config . URL . BASE } /about/` ,
109
+ } ,
110
+ {
111
+ title : 'Log Out' ,
112
+ href : `${ config . URL . BASE } /logout` ,
113
+ } ,
114
+ ] }
96
115
switchText = { config . ACCOUNT_MENU_SWITCH_TEXT }
97
116
onSwitch = { this . handleSwitchMenu }
98
117
onMenuOpen = { this . handleCloseOpenMore }
99
118
showNotification = { false }
100
- profile = { auth . profile }
101
- authURLs = { config . HEADER_AUTH_URLS }
119
+ profile = { {
120
+ ...auth . profile ,
121
+ roles : auth . user ? auth . user . roles : [ ] ,
122
+ } }
123
+ authURLs = { {
124
+ href : `${ config . URL . AUTH } /member/registration?utm_source=community-app-main` ,
125
+ location : `${ config . URL . AUTH } /member?retUrl=%S&utm_source=community-app-main` ,
126
+ } }
102
127
/>
103
128
) }
104
129
/>
You can’t perform that action at this time.
0 commit comments