remove possibility of vote from guests

This commit is contained in:
igoradamenko
2018-05-12 15:39:36 +03:00
parent ab9057efa3
commit a8df3441c7
+2 -2
View File
@@ -299,7 +299,7 @@ export default class Comment extends Component {
<span className={b('comment__score', {}, { view: o.score.view })}>
<span
className={b('comment__vote', {}, { type: 'up', selected: scoreIncreased, disabled: isGuest || isCurrentUser })}
onClick={this.increaseScore}
onClick={isGuest || isCurrentUser ? null : this.increaseScore}
title={isGuest ? 'Only authorized users are allowed to vote' : (isCurrentUser ? 'You can\'t vote for your own comment' : null)}
>Vote up</span>
@@ -310,7 +310,7 @@ export default class Comment extends Component {
<span
className={b('comment__vote', {}, { type: 'down', selected: scoreDecreased, disabled: isGuest || isCurrentUser })}
onClick={this.decreaseScore}
onClick={isGuest || isCurrentUser ? null : this.decreaseScore}
title={isGuest ? 'Only authorized users are allowed to vote' : (isCurrentUser ? 'You can\'t vote for your own comment' : null)}
>Vote down</span>
</span>