Skip to content

Commit ed587ce

Browse files
committed
Footer type config
1 parent 5a96091 commit ed587ce

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/shared/components/TopcoderFooter/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* global tcUniNav */
22
import React, { useEffect, useRef, useState } from 'react';
3+
import {getSubPageConfiguration } from '../utils/url';
34

45
let uniqueId = 0;
56

@@ -22,6 +23,7 @@ export default function TopcoderFooter() {
2223

2324
tcUniNav('init', `footerNav-${footerId}`, {
2425
type: 'footer',
26+
fullFooter: getSubPageConfiguration().fullFooter,
2527
});
2628
}, [footerId]);
2729

src/shared/utils/url.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export const getSubPageConfiguration = () => {
169169
let toolRoot = '/';
170170
let loginRedirect = '/';
171171
let type = 'tool';
172+
let fullFooter = false;
172173

173174
const url = window.location.pathname;
174175

@@ -177,117 +178,134 @@ export const getSubPageConfiguration = () => {
177178
toolRoot = '/gigs';
178179
loginRedirect = '/gigs';
179180
type = 'marketing';
181+
fullFooter = true;
180182
}
181183

182184
if (url.includes('/thrive')) {
183185
toolName = 'Articles';
184186
toolRoot = '/thrive';
185187
loginRedirect = '/thrive';
186188
type = 'marketing';
189+
fullFooter = true;
187190
}
188191

189192
if (url.includes('/community/arena')) {
190193
toolName = 'SRMs (Arena)';
191194
toolRoot = '/community/arena';
192195
loginRedirect = '/community/arena';
193196
type = 'marketing';
197+
fullFooter = true;
194198
}
195199

196200
if (url.includes('/challenges')) {
197201
toolName = 'Activity Feed';
198202
toolRoot = '/challenges';
199203
loginRedirect = '/challenges';
200204
type = 'tool';
205+
fullFooter = false;
201206
}
202207

203208
if (url.includes('/members')) {
204209
toolName = 'My Profile';
205210
toolRoot = url;
206211
loginRedirect = url;
207212
type = 'tool';
213+
fullFooter = false;
208214
}
209215

210216
if (url.includes('/privacy')) {
211217
toolName = 'Privacy Policy';
212218
toolRoot = '/privacy';
213219
loginRedirect = '/privacy';
214220
type = 'marketing';
221+
fullFooter = true;
215222
}
216223

217224
if (url.includes('/community/programs-and-events')) {
218225
toolName = 'Announcements';
219226
toolRoot = '/community/programs-and-events';
220227
loginRedirect = '/community/programs-and-events';
221228
type = 'marketing';
229+
fullFooter = true;
222230
}
223231

224232
if (url.includes('/community/gig-resources')) {
225233
toolName = 'Gigs';
226234
toolRoot = '/community/gig-resources';
227235
loginRedirect = '/community/gig-resources';
228236
type = 'marketing';
237+
fullFooter = true;
229238
}
230239

231240
if (url.includes('/community/practice')) {
232241
toolName = 'Challenge Practice';
233242
toolRoot = '/community/practice';
234243
loginRedirect = '/community/practice';
235244
type = 'marketing';
245+
fullFooter = true;
236246
}
237247

238248
if (url.includes('/community/events')) {
239249
toolName = 'Events';
240250
toolRoot = '/community/events';
241251
loginRedirect = '/community/events';
242252
type = 'marketing';
253+
fullFooter = true;
243254
}
244255

245256
if (url.includes('/community/member-programs/topcoder-open')) {
246257
toolName = 'Topcoder Open';
247258
toolRoot = '/community/member-programs/topcoder-open';
248259
loginRedirect = '/community/member-programs/topcoder-open';
249260
type = 'marketing';
261+
fullFooter = true;
250262
}
251263

252264
if (url.includes('/settings')) {
253265
toolName = 'Account Settings';
254266
toolRoot = '/settings/profile';
255267
loginRedirect = '/settings/profile';
256268
type = 'tool';
269+
fullFooter = false;
257270
}
258271

259272
if (url.includes('/community/statistics')) {
260273
toolName = 'Statistics';
261274
toolRoot = '/community/statistics';
262275
loginRedirect = '/community/statistics';
263276
type = 'marketing';
277+
fullFooter = true;
264278
}
265279

266280
if (url.includes('/community/safetywing')) {
267281
toolName = 'Healthcare';
268282
toolRoot = '/community/safetywing';
269283
loginRedirect = '/community/safetywing';
270284
type = 'marketing';
285+
fullFooter = true;
271286
}
272287

273288
if (url.includes('/community/timeline-wall')) {
274289
toolName = 'Timeline';
275290
toolRoot = '/community/timeline-wall';
276291
loginRedirect = '/community/timeline-wall';
277292
type = 'marketing';
293+
fullFooter = true;
278294
}
279295

280296
if (url.includes('/home')) {
281297
toolName = 'Home';
282298
toolRoot = '/home';
283299
loginRedirect = '/home';
284300
type = 'marketing';
301+
fullFooter = true;
285302
}
286303
return {
287304
toolName,
288305
toolRoot,
289306
loginRedirect,
290307
type,
308+
fullFooter,
291309
};
292310
};
293311

0 commit comments

Comments
 (0)