Skip to content

Commit ef5748f

Browse files
committed
Merge branch 'develop' into f2f-design-submission-page-fixes-2
2 parents 0fcc8af + 39b7a5d commit ef5748f

File tree

23 files changed

+740
-128
lines changed

23 files changed

+740
-128
lines changed

.exchange-rates.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1510657200,"base":"USD","rates":{"AED":3.673035,"AFN":68.597,"ALL":113.98,"AMD":486.63,"ANG":1.781857,"AOA":165.9225,"ARS":17.496,"AUD":1.310908,"AWG":1.786752,"AZN":1.6985,"BAM":1.675741,"BBD":2,"BDT":83.182854,"BGN":1.669083,"BHD":0.377161,"BIF":1749.6,"BMD":1,"BND":1.36149,"BOB":6.897686,"BRL":3.279497,"BSD":1,"BTC":0.000151240429,"BTN":65.285278,"BWP":10.652864,"BYN":1.991423,"BZD":2.00644,"CAD":1.274468,"CDF":1562.881563,"CHF":0.994774,"CLF":0.02337,"CLP":630,"CNH":6.642987,"CNY":6.638033,"COP":3008,"CRC":568.605,"CUC":1,"CUP":25.5,"CVE":94.875,"CZK":21.821947,"DJF":178.935,"DKK":6.350075,"DOP":47.937867,"DZD":114.8535,"EGP":17.6636,"ERN":15.191062,"ETB":27.169609,"EUR":0.853388,"FJD":2.074747,"FKP":0.764055,"GBP":0.764055,"GEL":2.537872,"GGP":0.764055,"GHS":4.4458,"GIP":0.764055,"GMD":47.29,"GNF":9013.95,"GTQ":7.326984,"GYD":207.46247,"HKD":7.80305,"HNL":23.606507,"HRK":6.4456,"HTG":63.603697,"HUF":266.133667,"IDR":13534.080047,"ILS":3.54841,"IMP":0.764055,"INR":65.424312,"IQD":1164.9,"IRR":34716.946723,"ISK":103.45,"JEP":0.764055,"JMD":126.505,"JOD":0.709001,"JPY":113.7169,"KES":103.645,"KGS":69.131479,"KHR":4032.45,"KMF":422,"KPW":900,"KRW":1114.85,"KWD":0.302496,"KYD":0.831775,"KZT":332.5,"LAK":8311.2,"LBP":1513.25,"LKR":153.61,"LRD":123.1,"LSL":14.476277,"LYD":1.365546,"MAD":9.46,"MDL":17.649228,"MGA":3154.35,"MKD":52.59,"MMK":1352.75,"MNT":2449.999147,"MOP":8.018738,"MRO":354.53,"MUR":34.2865,"MVR":15.390384,"MWK":725.74,"MXN":19.09005,"MYR":4.190414,"MZN":60.664443,"NAD":14.45,"NGN":359.36,"NIO":30.693726,"NOK":8.186992,"NPR":104.452204,"NZD":1.456717,"OMR":0.384994,"PAB":1,"PEN":3.24165,"PGK":3.199082,"PHP":51.192,"PKR":105.22,"PLN":3.61465,"PYG":5645.8,"QAR":3.641458,"RON":3.966758,"RSD":101.060687,"RUB":59.6774,"RWF":853.025,"SAR":3.7498,"SBD":7.792911,"SCR":13.405502,"SDG":6.664846,"SEK":8.421303,"SGD":1.361451,"SHP":0.764055,"SLL":7643.328121,"SOS":577.475,"SRD":7.448,"SSP":130.2634,"STD":20855.05009,"SVC":8.734183,"SYP":514.98999,"SZL":14.483364,"THB":33.0815,"TJS":8.794373,"TMT":3.499972,"TND":2.499956,"TOP":2.268632,"TRY":3.873196,"TTD":6.750494,"TWD":30.175513,"TZS":2241.4,"UAH":26.453,"UGX":3631.5,"USD":1,"UYU":29.244046,"UZS":8053.2,"VEF":10.03865,"VND":22717.119974,"VUV":106.743333,"WST":2.54764,"XAF":559.785804,"XAG":0.05904943,"XAU":0.00078581,"XCD":2.70255,"XDR":0.712471,"XOF":559.785804,"XPD":0.0010096,"XPF":101.836272,"XPT":0.00107701,"YER":250.294142,"ZAR":14.400955,"ZMW":9.907,"ZWL":322.355011}}
1+
{"disclaimer":"Usage subject to terms: https://openexchangerates.org/terms","license":"https://openexchangerates.org/license","timestamp":1510657200,"base":"USD","rates":{"AED":3.673035,"AFN":68.597,"ALL":113.98,"AMD":486.63,"ANG":1.781857,"AOA":165.9225,"ARS":17.496,"AUD":1.310908,"AWG":1.786752,"AZN":1.6985,"BAM":1.675741,"BBD":2,"BDT":83.182854,"BGN":1.669083,"BHD":0.377161,"BIF":1749.6,"BMD":1,"BND":1.36149,"BOB":6.897686,"BRL":3.279497,"BSD":1,"BTC":0.000151240429,"BTN":65.285278,"BWP":10.652864,"BYN":1.991423,"BZD":2.00644,"CAD":1.274468,"CDF":1562.881563,"CHF":0.994774,"CLF":0.02337,"CLP":630,"CNH":6.642987,"CNY":6.638033,"COP":3008,"CRC":568.605,"CUC":1,"CUP":25.5,"CVE":94.875,"CZK":21.821947,"DJF":178.935,"DKK":6.350075,"DOP":47.937867,"DZD":114.8535,"EGP":17.6636,"ERN":15.191062,"ETB":27.169609,"EUR":0.853388,"FJD":2.074747,"FKP":0.764055,"GBP":0.764055,"GEL":2.537872,"GGP":0.764055,"GHS":4.4458,"GIP":0.764055,"GMD":47.29,"GNF":9013.95,"GTQ":7.326984,"GYD":207.46247,"HKD":7.80305,"HNL":23.606507,"HRK":6.4456,"HTG":63.603697,"HUF":266.133667,"IDR":13534.080047,"ILS":3.54841,"IMP":0.764055,"INR":65.424312,"IQD":1164.9,"IRR":34716.946723,"ISK":103.45,"JEP":0.764055,"JMD":126.505,"JOD":0.709001,"JPY":113.7169,"KES":103.645,"KGS":69.131479,"KHR":4032.45,"KMF":422,"KPW":900,"KRW":1114.85,"KWD":0.302496,"KYD":0.831775,"KZT":332.5,"LAK":8311.2,"LBP":1513.25,"LKR":153.61,"LRD":123.1,"LSL":14.476277,"LYD":1.365546,"MAD":9.46,"MDL":17.649228,"MGA":3154.35,"MKD":52.59,"MMK":1352.75,"MNT":2449.999147,"MOP":8.018738,"MRO":354.53,"MUR":34.2865,"MVR":15.390384,"MWK":725.74,"MXN":19.09005,"MYR":4.190414,"MZN":60.664443,"NAD":14.45,"NGN":359.36,"NIO":30.693726,"NOK":8.186992,"NPR":104.452204,"NZD":1.456717,"OMR":0.384994,"PAB":1,"PEN":3.24165,"PGK":3.199082,"PHP":51.192,"PKR":105.22,"PLN":3.61465,"PYG":5645.8,"QAR":3.641458,"RON":3.966758,"RSD":101.060687,"RUB":59.6774,"RWF":853.025,"SAR":3.7498,"SBD":7.792911,"SCR":13.405502,"SDG":6.664846,"SEK":8.421303,"SGD":1.361451,"SHP":0.764055,"SLL":7643.328121,"SOS":577.475,"SRD":7.448,"SSP":130.2634,"STD":20855.05009,"SVC":8.734183,"SYP":514.98999,"SZL":14.483364,"THB":33.0815,"TJS":8.794373,"TMT":3.499972,"TND":2.499956,"TOP":2.268632,"TRY":3.873196,"TTD":6.750494,"TWD":30.175513,"TZS":2241.4,"UAH":26.453,"UGX":3631.5,"USD":1,"UYU":29.244046,"UZS":8053.2,"VEF":10.03865,"VND":22717.119974,"VUV":106.743333,"WST":2.54764,"XAF":559.785804,"XAG":0.05904943,"XAU":0.00078581,"XCD":2.70255,"XDR":0.712471,"XOF":559.785804,"XPD":0.0010096,"XPF":101.836272,"XPT":0.00107701,"YER":250.294142,"ZAR":14.400955,"ZMW":9.907,"ZWL":322.355011}}

