Skip to content

Commit 640e2ba

Browse files
Merge pull request #2649 from ya3ya6/feature-new-nav
Fix Issue #2396
2 parents 8576a47 + 43fe9af commit 640e2ba

File tree

4 files changed

+103
-24
lines changed

4 files changed

+103
-24
lines changed

__tests__/shared/components/Header/__snapshots__/index.jsx.snap

+35-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`Default render 1`] = `
44
<div>
55
<TopNav
6+
loggedIn={true}
67
logo={
78
<Logo
89
height="20"
@@ -15,6 +16,39 @@ exports[`Default render 1`] = `
1516
Array [
1617
Object {
1718
"id": "community",
19+
"secondaryMenuForGuest": Array [
20+
Object {
21+
"href": "https://www.topcoder-dev.com/about",
22+
"title": "Overview",
23+
},
24+
Object {
25+
"href": "https://www.topcoder-dev.com/how-it-works/faqs/",
26+
"title": "How It Works",
27+
},
28+
Object {
29+
"href": "/community/learn",
30+
"title": "Tracks",
31+
},
32+
Object {
33+
"href": "https://www.topcoder-dev.com/about/why-crowdsourcing/",
34+
"title": "Why Join",
35+
},
36+
],
37+
"secondaryMenuForLoggedInUser": Array [
38+
Object {
39+
"href": "/my-dashboard",
40+
"title": "Dashboard",
41+
},
42+
Object {
43+
"href": "/members/willFilledByUserName",
44+
"id": "myprofile",
45+
"title": "My Profile",
46+
},
47+
Object {
48+
"href": "https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false",
49+
"title": "Payments",
50+
},
51+
],
1852
"subMenu": Array [
1953
Object {
2054
"subMenu": Array [
@@ -90,6 +124,7 @@ exports[`Default render 1`] = `
90124
}
91125
onChangeLevel1Id={[Function]}
92126
openMore={true}
127+
profileHandle="huanner"
93128
rightMenu={
94129
<LoginNav
95130
accountMenu={
@@ -98,14 +133,6 @@ exports[`Default render 1`] = `
98133
"href": "/settings/profile",
99134
"title": "Settings",
100135
},
101-
Object {
102-
"href": "https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false",
103-
"title": "Payments",
104-
},
105-
Object {
106-
"link": null,
107-
"title": "All projects",
108-
},
109136
Object {
110137
"separator": true,
111138
},

config/default.js

+33-8
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,39 @@ module.exports = {
217217
{
218218
id: 'community', // required for 'Switch to BUSINESS' to work
219219
title: 'COMMUNITY',
220+
secondaryMenuForLoggedInUser: [
221+
{
222+
title: 'Dashboard',
223+
href: '/my-dashboard',
224+
},
225+
{
226+
id: 'myprofile',
227+
title: 'My Profile',
228+
href: '/members/willFilledByUserName',
229+
},
230+
{
231+
title: 'Payments',
232+
href: 'https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false',
233+
},
234+
],
235+
secondaryMenuForGuest: [
236+
{
237+
title: 'Overview',
238+
href: 'https://www.topcoder-dev.com/about',
239+
},
240+
{
241+
title: 'How It Works',
242+
href: 'https://www.topcoder-dev.com/how-it-works/faqs/',
243+
},
244+
{
245+
title: 'Tracks',
246+
href: '/community/learn',
247+
},
248+
{
249+
title: 'Why Join',
250+
href: 'https://www.topcoder-dev.com/about/why-crowdsourcing/',
251+
},
252+
],
220253
subMenu: [
221254
{
222255
title: 'Compete',
@@ -298,14 +331,6 @@ module.exports = {
298331
title: 'Settings',
299332
href: '/settings/profile',
300333
},
301-
{
302-
title: 'Payments',
303-
href: 'https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false',
304-
},
305-
{
306-
title: 'All projects',
307-
link: null,
308-
},
309334
{ separator: true },
310335
{
311336
title: 'Help',

config/production.js

+33-8
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,39 @@ module.exports = {
6060
{
6161
id: 'community', // required for 'Switch to BUSINESS' to work
6262
title: 'COMMUNITY',
63+
secondaryMenuForLoggedInUser: [
64+
{
65+
title: 'Dashboard',
66+
href: '/my-dashboard',
67+
},
68+
{
69+
id: 'myprofile',
70+
title: 'My Profile',
71+
href: '/members/willFilledByUserName',
72+
},
73+
{
74+
title: 'Payments',
75+
href: 'https://community.topcoder.com/PactsMemberServlet?module=PaymentHistory&full_list=false',
76+
},
77+
],
78+
secondaryMenuForGuest: [
79+
{
80+
title: 'Overview',
81+
href: 'https://www.topcoder.com/about',
82+
},
83+
{
84+
title: 'How It Works',
85+
href: 'https://www.topcoder.com/how-it-works/faqs/',
86+
},
87+
{
88+
title: 'Tracks',
89+
href: '/community/learn',
90+
},
91+
{
92+
title: 'Why Join',
93+
href: 'https://www.topcoder.com/about/why-crowdsourcing/',
94+
},
95+
],
6396
subMenu: [
6497
{
6598
title: 'Compete',
@@ -141,14 +174,6 @@ module.exports = {
141174
title: 'Settings',
142175
href: '/settings/profile',
143176
},
144-
{
145-
title: 'Payments',
146-
href: 'https://community.topcoder.com/PactsMemberServlet?module=PaymentHistory&full_list=false',
147-
},
148-
{
149-
title: 'All projects',
150-
link: null,
151-
},
152177
{ separator: true },
153178
{
154179
title: 'Help',

src/shared/components/Header/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ const Header = ({ profile }) => {
7474
path={path}
7575
openMore={openMore}
7676
setOpenMore={handleChangeOpenMore}
77+
loggedIn={!_.isEmpty(profile)}
78+
profileHandle={profile ? profile.handle : ''}
7779
/>
7880
</div>
7981
);

0 commit comments

Comments
 (0)