-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Upgrade Jest * Upgrade webpack
- Loading branch information
Showing
13 changed files
with
2,275 additions
and
770 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
"name": "my-contributions.github.io", | ||
"version": "0.0.1", | ||
"description": "Show off your open source contributions and check out others", | ||
"main": "index.js", | ||
"homepage": "https://my-contributions.github.io", | ||
"repository": "github:my-contributions/my-contributions.github.io", | ||
"author": "Elisey Zanko <[email protected]>", | ||
|
@@ -21,17 +20,18 @@ | |
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^21.2.0", | ||
"babel-jest": "^22.4.3", | ||
"babel-loader": "^7.1.2", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-react": "^7.5.1", | ||
"jest": "^21.2.1", | ||
"jest": "^22.4.3", | ||
"jest-junit": "^3.1.0", | ||
"webpack": "^3.8.1", | ||
"webpack-dev-server": "^2.9.3", | ||
"webpack": "^4.2.0", | ||
"webpack-cli": "^2.0.13", | ||
"webpack-dev-server": "^3.1.1", | ||
"webpack-merge": "^4.1.0", | ||
"whatwg-fetch": "^2.0.3" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import PropTypes from 'prop-types'; | ||
import GitHub from '../api/GitHub'; | ||
import React from 'react'; | ||
import AuthorName from './AuthorName'; | ||
import AuthorBio from './AuthorBio'; | ||
import AuthorLocation from './AuthorLocation'; | ||
|
||
export default class Author extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
author: null, | ||
error: '', | ||
}; | ||
} | ||
|
||
async componentWillMount() { | ||
try { | ||
this.setState({ | ||
author: await this.props.github.getUser(), | ||
}); | ||
} | ||
catch(e) { | ||
this.setState({error: e.toString()}); | ||
} | ||
} | ||
|
||
render() { | ||
if (this.state.error) { | ||
return this.state.error; | ||
} | ||
|
||
if (!this.state.author) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div> | ||
<AuthorName name={this.state.author.name} login={this.state.author.login} html_url={this.state.author.html_url}/> | ||
<AuthorBio text={this.state.author.bio}/> | ||
<AuthorLocation text={this.state.author.location}/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Author.propTypes = { | ||
github: PropTypes.instanceOf(GitHub).isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default class AuthorBio extends React.PureComponent { | ||
render() { | ||
return this.props.text && ( | ||
<div> | ||
{this.props.text} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
AuthorBio.propTypes = { | ||
text: PropTypes.string, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default class AuthorLocation extends React.PureComponent { | ||
render() { | ||
return this.props.text && ( | ||
<div> | ||
{this.props.text} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
AuthorLocation.propTypes = { | ||
text: PropTypes.string, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default class AuthorName extends React.PureComponent { | ||
render() { | ||
return ( | ||
<div> | ||
{this.props.name} <a href={this.props.html_url}>{this.props.login}</a> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
AuthorName.propTypes = { | ||
name: PropTypes.string, | ||
login: PropTypes.string.isRequired, | ||
html_url: PropTypes.string.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.