Skip to content

Commit 858b0c7

Browse files
author
David Silva
committed
Merge branch 'release/0.11.0'
2 parents 2c8c297 + 7daf24a commit 858b0c7

File tree

18 files changed

+360
-105
lines changed

18 files changed

+360
-105
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
# Changelog
22

3+
## 0.11.0
4+
5+
- #83 Creates a <loading> component that displays while waiting for data as a generic way
6+
- #103 Creates utilities to verify valid urls on dynamic inputs
7+
- #52 Removed the odd space under the header
8+
- #105 Prevents logged in users from entering /signup page
9+
- #73 adds an 'we are open source' page in /about/open-source
10+
- #114 create team member component and integrate into about container
11+
312
## 0.10.3
413
- HOTFIX: Error in profile page
14+
515
## 0.10.0
616

717
- Displaying projects and submissions in profile page

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codecorgi",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"private": true,
55
"proxy": "http://localhost:9500",
66
"devDependencies": {

src/assets/images/octo-corgi.png

296 KB
Loading

src/components/about/TeamMember.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
export class TeamMember extends Component {
5+
static propTypes = {
6+
title: PropTypes.string.isRequired,
7+
description: PropTypes.string.isRequired,
8+
name: PropTypes.string,
9+
image: PropTypes.string,
10+
links: PropTypes.arrayOf(
11+
PropTypes.shape({
12+
href: PropTypes.string.isRequired,
13+
className: PropTypes.string.isRequired,
14+
}),
15+
),
16+
}
17+
static defaultProps = {
18+
links: [],
19+
}
20+
21+
render() {
22+
return (
23+
<figure className="member">
24+
<div className="icon-overlay icn-link">
25+
<a><img src={this.props.image} className="img-circle"/></a>
26+
</div>
27+
<figcaption>
28+
<h2>
29+
{this.props.name}
30+
<span>{this.props.title}</span>
31+
</h2>
32+
<p>
33+
{this.props.description}
34+
</p>
35+
<ul className="social">
36+
{this.props.links.map((l, key) => (
37+
<li key={ key }>
38+
<a href={l.href} target="_blank">
39+
<i className={l.className}/>
40+
</a>
41+
</li>
42+
))}
43+
</ul>
44+
</figcaption>
45+
</figure>
46+
);
47+
}
48+
}
49+
50+
export default TeamMember;

src/components/challenges/single.js

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Tags from '../misc/tags';
66
import Moment from '../misc/moment';
77
import ReactMarkdown from 'react-markdown';
88
import { Link } from 'react-router-dom';
9+
import { ensureUrl } from '../../constants/utils';
10+
import linkRenderer from '../misc/linkRenderer';
911

1012
class SingleChallenge extends Component {
1113
static propTypes = {
@@ -18,7 +20,7 @@ class SingleChallenge extends Component {
1820
<div>
1921
<TintedHeader title={challenge.title} subtitle={ challenge.body.short_description } />
2022
<section className="container">
21-
<div className="content challenge">
23+
<div style={{ maxWidth: '800px', width: '92%', marginLeft: 'auto', marginRight: 'auto', marginTop: '60px', marginBottom: '120px' }}>
2224
<div className="ticket-data row pricing">
2325
<div className="col-sm-6 plan">
2426
<ul className="features">
@@ -36,8 +38,9 @@ class SingleChallenge extends Component {
3638
<strong>Type:</strong> { challenge.head.challenge_type }
3739
</li>
3840
<li>
39-
<i className="icon-user" />
40-
<strong>Asigned to:</strong> Me
41+
<i className="icon-tags" />
42+
<strong>Tags:&nbsp;</strong>
43+
<Tags tags={ challenge.tags } />
4144
</li>
4245
</ul>
4346
</div>
@@ -62,18 +65,11 @@ class SingleChallenge extends Component {
6265
</ul>
6366
</div>
6467
</div>
65-
<div className="row tags">
66-
<p>
67-
<i className="icon-tags" />
68-
<strong>Tags:</strong>
69-
<Tags tags={ challenge.tags } />
70-
</p>
71-
</div>
7268
<a className="anchor" id="description" />
7369
<div className="grey-box">
7470
<h2>Description</h2>
7571
<div className="description">
76-
<ReactMarkdown source={ challenge.body.description } />
72+
<ReactMarkdown source={ challenge.body.description } renderers={{ link: linkRenderer }} />
7773
</div>
7874
<a className="anchor" id="attachments" />
7975
<h2>Attachments</h2>
@@ -82,13 +78,14 @@ class SingleChallenge extends Component {
8278
{challenge.body.attachments.map((a, key) => (
8379
<li key={ key }>
8480
<i className="icon-install" />
85-
<a href="{{url}}" title="{{name}}" target="_blank">
86-
{{name}}
81+
<a href={ ensureUrl(a.url) } title={ a.name } target="_blank">
82+
{ a.name }
8783
</a>
8884
</li>
8985
))}
9086
{(!challenge.body.attachments || challenge.body.attachments.length < 1 ) &&
91-
<li>This challenge does not have any attachments.</li>}
87+
<li>This challenge does not have any attachments.</li>
88+
}
9289
</ul>
9390
</div>
9491
</div>
@@ -97,43 +94,53 @@ class SingleChallenge extends Component {
9794
Submit Answer <i className="icon icon-right-1" />
9895
</Link>
9996
</div>
97+
<h2>Extra Points</h2>
98+
<div className="extra-points">
99+
<a className="anchor" id="extra-points" />
100+
{challenge.body.extra_points &&
101+
<ReactMarkdown source={challenge.body.extra_points} renderers={{ link: linkRenderer }} />
102+
}
103+
{!challenge.body.extra_points &&
104+
<p>The requirements are complete as is.</p>
105+
}
106+
</div>
100107
<a className="anchor" id="technical" />
101108
<h2>Technical Notes</h2>
102109
<div className="technical-notes">
103-
<ReactMarkdown source={challenge.technical_notes} />
110+
<ReactMarkdown source={challenge.technical_notes} renderers={{ link: linkRenderer }} />
104111
<p>When you're done, push to your repo and submit your answer.</p>
105112
</div>
106113
<a className="anchor" id="source" />
107114
<h2>Source:</h2>
108115
<div className="source">
109116
{challenge.source.map((s, key) => (
110117
<p key={ key }>
111-
<strong>{s.name}</strong>
112-
<Link to={s.url}>{ s.url }</Link>
118+
<strong>{s.name}:&nbsp;</strong>
119+
<a href={ ensureUrl(s.url)} title={ `${challenge.title} - ${s.name}`} target="_blank">{ s.url }</a>
113120
</p>
114121
))}
115122
</div>
116123
<a className="anchor" id="procedure" />
117124
<h2>Procedure:</h2>
118125
<div className="procedure">
119-
<ReactMarkdown source={ challenge.procedure } />
126+
<ReactMarkdown source={ challenge.procedure } renderers={{ link: linkRenderer }} />
120127
<p>Look at our <Link to="/learning">help</Link> section for more information about this.</p>
121128
</div>
122129
<a className="anchor" id="coding" />
123130
<h2>Coding</h2>
124131
<div className="coding">
125-
{challenge.coding && <ReactMarkdown source={ challenge.coding } />}
132+
{challenge.coding && <ReactMarkdown source={ challenge.coding } renderers={{ link: linkRenderer }} />}
126133
{!challenge.coding &&
127134
<div>
128135
<p>To create your answer follow this steps:</p>
129136
<ol>
130-
<li><a href="https://help.github.com/articles/fork-a-repo/">Fork</a>
137+
<li><a href="https://help.github.com/articles/fork-a-repo/" target="_blank">Fork</a>
131138
the repo to your account, or download the zip file</li>
132139
<li>Solve the ticket</li>
133140
<li>Commit your code</li>
134141
<li>Push your changes</li>
135-
<li>Publish your version in <a href="https://pages.github.com/">Github Pages</a> or
136-
<a href="https://firebase.google.com/docs/hosting/">Firebase Hosting</a></li>
142+
<li>Publish your version in <a href="https://pages.github.com/" target="_blank">Github Pages</a> or
143+
<a href="https://firebase.google.com/docs/hosting/" target="_blank">Firebase Hosting</a></li>
137144
<li>Submit your response</li>
138145
</ol>
139146
</div>

src/components/loading/Large.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
3+
import TintedHeader from '../../components/misc/TintedHeader';
4+
5+
class LoadingLarge extends Component {
6+
static propTypes = {
7+
children: PropTypes.oneOfType([
8+
PropTypes.node,
9+
PropTypes.arrayOf(PropTypes.node),
10+
]).isRequired,
11+
loading: PropTypes.bool,
12+
data: PropTypes.any,
13+
title: PropTypes.string,
14+
minimun: PropTypes.number,
15+
};
16+
17+
static defaultProps = {
18+
title: 'Loading...',
19+
minimun: 800,
20+
}
21+
22+
constructor(props) {
23+
super(props);
24+
this.state = {
25+
minimunElapsed: false,
26+
};
27+
}
28+
29+
componentDidMount() {
30+
setTimeout(() => {
31+
this.setState({
32+
minimunElapsed: true,
33+
});
34+
}, this.props.minimun);
35+
}
36+
37+
render() {
38+
return(
39+
<div>
40+
{
41+
(this.state.minimunElapsed && (!this.props.loading || this.props.data)) ?
42+
this.props.children :
43+
<TintedHeader title={ this.props.title } />
44+
}
45+
</div>
46+
);
47+
}
48+
}
49+
50+
export default LoadingLarge;

src/components/misc/linkRenderer.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
3+
import { ensureUrl } from '../../constants/utils';
4+
5+
class linkRenderer extends Component {
6+
static propTypes = {
7+
href: PropTypes.string,
8+
children: PropTypes.oneOfType([
9+
PropTypes.node,
10+
PropTypes.arrayOf(PropTypes.node),
11+
]),
12+
}
13+
14+
render() {
15+
const url = ensureUrl(this.props.href);
16+
return(
17+
<a href={ url } target={ url.startsWith('/') ? '' : '_blank' }>
18+
{ this.props.children }
19+
</a>
20+
);
21+
}
22+
}
23+
24+
export default linkRenderer;

src/components/misc/tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Tags extends Component {
1111
return(
1212
<span>
1313
{tags.map((t, key) => {
14-
return <span key={ key } className="tag blue-bg">{ t }</span>;
14+
return <span key={ key } className="tag blue-bg" style={{ marginRight: '5px', marginBottom: '5px', display: 'inline-block' }}>{ t }</span>;
1515
})}
1616
</span>
1717
);

src/components/profile/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { PROD_URL, BACKEND_URL } from '../../constants';
99
import ReactMarkdown from 'react-markdown';
1010
import SubmitList from '../submit/list';
1111
import _get from 'lodash/get';
12+
import linkRenderer from '../misc/linkRenderer';
13+
import { ensureUrl } from '../../constants/utils';
1214

1315
class ProfileComponent extends React.Component {
1416
static propTypes = {
@@ -56,7 +58,7 @@ class ProfileComponent extends React.Component {
5658
<section className="container profile-body" style={{ margin: '30px auto' }}>
5759
<div className="row">
5860
<div className="col-xs-12">
59-
<ReactMarkdown source={ _get(profile, 'profile.bio', '') } />
61+
<ReactMarkdown source={ _get(profile, 'profile.bio', '') } renderers={{ link: linkRenderer }} />
6062
</div>
6163
</div>
6264
{submits && submits.length > 0 &&
@@ -73,7 +75,7 @@ class ProfileComponent extends React.Component {
7375
<div className="col-xs-12">
7476
{profile.projects.map((p, index) => (
7577
<div className="project" key={ index }>
76-
<p><Link to={p.url} target="_blank">{ p.name }</Link></p>
78+
<p><Link to={ ensureUrl(p.url) } target="_blank">{ p.name }</Link></p>
7779
<p>{ p.description }</p>
7880
</div>
7981
))}

0 commit comments

Comments
 (0)