Skip to content

Commit be17b8a

Browse files
committed
Release of Learn page in Blockchain community + a few misc fixes
1 parent a8e76f0 commit be17b8a

File tree

8 files changed

+35
-9
lines changed

8 files changed

+35
-9
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"menuItems": [{
2525
"title": "Home",
2626
"url": "/"
27+
}, {
28+
"title": "Learn",
29+
"url": "/learn"
2730
}, {
2831
"title": "Challenges",
2932
"url": "/challenges"

src/shared/components/LeaderboardAvatar/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Avatar from 'components/Avatar';
44
import config from 'utils/config';
55
import React, { Component } from 'react';
66
import PT from 'prop-types';
7-
import { Link } from 'react-router-dom';
7+
import { Link } from 'utils/router';
88
import './style.scss';
99

1010
/* TODO: Should be functional component! */

src/shared/components/challenge-detail/Winners/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function Winners(props) {
2929
return (
3030
<div styleName="container">
3131
{
32-
winners && winners.filter(w => w.type === 'final').map((w) => {
32+
winners && winners.filter(w => !w.type || w.type === 'final').map((w) => {
3333
let placeStyle;
3434
if (winners.length === 2 && w.placement === 2) {
3535
placeStyle = 'place-2-alt';

src/shared/components/tc-communities/communities/blockchain/Learn/LearnTheBasics/index.jsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import Accordion from 'components/tc-communities/Accordion/Accordion';
22
import AccordionItem from 'components/tc-communities/Accordion/AccordionItem';
33
import JoinCommunity from 'containers/tc-communities/JoinCommunity';
4+
import PT from 'prop-types';
45
import React from 'react';
56
import Section from 'components/tc-communities/Section';
67
import Text from 'components/tc-communities/Text';
78

9+
import { Link } from 'react-router-dom';
10+
811
import style from './style.scss';
912

10-
export default function LearnTheBasics() {
13+
export default function LearnTheBasics({ baseUrl }) {
1114
return (
1215
<Section
1316
title="Learn The Basics"
@@ -37,8 +40,9 @@ export default function LearnTheBasics() {
3740
<Text>
3841
<p>
3942
If you are new to Topcoder, you can register through the
40-
Blockchain Community by clicking the Join Now button on the
41-
homepage. For more information on getting started with Topcoder,
43+
Blockchain Community by clicking the Join Now button on
44+
&zwnj;<Link to={baseUrl}>the homepage</Link>.
45+
For more information on getting started with Topcoder,
4246
visit
4347
&zwnj;<a
4448
href="https://www.topcoder.com/getting-started/"
@@ -69,7 +73,7 @@ export default function LearnTheBasics() {
6973
<p>
7074
Win prize money when you deliver the best solution to a challenge.
7175
You could also earn more as a copilot or reviewer or even win a
72-
large cash prize in our yearly tournament, Topcoder Open.
76+
large cash prize in our yearly tournament, the Topcoder Open.
7377
</p>
7478
<a
7579
className={style.joinnow}
@@ -100,3 +104,7 @@ export default function LearnTheBasics() {
100104
</Section>
101105
);
102106
}
107+
108+
LearnTheBasics.propTypes = {
109+
baseUrl: PT.string.isRequired,
110+
};

src/shared/components/tc-communities/communities/blockchain/Learn/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import LearnTheBasics from './LearnTheBasics';
2020
import style from './style.scss';
2121

2222
export default function Learn({
23+
baseUrl,
2324
consenSysRss,
2425
}) {
2526
return (
@@ -34,7 +35,7 @@ export default function Learn({
3435
}}
3536
imageSrc="/community-app-assets/themes/blockchain/learn/banner.jpg"
3637
/>
37-
<LearnTheBasics />
38+
<LearnTheBasics baseUrl={baseUrl} />
3839
<Section
3940
title="Learn More About Ethereum and Blockchain"
4041
theme={{
@@ -177,6 +178,7 @@ export default function Learn({
177178
container: style.resourcesContainer,
178179
}}
179180
>
181+
{/*
180182
<LinksCard
181183
title="From Topcoder Blog"
182184
links={[]}
@@ -185,8 +187,12 @@ export default function Learn({
185187
title="Bits on Blocks"
186188
links={[]}
187189
/>
190+
*/}
188191
<LinksCard
189192
title="Useful Information"
193+
theme={{
194+
container: style.linksCardContainer,
195+
}}
190196
links={[{
191197
openNewTab: true,
192198
title: 'reddit - Ethereum • r/ethereum',
@@ -233,5 +239,6 @@ Learn.defaultProps = {
233239
};
234240

235241
Learn.propTypes = {
242+
baseUrl: PT.string.isRequired,
236243
consenSysRss: PT.shape(),
237244
};

src/shared/components/tc-communities/communities/blockchain/Learn/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
}
9090
}
9191

92+
.linksCardContainer {
93+
width: 100%;
94+
}
95+
9296
.linksList {
9397
@include body-text;
9498

src/shared/containers/tc-communities/blockchain/Learn.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ class LearnPageContainer extends React.Component {
3434

3535
render() {
3636
const {
37+
baseUrl,
3738
consenSysRss,
3839
} = this.props;
3940
return (
4041
<LearnPage
42+
baseUrl={baseUrl}
4143
consenSysRss={consenSysRss}
4244
/>
4345
);
@@ -49,6 +51,7 @@ LearnPageContainer.defaultProps = {
4951
};
5052

5153
LearnPageContainer.propTypes = {
54+
baseUrl: PT.string.isRequired,
5255
consenSysRss: PT.shape({
5356
data: PT.object,
5457
loadingUuid: PT.string.isRequired,
@@ -57,8 +60,9 @@ LearnPageContainer.propTypes = {
5760
loadConsenSysRss: PT.func.isRequired,
5861
};
5962

60-
function mapStateToProps(state) {
63+
function mapStateToProps(state, ownProps) {
6164
return {
65+
baseUrl: ownProps.baseUrl,
6266
consenSysRss: state.rss.ConsenSys,
6367
};
6468
}

src/shared/routes/Communities/Blockchain/Routes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function Routes({ base, member, meta }) {
5050
path={`${base}/leaderboard`}
5151
/>
5252
<Route
53-
component={Learn}
53+
component={() => <Learn baseUrl={base} />}
5454
exact
5555
path={`${base}/learn`}
5656
/>

0 commit comments

Comments
 (0)