File tree Expand file tree Collapse file tree 6 files changed +115
-8
lines changed
server/tc-communities/tco21 Expand file tree Collapse file tree 6 files changed +115
-8
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "challengeFilter" : {
3
+ "tags" : [" TCO" , " TCO21" ]
4
+ },
5
+ "communityId" : " tco21" ,
6
+ "communityName" : " TCO21" ,
7
+ "groupIds" : [],
8
+ "hideSearch" : true ,
9
+ "logos" : [{
10
+ "img" : " /community-app-assets/themes/tco/TCO21.svg" ,
11
+ "url" : " https://tco21.topcoder.com"
12
+ }],
13
+ "menuItems" : [{
14
+ "navigationMenu" : " 3UBKZJ0qMHAkqrobue73NB"
15
+ }],
16
+ "newsFeed" : " http://www.topcoder.com/feed" ,
17
+ "subdomains" : [" tco21" ],
18
+ "description" : " 2021 Topcoder Open. The Ultimate Programming & Design Tournament" ,
19
+ "image" : " tco21.jpg"
20
+ }
Original file line number Diff line number Diff line change @@ -181,12 +181,13 @@ async function getMenuDone(menuProps) {
181
181
cR2 . fields . childRoutes ,
182
182
cR3 => service . getEntry ( cR3 . sys . id ) . then (
183
183
async ( c3 ) => {
184
- const sI3 = menuItemBuilder ( url2 , c3 ) ;
184
+ const url3 = urlTarget ( url2 , cR2 ) ;
185
+ const sI3 = menuItemBuilder ( url3 , c3 ) ;
185
186
if ( c3 . fields . childRoutes ) {
186
187
sI3 . subMenu = await Promise . all ( _ . map (
187
188
c3 . fields . childRoutes ,
188
189
cR4 => service . getEntry ( cR4 . sys . id ) . then (
189
- c4 => menuItemBuilder ( urlTarget ( url2 , c3 ) , c4 ) ,
190
+ c4 => menuItemBuilder ( url3 , c4 ) ,
190
191
) ,
191
192
) ) ;
192
193
}
Original file line number Diff line number Diff line change @@ -79,11 +79,6 @@ class MenuLoaderContainer extends React.Component {
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
81
const menuTheme = fields . theme . split ( '- ' ) ;
82
- const comboMenu = _ . flatten ( _ . map ( menu , menuItem => menuItem . subMenu ) ) ;
83
- // This is a hack fix that should be removed when possible!
84
- // Its orifing is in the https://github.com/topcoder-platform/navigation-component module
85
- // which breaks if there is NOT an menu item with id = `community`
86
- comboMenu [ 0 ] . id = 'community' ;
87
82
let normalizedProfile = auth . profile && _ . clone ( auth . profile ) ;
88
83
if ( auth . profile ) {
89
84
normalizedProfile . photoURL = ( _ . has ( auth . profile , 'photoURL' ) && auth . profile . photoURL !== null )
@@ -94,7 +89,7 @@ class MenuLoaderContainer extends React.Component {
94
89
return (
95
90
< div >
96
91
< TopNav
97
- menu = { comboMenu }
92
+ menu = { menu }
98
93
rightMenu = { (
99
94
< LoginNav
100
95
loggedIn = { ! _ . isEmpty ( auth . profile ) }
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import tco17 from './TCO17';
37
37
import tco18 from './TCO18' ;
38
38
import tco19 from './TCO19' ;
39
39
import tco20 from './TCO20' ;
40
+ import tco21 from './TCO21' ;
40
41
import Mobile from './Mobile' ;
41
42
import Zurich from './Zurich' ;
42
43
import Comcast from './Comcast' ;
@@ -62,6 +63,7 @@ const TCOs = {
62
63
tco18,
63
64
tco19,
64
65
tco20,
66
+ tco21,
65
67
} ;
66
68
67
69
export default function Communities ( {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Routing of TCO21 Community.
3
+ */
4
+
5
+ import Error404 from 'components/Error404' ;
6
+ import PT from 'prop-types' ;
7
+ import React from 'react' ;
8
+ import { Route , Switch } from 'react-router-dom' ;
9
+ import ContentfulRoute from 'components/Contentful/Route' ;
10
+ import ContentfulMenu from 'components/Contentful/Menu' ;
11
+ import Profile from 'routes/Profile' ;
12
+ import ProfileStats from 'routes/ProfileStats' ;
13
+ import Footer from 'components/TopcoderFooter' ;
14
+
15
+ export default function TCO21 ( { base, meta } ) {
16
+ return (
17
+ < div >
18
+ {
19
+ meta . menuItems ? (
20
+ < ContentfulMenu
21
+ id = { meta . menuItems [ 0 ] . navigationMenu }
22
+ spaceName = { meta . menuItems [ 0 ] . spaceName }
23
+ environment = { meta . menuItems [ 0 ] . environment }
24
+ baseUrl = { base }
25
+ />
26
+ ) : null
27
+ }
28
+ < Switch >
29
+ < Route
30
+ render = { props => < Profile { ...props } meta = { meta } /> }
31
+ exact
32
+ path = { `${ base } /members/:handle([\\w\\-\\[\\].{}]{2,15})` }
33
+ />
34
+ < Route
35
+ render = { props => < ProfileStats { ...props } meta = { meta } /> }
36
+ exact
37
+ path = { `${ base } /members/:handle([\\w\\-\\[\\].{}]{2,15})/details` }
38
+ />
39
+ < ContentfulRoute
40
+ baseUrl = { base }
41
+ error404 = { < Error404 /> }
42
+ id = "6wUJl6RRF6MxI3kR6DFq5t"
43
+ />
44
+ </ Switch >
45
+ < Footer />
46
+ </ div >
47
+ ) ;
48
+ }
49
+
50
+ TCO21 . defaultProps = {
51
+ base : '' ,
52
+ } ;
53
+
54
+ TCO21 . propTypes = {
55
+ base : PT . string ,
56
+ meta : PT . shape ( ) . isRequired ,
57
+ } ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Loader for the community's code chunks.
3
+ */
4
+
5
+ import LoadingIndicator from 'components/LoadingIndicator' ;
6
+ import path from 'path' ;
7
+ import PT from 'prop-types' ;
8
+ import React from 'react' ;
9
+ import { AppChunk , webpack } from 'topcoder-react-utils' ;
10
+
11
+ export default function ChunkLoader ( { base, meta } ) {
12
+ return (
13
+ < AppChunk
14
+ chunkName = "tco21-community/chunk"
15
+ renderClientAsync = { ( ) => import ( /* webpackChunkName: "tco21-community/chunk" */ './Routes' )
16
+ . then ( ( { default : Routes } ) => (
17
+ < Routes base = { base } meta = { meta } />
18
+ ) )
19
+ }
20
+ renderPlaceholder = { ( ) => < LoadingIndicator /> }
21
+ renderServer = { ( ) => {
22
+ const Routes = webpack . requireWeak ( path . resolve ( __dirname , './Routes' ) ) ;
23
+ return < Routes base = { base } meta = { meta } /> ;
24
+ } }
25
+ />
26
+ ) ;
27
+ }
28
+
29
+ ChunkLoader . propTypes = {
30
+ base : PT . string . isRequired ,
31
+ meta : PT . shape ( ) . isRequired ,
32
+ } ;
You can’t perform that action at this time.
0 commit comments