diff options
author | Dessalines <tyhou13@gmx.com> | 2019-09-02 15:00:49 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-09-02 15:00:49 -0700 |
commit | d99fa5268d63e0bdc9107fb16b60eabc168aff51 (patch) | |
tree | 908176be37aef986742c7f72c78219f1282e92b7 | |
parent | 951a3d061654a62a1103c2b9fe694456e1e36dfb (diff) |
Hiding vote bar on comment collapse
- Fixes #259
-rw-r--r-- | ui/src/components/comment-node.tsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 8779f1f9..3eff8c79 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -65,15 +65,17 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { let node = this.props.node; return ( <div className={`comment ${node.comment.parent_id && !this.props.noIndent ? 'ml-4' : ''}`}> - <div className={`vote-bar mr-2 float-left small text-center ${this.props.viewOnly && 'no-click'}`}> - <button className={`btn p-0 ${node.comment.my_vote == 1 ? 'text-info' : 'text-muted'}`} onClick={linkEvent(node, this.handleCommentLike)}> - <svg class="icon upvote"><use xlinkHref="#icon-arrow-up"></use></svg> - </button> - <div class={`font-weight-bold text-muted`}>{node.comment.score}</div> - <button className={`btn p-0 ${node.comment.my_vote == -1 ? 'text-danger' : 'text-muted'}`} onClick={linkEvent(node, this.handleCommentDisLike)}> - <svg class="icon downvote"><use xlinkHref="#icon-arrow-down"></use></svg> - </button> - </div> + {!this.state.collapsed && + <div className={`vote-bar mr-2 float-left small text-center ${this.props.viewOnly && 'no-click'}`}> + <button className={`btn p-0 ${node.comment.my_vote == 1 ? 'text-info' : 'text-muted'}`} onClick={linkEvent(node, this.handleCommentLike)}> + <svg class="icon upvote"><use xlinkHref="#icon-arrow-up"></use></svg> + </button> + <div class={`font-weight-bold text-muted`}>{node.comment.score}</div> + <button className={`btn p-0 ${node.comment.my_vote == -1 ? 'text-danger' : 'text-muted'}`} onClick={linkEvent(node, this.handleCommentDisLike)}> + <svg class="icon downvote"><use xlinkHref="#icon-arrow-down"></use></svg> + </button> + </div> + } <div id={`comment-${node.comment.id}`} className={`details comment-node ml-4 ${this.isCommentNew ? 'mark' : ''}`}> <ul class="list-inline mb-0 text-muted small"> <li className="list-inline-item"> |