diff --git a/README.md b/README.md index 3eba526..abcbb06 100644 --- a/README.md +++ b/README.md @@ -152,11 +152,15 @@ We wanted it to be easy to contribute for **non-technical people** and include e * [Firebase](https://firebase.google.com/) ## Changelog +* 12.10.2019 - Upvoting an article * 15.09.2017 - "Open as .png" option * 13.09.2017 - Initial release ## Authors [Bartosz Olchówka](https://twitter.com/bolchowka/) / CTO @ [LiveChat](https://www.livechatinc.com/) +## Contributors +[Kamil Rudnicki](https://twitter.com/krudnicki/) / [TimeCamp](https://www.timecamp.com/) + ## License This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details diff --git a/src/components/page/Page.css b/src/components/page/Page.css index 3ffea40..365e385 100644 --- a/src/components/page/Page.css +++ b/src/components/page/Page.css @@ -63,3 +63,20 @@ .content__editor__buttons__guide { float: right; } + +.vote { + display: inline-block; + border: 1px solid #c4c4c4; + border-radius: 2px; + padding: 7px 5px; + color: #666; + font-size: 0.8em; + margin-top: 20px; + margin-bottom: 50px; + cursor: pointer; + margin-right: 10px; +} +.vote:hover { + background: #fff278; + color: #666; +} \ No newline at end of file diff --git a/src/components/page/Page.js b/src/components/page/Page.js index 3289d30..0006cea 100644 --- a/src/components/page/Page.js +++ b/src/components/page/Page.js @@ -134,6 +134,30 @@ export default class Page extends Component { this.setEditMode(false); } + upVote = (e) => { + if (this.props.onVote) { + this.props.onVote("upvotes"); + } + } + + hardVote = (e) => { + if (this.props.onVote) { + this.props.onVote("hard"); + } + } + + readVote = (e) => { + if (this.props.onVote) { + this.props.onVote("read"); + } + } + + obsoleteVote = (e) => { + if (this.props.onVote) { + this.props.onVote("read"); + } + } + render() { const contentClass = ['content', 'content--page']; if (this.state.editMode) { @@ -152,22 +176,22 @@ export default class Page extends Component {
{meta.reduce((acc, x) => acc === null ? [x] : [acc, ' | ', x], null)}
+{meta.reduce((acc, x) => acc === null ? [x] : [acc, ' | ', x], null)}
} {this.props.currentlyViewing.length > 0 && -
- Reading now: {this.props.currentlyViewing.map(user =>
+ Reading now: {this.props.currentlyViewing.map(user =>