diff options
author | Dessalines <tyhou13@gmx.com> | 2020-03-04 14:06:03 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-03-04 14:06:03 -0500 |
commit | 7c274fdd35b30b645b08740987423bd633e3ba9e (patch) | |
tree | 16d07cf46eafb88731aac1fe5a51f72dfe367cad /ui/src/components/comment-node.tsx | |
parent | 2c2918cc9e5e35c0b108b5daeeb2ccfbdee33e0c (diff) |
Add score color to bar
Diffstat (limited to 'ui/src/components/comment-node.tsx')
-rw-r--r-- | ui/src/components/comment-node.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 820dd901..cfca0f3b 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -181,7 +181,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { })} > <li className="list-inline-item"> - <span className="text-danger"> + <span className={this.scoreColor}> <svg class="small icon icon-inline mr-1"> <use xlinkHref="#icon-heart"></use> </svg> @@ -1144,4 +1144,14 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { i.setState(i.state); setupTippy(); } + + get scoreColor() { + if (this.state.my_vote == 1) { + return 'text-info'; + } else if (this.state.my_vote == -1) { + return 'text-danger'; + } else { + return 'text-muted'; + } + } } |