Skip to content

Legacy tco #2285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/assets/themes/tco17/TCO17.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 38 additions & 55 deletions src/assets/themes/tco18/TCO18.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/server/tc-communities/tco17/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"communityId": "tco17",
"hidden": true,
"communityName": "TCO17",
"groupIds": [],
"hideSearch": true,
"logos": [{
"img": "/community-app-assets/themes/tco17/TCO17.svg",
"url": "https://tco17.topcoder.com"
}],
"menuItems": [{
"navigationMenu": "79hTTwQuoJdnFtsagyOEOT"
}],
"newsFeed": "http://www.topcoder.com/feed",
"subdomains": ["tco17"],
"description": "2017 Topcoder Open. The Ultimate Programming & Design Tournament"
}
6 changes: 0 additions & 6 deletions src/server/tc-communities/tco18/metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"challengeFilter": {
"groupIds": [],
"or": [{
"tags": ["TCO", "TCO18"]
}]
},
"communityId": "tco18",
"hidden": true,
"communityName": "TCO18",
Expand Down
2 changes: 2 additions & 0 deletions src/shared/routes/Communities/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Veterans from './Veterans';
import Wipro from './Wipro';
import Cognitive from './Cognitive';
import IoT from './iot';
import TCO17 from './TCO17';
import TCO18 from './TCO18';
import TCO19 from './TCO19';
import Mobile from './Mobile';
Expand All @@ -41,6 +42,7 @@ export default function Communities({
case 'wipro': return <Wipro base={base} meta={meta} />;
case 'cognitive': return <Cognitive base={base} member={member} meta={meta} />;
case 'iot': return <IoT base={base} meta={meta} />;
case 'tco17': return <TCO17 base={base} meta={meta} />;
case 'tco18': return <TCO18 base={base} meta={meta} />;
case 'tco19': return <TCO19 base={base} meta={meta} />;
case 'mobile': return <Mobile base={base} meta={meta} />;
Expand Down
48 changes: 48 additions & 0 deletions src/shared/routes/Communities/TCO17/Routes.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Routing of TCO17 Community.
*/

import ContentfulRoute from 'components/Contentful/Route';
import Error404 from 'components/Error404';
import Header from 'containers/tc-communities/Header';
import PT from 'prop-types';
import React from 'react';
import { Route, Switch } from 'react-router-dom';

import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss';

export default function TCO17({ base }) {
return (
<Route
component={({ match }) => (
<div>
<Header
baseUrl={base}
pageId={match.params.pageId || 'home'}
theme={headerTheme}
/>
<Switch>
<ContentfulRoute
baseUrl={base}
error404={<Error404 />}
id="6z8qhXNgbwMhFqhmJJmroJ"
/>
<Route
component={Error404}
path={`${base}/:any`}
/>
</Switch>
</div>
)}
path={`${base}/:pageId?`}
/>
);
}

TCO17.defaultProps = {
base: '',
};

TCO17.propTypes = {
base: PT.string,
};
32 changes: 32 additions & 0 deletions src/shared/routes/Communities/TCO17/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Loader for the community's code chunks.
*/

import LoadingIndicator from 'components/LoadingIndicator';
import path from 'path';
import PT from 'prop-types';
import React from 'react';
import { AppChunk, webpack } from 'topcoder-react-utils';

export default function ChunkLoader({ base, meta }) {
return (
<AppChunk
chunkName="tco17-community/chunk"
renderClientAsync={() => import(/* webpackChunkName: "tco17-community/chunk" */ './Routes')
.then(({ default: Routes }) => (
<Routes base={base} meta={meta} />
))
}
renderPlaceholder={() => <LoadingIndicator />}
renderServer={() => {
const Routes = webpack.requireWeak(path.resolve(__dirname, './Routes'));
return <Routes base={base} meta={meta} />;
}}
/>
);
}

ChunkLoader.propTypes = {
base: PT.string.isRequired,
meta: PT.shape().isRequired,
};