Skip to content

Commit 62063e6

Browse files
committed
Create TCO20
1 parent d4833b7 commit 62063e6

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"challengeFilter": {
3+
"tags": ["TCO", "TCO20"]
4+
},
5+
"communityId": "tco20",
6+
"communityName": "TCO20",
7+
"groupIds": [],
8+
"hideSearch": true,
9+
"logos": [{
10+
"img": "/community-app-assets/themes/tco/TCO20.svg",
11+
"url": "https://tco20.topcoder.com"
12+
}],
13+
"menuItems": [{
14+
"navigationMenu": "6q4ckEC3QlJ8K30mZw641D"
15+
}],
16+
"newsFeed": "http://www.topcoder.com/feed",
17+
"subdomains": ["tco20"],
18+
"description": "2020 Topcoder Open. The Ultimate Programming & Design Tournament",
19+
"image": "tco20.jpg"
20+
}

src/shared/routes/Communities/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import tco16 from './TCO16';
3636
import tco17 from './TCO17';
3737
import tco18 from './TCO18';
3838
import tco19 from './TCO19';
39+
import tco20 from './TCO20';
3940
import Mobile from './Mobile';
4041
import Zurich from './Zurich';
4142

@@ -59,6 +60,7 @@ const TCOs = {
5960
tco17,
6061
tco18,
6162
tco19,
63+
tco20,
6264
};
6365

6466
export default function Communities({
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Routing of TCO20 Community.
3+
*/
4+
5+
import Error404 from 'components/Error404';
6+
import PT from 'prop-types';
7+
import React from 'react';
8+
import ContentfulRoute from 'components/Contentful/Route';
9+
import ContentfulMenu from 'components/Contentful/Menu';
10+
import Viewport from 'components/Contentful/Viewport';
11+
12+
export default function TCO20({ base, meta }) {
13+
return (
14+
<div>
15+
{
16+
meta.menuItems ? (
17+
<ContentfulMenu
18+
id={meta.menuItems[0].navigationMenu}
19+
spaceName={meta.menuItems[0].spaceName}
20+
environment={meta.menuItems[0].environment}
21+
baseUrl={base}
22+
/>
23+
) : null
24+
}
25+
<ContentfulRoute
26+
baseUrl={base}
27+
error404={<Error404 />}
28+
id="2Ls9DElilYWV3X2p8qN2EN"
29+
/>
30+
<Viewport
31+
id="65z6CPtAE091BkbEUKHG0V"
32+
baseUrl={base}
33+
/>
34+
</div>
35+
);
36+
}
37+
38+
TCO20.defaultProps = {
39+
base: '',
40+
};
41+
42+
TCO20.propTypes = {
43+
base: PT.string,
44+
meta: PT.shape().isRequired,
45+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="tco20-community/chunk"
15+
renderClientAsync={() => import(/* webpackChunkName: "tco20-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+
};

0 commit comments

Comments
 (0)