Skip to content

Tco22 #5585

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 4 commits into from
Jun 22, 2021
Merged

Tco22 #5585

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
20 changes: 20 additions & 0 deletions src/server/tc-communities/tco22/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"challengeFilter": {
"events": ["tco22"]
},
"communityId": "tco22",
"communityName": "TCO22",
"groupIds": [],
"hideSearch": true,
"logos": [{
"img": "/community-app-assets/themes/tco/TCO22.svg",
"url": "https://tco22.topcoder.com"
}],
"menuItems": [{
"navigationMenu": "5zZw57ZcKXWfOwwWbk5VnL"
}],
"newsFeed": "http://www.topcoder.com/feed",
"subdomains": ["tco22"],
"description": "2022 Topcoder Open. The Ultimate Programming & Design Tournament",
"image": "tco22.jpg"
}
2 changes: 2 additions & 0 deletions src/shared/routes/Communities/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import tco18 from './TCO18';
import tco19 from './TCO19';
import tco20 from './TCO20';
import tco21 from './TCO21';
import tco22 from './TCO22';
import Mobile from './Mobile';
import Zurich from './Zurich';
import Comcast from './Comcast';
Expand All @@ -64,6 +65,7 @@ const TCOs = {
tco19,
tco20,
tco21,
tco22,
};

export default function Communities({
Expand Down
60 changes: 60 additions & 0 deletions src/shared/routes/Communities/TCO22/Routes.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Routing of TCO22 Community.
*/

import Error404 from 'components/Error404';
import PT from 'prop-types';
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import ContentfulRoute from 'components/Contentful/Route';
import ContentfulMenu from 'components/Contentful/Menu';
import Profile from 'routes/Profile';
import ProfileStats from 'routes/ProfileStats';
import Settings from 'routes/Settings';

export default function TCO22({ base, meta }) {
return (
<div>
{
meta.menuItems ? (
<ContentfulMenu
id={meta.menuItems[0].navigationMenu}
spaceName={meta.menuItems[0].spaceName}
environment={meta.menuItems[0].environment}
baseUrl={base}
/>
) : null
}
<Switch>
<Route
render={props => <Profile {...props} meta={meta} />}
exact
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`}
/>
<Route
render={props => <ProfileStats {...props} meta={meta} />}
exact
path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`}
/>
<Route
component={() => <Settings base={`${base}/settings`} />}
path={`${base}/settings`}
/>
<ContentfulRoute
baseUrl={base}
error404={<Error404 />}
id="6Ewcb5fkc67JOMhud6RoBs"
/>
</Switch>
</div>
);
}

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

TCO22.propTypes = {
base: PT.string,
meta: PT.shape().isRequired,
};
32 changes: 32 additions & 0 deletions src/shared/routes/Communities/TCO22/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="tco22-community/chunk"
renderClientAsync={() => import(/* webpackChunkName: "tco22-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,
};