__tests__/shared/components/__snapshots__/Content.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ exports[`Matches shallow shapshot 1`] = `
405405
<li>
406406
<Link
407407
replace={false}
408-
to="examples/error-message"
408+
to="/examples/error-message"
409409
>
410410
Error Message
411411
</Link>

src/server/server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import atob from 'atob';
33
import bodyParser from 'body-parser';
44
import cookieParser from 'cookie-parser';
55
import express from 'express';
6+
import fetch from 'isomorphic-fetch';
67
import helmet from 'helmet';
78
import logger from 'utils/logger';
89
import loggerMiddleware from 'morgan';
@@ -103,6 +104,14 @@ app.use('/community-app-assets/api/xml2json', (req, res) => {
103104
xmlToJson(req.body.xml).then(json => res.json(json));
104105
});
105106

107+
/* Proxy endpoint for GET requests (to fetch data from resources prohibiting
108+
* cross-origin requests). */
109+
app.use('/community-app-assets/api/proxy-get', (req, res) => {
110+
fetch(req.query.url)
111+
.then(x => x.text())
112+
.then(x => res.send(x));
113+
});
114+
106115
/* Returns currency exchange rates, cached at the server-side (thus drastically
107116
* reducing amount of calls to openexchangerates.com). */
108117
app.use('/community-app-assets/api/exchange-rates', (req, res) => {

src/shared/actions/rss.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Actions for management of data loaded from RSS feeds.
3+
*/
4+
5+
import fetch from 'isomorphic-fetch';
6+
import { toJson } from 'utils/xml2json';
7+
import { createActions } from 'redux-actions';
8+
9+
/**
10+
* Payload creator for the action that drops data loaded from the specified
11+
* RSS feed. Also cancels any pending loading of data for that feed.
12+
* @param {String} feed Internal name of the feed.
13+
* @return {String}
14+
*/
15+
function drop(feed) {
16+
return feed;
17+
}
18+
19+
/**
20+
* Payload creator for the actions that drops all data loaded from RSS feeds.
21+
*/
22+
function dropAll() {}
23+
24+
/**
25+
* Payload creator for the action that initializes data loading for the
26+
* specified feed.
27+
* @param {String} feed Internal name of the feed.
28+
* @param {String} uuid UUID of the loading operations.
29+
* @return {Object} Action payload.
30+
*/
31+
function getInit(feed, uuid) {
32+
return { feed, uuid };
33+
}
34+
35+
/**
36+
* Payload creator for the action that actually loads data for the specified
37+
* RSS feed.
38+
* @param {String} feed Internal name of the feed.
39+
* @param {String} uuid UUID of the loading operation.
40+
* @param {String} url URL of the RSS feed.
41+
* @return {Object} Action payload.
42+
*/
43+
async function getDone(feed, uuid, url) {
44+
let res = await fetch(url);
45+
if (!res.ok) throw new Error(res.statusText);
46+
res = await res.text();
47+
res = await toJson(res);
48+
return { feed, uuid, data: res.rss.channel };
49+
}
50+
51+
export default createActions({
52+
RSS: {
53+
DROP: drop,
54+
DROP_ALL: dropAll,
55+
GET_INIT: getInit,
56+
GET_DONE: getDone,
57+
},
58+
});

src/shared/components/Content/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default function Content() {
169169
promise;
170170
</li>
171171
<li>
172-
<Link to="examples/error-message">Error Message</Link> - Demonstrates
172+
<Link to="/examples/error-message">Error Message</Link> - Demonstrates
173173
UI component for errors messaging;
174174
</li>
175175
<li>

src/shared/components/ErrorMessage/index.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ class ErrorMessage extends React.Component {
5050
}
5151
}
5252

53-
/**
54-
* Prop Validation
55-
*/
53+
ErrorMessage.defaultProps = {
54+
details: '',
55+
};
56+
5657
ErrorMessage.propTypes = {
5758
title: PT.string.isRequired,
58-
details: PT.string.isRequired,
59+
details: PT.string,
5960
onOk: PT.func.isRequired,
6061
};
6162

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Renders a single article card.
3+
*/
4+
5+
import PT from 'prop-types';
6+
import React from 'react';
7+
8+
import './style.scss';
9+
10+
export default function Card({ fullWidth, item }) {
11+
return (
12+
<div styleName={fullWidth ? 'full-width-container' : 'container'}>
13+
<h3>
14+
<a
15+
href={item.link}
16+
rel="noopener noreferrer"
17+
target="_blank"
18+
>{item.title}</a></h3>
19+
<div
20+
/* eslint-disable react/no-danger */
21+
dangerouslySetInnerHTML={{ __html: item['content:encoded'] }}
22+
/* eslint-enable react/no-danger */
23+
/>
24+
<a
25+
href={item.link}
26+
styleName="readMore"
27+
target="_blank"
28+
rel="noopener noreferrer"
29+
>Read More...</a>
30+
<div styleName="mask" />
31+
</div>
32+
);
33+
}
34+
35+
Card.defaultProps = {
36+
fullWidth: false,
37+
};
38+
39+
Card.propTypes = {
40+
fullWidth: PT.bool,
41+
item: PT.shape({
42+
'content:encoded': PT.string.isRequired,
43+
link: PT.string.isRequired,
44+
title: PT.string.isRequired,
45+
}).isRequired,
46+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@import '../../../themes/mixins';
2+
3+
@mixin container {
4+
@include body-text;
5+
6+
height: 480px;
7+
margin-bottom: 48px;
8+
overflow: hidden;
9+
position: relative;
10+
width: 48%;
11+
12+
@include xxs-to-sm {
13+
padding: 0 24px;
14+
width: 100%;
15+
}
16+
17+
a {
18+
@include link;
19+
20+
text-decoration: underline;
21+
}
22+
23+
h3 {
24+
@include h3;
25+
}
26+
27+
h4 {
28+
@include h4;
29+
}
30+
31+
iframe {
32+
height: 280px;
33+
width: 100%;
34+
}
35+
36+
img {
37+
width: 100%;
38+
}
39+
}
40+
41+
.container {
42+
@include container;
43+
}
44+
45+
.full-width-container {
46+
@include container;
47+
48+
width: 100%;
49+
height: 720px;
50+
}
51+
52+
.mask {
53+
background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.5) 50%, white 80%);
54+
bottom: 0;
55+
height: 128px;
56+
left: 0;
57+
position: absolute;
58+
right: 0;
59+
}
60+
61+
.readMore {
62+
bottom: 0;
63+
position: absolute;
64+
z-index: 2;
65+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Renders the section with content from ConsenSys blog at Medium.
3+
*/
4+
5+
import _ from 'lodash';
6+
import LoadingIndicator from 'components/LoadingIndicator';
7+
import PT from 'prop-types';
8+
import React from 'react';
9+
import Section from 'components/tc-communities/Section';
10+
11+
import Card from './Card';
12+
import style from './style.scss';
13+
14+
export default function ConsenSysAtMedium({ consenSysRss }) {
15+
let cards = _.get(consenSysRss, 'data.item');
16+
cards = cards && cards
17+
.filter(item => Boolean(item.category))
18+
.slice(0, 3)
19+
.map((item, index) => (
20+
<Card fullWidth={!index} item={item} key={item.link} />
21+
));
22+
23+
return (
24+
<Section
25+
theme={{
26+
content: style.content,
27+
}}
28+
title="ConsenSys @ Medium"
29+
>
30+
{cards || <LoadingIndicator />}
31+
</Section>
32+
);
33+
}
34+
35+
ConsenSysAtMedium.defaultProps = {
36+
consenSysRss: null,
37+
};
38+
39+
ConsenSysAtMedium.propTypes = {
40+
consenSysRss: PT.shape({
41+
data: PT.shape({
42+
item: PT.arrayOf(PT.shape({
43+
link: PT.string.isRequired,
44+
})).isRequired,
45+
}),
46+
}),
47+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.content {
2+
flex-wrap: wrap;
3+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import Accordion from 'components/tc-communities/Accordion/Accordion';
2+
import AccordionItem from 'components/tc-communities/Accordion/AccordionItem';
3+
import JoinCommunity from 'containers/tc-communities/JoinCommunity';
4+
import React from 'react';
5+
import Section from 'components/tc-communities/Section';
6+
import Text from 'components/tc-communities/Text';
7+
8+
import style from './style.scss';
9+
10+
export default function LearnTheBasics() {
11+
return (
12+
<Section
13+
title="Learn The Basics"
14+
theme={{
15+
container: style.learnBasicsContainer,
16+
}}
17+
>
18+
<Accordion>
19+
<AccordionItem title="Joining the Blockchain Community">
20+
<Text>
21+
<p>
22+
Join the fastest-growing blockchain community on the world’s
23+
premier crowdsourcing platform. As a member, you’ll get access to
24+
all the tools, tutorials, and hands-on challenges you need to
25+
help you master blockchain. Compete in fun challenges to hone
26+
your skills and competitive challenges to solve real-life
27+
problems for businesses&nbsp;— all using today’s most in-demand
28+
skills and technology.
29+
</p>
30+
<JoinCommunity
31+
label="Join Now"
32+
theme={{ link: style.joinnow }}
33+
/>
34+
</Text>
35+
</AccordionItem>
36+
<AccordionItem title="How to sign up for work">
37+
<Text>
38+
<p>
39+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
40+
erat a elementum rutrum, neque sem pretium metus, quis mollis
41+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
42+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
43+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
44+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
45+
condimentum mauris ultrices. Praesent blandit, augue a posuere
46+
aliquam, arcu tortor feugiat turpis,
47+
</p>
48+
<p>
49+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
50+
erat a elementum rutrum, neque sem pretium metus, quis mollis
51+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
52+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
53+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
54+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
55+
condimentum mauris ultrices. Praesent blandit, augue a posuere
56+
aliquam, arcu tortor feugiat turpis,
57+
</p>
58+
</Text>
59+
</AccordionItem>
60+
<AccordionItem title="How to compete for work">
61+
<Text>
62+
<p>
63+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
64+
erat a elementum rutrum, neque sem pretium metus, quis mollis
65+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
66+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
67+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
68+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
69+
condimentum mauris ultrices. Praesent blandit, augue a posuere
70+
aliquam, arcu tortor feugiat turpis,
71+
</p>
72+
<p>
73+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
74+
erat a elementum rutrum, neque sem pretium metus, quis mollis
75+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
76+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
77+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
78+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
79+
condimentum mauris ultrices. Praesent blandit, augue a posuere
80+
aliquam, arcu tortor feugiat turpis,
81+
</p>
82+
</Text>
83+
</AccordionItem>
84+
<AccordionItem title="Payment & Rewards">
85+
<Text>
86+
<p>
87+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
88+
erat a elementum rutrum, neque sem pretium metus, quis mollis
89+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
90+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
91+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
92+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
93+
condimentum mauris ultrices. Praesent blandit, augue a posuere
94+
aliquam, arcu tortor feugiat turpis,
95+
</p>
96+
<p>
97+
Nam dapibus nisl vitae elit fringilla rutrum. Aenean sollicitudin,
98+
erat a elementum rutrum, neque sem pretium metus, quis mollis
99+
nisl nunc et massa. Vestibulum sed metus in lorem tristique
100+
ullamcorper id vitae erat. Nulla mollis sapien sollicitudin
101+
lacinia lacinia. Vivamus facilisis dolor et massa placerat, at
102+
vestibulum nisl egestas. Nullam rhoncus lacus non odio luctus, eu
103+
condimentum mauris ultrices. Praesent blandit, augue a posuere
104+
aliquam, arcu tortor feugiat turpis,
105+
</p>
106+
</Text>
107+
</AccordionItem>
108+
</Accordion>
109+
</Section>
110+
);
111+
}

0 commit comments

Comments
 (0)