From 7c274fdd35b30b645b08740987423bd633e3ba9e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 4 Mar 2020 14:06:03 -0500 Subject: [PATCH] Add score color to bar --- ui/src/components/comment-node.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 { })} >
  • - + @@ -1144,4 +1144,14 @@ export class CommentNode extends Component { 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'; + } + } }