mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 00:43:59 +00:00
Add score color to bar
This commit is contained in:
parent
2c2918cc9e
commit
7c274fdd35
1 changed files with 11 additions and 1 deletions
12
ui/src/components/comment-node.tsx
vendored
12
ui/src/components/comment-node.tsx
vendored
|
@ -181,7 +181,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
<span className="text-danger">
|
<span className={this.scoreColor}>
|
||||||
<svg class="small icon icon-inline mr-1">
|
<svg class="small icon icon-inline mr-1">
|
||||||
<use xlinkHref="#icon-heart"></use>
|
<use xlinkHref="#icon-heart"></use>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -1144,4 +1144,14 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
setupTippy();
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue