Skip to content

Commit 74f70e9

Browse files
authored
Merge pull request #2285 from topcoder-platform/legacy-tco
Legacy tco
2 parents 07fa949 + 532cb3b commit 74f70e9

File tree

7 files changed

+195
-61
lines changed

7 files changed

+195
-61
lines changed

src/assets/themes/tco17/TCO17.svg

Lines changed: 58 additions & 0 deletions
Loading

src/assets/themes/tco18/TCO18.svg

Lines changed: 38 additions & 55 deletions
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"communityId": "tco17",
3+
"hidden": true,
4+
"communityName": "TCO17",
5+
"groupIds": [],
6+
"hideSearch": true,
7+
"logos": [{
8+
"img": "/community-app-assets/themes/tco17/TCO17.svg",
9+
"url": "https://tco17.topcoder.com"
10+
}],
11+
"menuItems": [{
12+
"navigationMenu": "79hTTwQuoJdnFtsagyOEOT"
13+
}],
14+
"newsFeed": "http://www.topcoder.com/feed",
15+
"subdomains": ["tco17"],
16+
"description": "2017 Topcoder Open. The Ultimate Programming & Design Tournament"
17+
}

src/server/tc-communities/tco18/metadata.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
2-
"challengeFilter": {
3-
"groupIds": [],
4-
"or": [{
5-
"tags": ["TCO", "TCO18"]
6-
}]
7-
},
82
"communityId": "tco18",
93
"hidden": true,
104
"communityName": "TCO18",

src/shared/routes/Communities/Routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Veterans from './Veterans';
1717
import Wipro from './Wipro';
1818
import Cognitive from './Cognitive';
1919
import IoT from './iot';
20+
import TCO17 from './TCO17';
2021
import TCO18 from './TCO18';
2122
import TCO19 from './TCO19';
2223
import Mobile from './Mobile';
@@ -41,6 +42,7 @@ export default function Communities({
4142
case 'wipro': return <Wipro base={base} meta={meta} />;
4243
case 'cognitive': return <Cognitive base={base} member={member} meta={meta} />;
4344
case 'iot': return <IoT base={base} meta={meta} />;
45+
case 'tco17': return <TCO17 base={base} meta={meta} />;
4446
case 'tco18': return <TCO18 base={base} meta={meta} />;
4547
case 'tco19': return <TCO19 base={base} meta={meta} />;
4648
case 'mobile': return <Mobile base={base} meta={meta} />;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Routing of TCO17 Community.
3+
*/
4+
5+
import ContentfulRoute from 'components/Contentful/Route';
6+
import Error404 from 'components/Error404';
7+
import Header from 'containers/tc-communities/Header';
8+
import PT from 'prop-types';
9+
import React from 'react';
10+
import { Route, Switch } from 'react-router-dom';
11+
12+
import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss';
13+
14+
export default function TCO17({ base }) {
15+
return (
16+
<Route
17+
component={({ match }) => (
18+
<div>
19+
<Header
20+
baseUrl={base}
21+
pageId={match.params.pageId || 'home'}
22+
theme={headerTheme}
23+
/>
24+
<Switch>
25+
<ContentfulRoute
26+
baseUrl={base}
27+
error404={<Error404 />}
28+
id="6z8qhXNgbwMhFqhmJJmroJ"
29+
/>
30+
<Route
31+
component={Error404}
32+
path={`${base}/:any`}
33+
/>
34+
</Switch>
35+
</div>
36+
)}
37+
path={`${base}/:pageId?`}
38+
/>
39+
);
40+
}
41+
42+
TCO17.defaultProps = {
43+
base: '',
44+
};
45+
46+
TCO17.propTypes = {
47+
base: PT.string,
48+
};
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="tco17-community/chunk"
15+
renderClientAsync={() => import(/* webpackChunkName: "tco17-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)