mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
finish upvote button
This commit is contained in:
parent
733887ca2b
commit
c470057bab
3 changed files with 6 additions and 5 deletions
|
@ -32,15 +32,16 @@ class Vote extends Component {
|
|||
|
||||
({Icon} = Telescope.components);
|
||||
|
||||
const post = this.props.post;
|
||||
const user = this.props.currentUser;
|
||||
|
||||
let actionsClass = "vote";
|
||||
if (user.hasUpvoted(this)) actionsClass += " voted upvoted";
|
||||
if (user.hasDownvoted(this)) actionsClass += " voted downvoted";
|
||||
if (user.hasUpvoted(post)) actionsClass += " voted upvoted";
|
||||
if (user.hasDownvoted(post)) actionsClass += " voted downvoted";
|
||||
|
||||
return (
|
||||
<div className={actionsClass}>
|
||||
<a href="#" className="upvote" onClick={this.upvote}>
|
||||
<a href="#" className="button button--secondary upvote" onClick={this.upvote}>
|
||||
<Icon name="upvote" />
|
||||
<span className="sr-only">Upvote</span>
|
||||
</a>
|
||||
|
|
|
@ -114,5 +114,5 @@ code{
|
|||
}
|
||||
|
||||
.upvoted .upvote{
|
||||
opacity: 0.5;
|
||||
opacity: 0.3;
|
||||
}
|
|
@ -69,7 +69,7 @@ Posts.addField([
|
|||
},
|
||||
]);
|
||||
|
||||
PublicationUtils.addToFields(Posts.publishedFields.list, ["upvotes", "downvotes", "baseScore", "score"]);
|
||||
PublicationUtils.addToFields(Posts.publishedFields.list, ["upvotes", "upvoters", "downvotes", "downvoters", "baseScore", "score"]);
|
||||
PublicationUtils.addToFields(Posts.publishedFields.single, ["upvotes", "upvoters", "downvotes", "downvoters", "baseScore", "score"]);
|
||||
|
||||
// ------------------------------------- Comments -------------------------------- //
|
||||
|
|
Loading…
Add table
Reference in a new issue