From 08af66ba28f38339a5ae655493d3ab299508d910 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 6 Mar 2020 09:55:32 -0500 Subject: Some comment-node additions - Hiding extra vote counts if no downvotes. - Showing numbers on actions if there are. --- ui/assets/css/main.css | 2 +- ui/src/components/comment-node.tsx | 90 ++++++++++++++++++-------------------- ui/src/components/post.tsx | 2 +- ui/src/utils.ts | 15 ++++++- 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/ui/assets/css/main.css b/ui/assets/css/main.css index 53237793..b458a9d2 100644 --- a/ui/assets/css/main.css +++ b/ui/assets/css/main.css @@ -117,7 +117,7 @@ } blockquote { - border-left: 1px solid var(--secondary); + border-left: 2px solid var(--secondary); margin: 0.5em 5px; padding: 0.1em 5px; } diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index db3c589d..524367bc 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -125,7 +125,10 @@ export class CommentNode extends Component { }`} > {!node.comment.parent_id && !this.props.noIndent && ( -
+ <> +
+
+ )}
{ style={ !this.props.noIndent && this.props.node.comment.parent_id && - `border-left: 1px ${this.state.borderColor} solid !important` + `border-left: 2px ${this.state.borderColor} solid !important` } >
{ {i18n.t('banned')} )} -
  • - -
  • - - - - - {this.state.score} - -
  • -
  • - - - - {this.state.upvotes} -
  • -
  • - - - - {this.state.downvotes} -
  • -
    {this.props.showCommunity && (
  • {i18n.t('to')} @@ -219,6 +194,21 @@ export class CommentNode extends Component {
  • )}
  • +
  • + + + + + {this.state.score} + +
  • +
  • @@ -230,11 +220,11 @@ export class CommentNode extends Component { onClick={linkEvent(this, this.handleCommentCollapse)} > {this.state.collapsed ? ( - + ) : ( - + )} @@ -292,9 +282,12 @@ export class CommentNode extends Component { onClick={linkEvent(node, this.handleCommentUpvote)} data-tippy-content={i18n.t('upvote')} > - + + {this.state.upvotes !== this.state.score && ( + {this.state.upvotes} + )}
  • {WebSocketService.Instance.site.enable_downvotes && ( @@ -311,9 +304,12 @@ export class CommentNode extends Component { )} data-tippy-content={i18n.t('downvote')} > - + + {this.state.upvotes !== this.state.score && ( + {this.state.downvotes} + )} )} @@ -328,19 +324,6 @@ export class CommentNode extends Component { - {!this.myComment && ( -
  • - - - - - -
  • - )}
  • {
  • ) : ( <> + {!this.myComment && ( +
  • + + + + + +
  • + )}
  • { sortRadios() { return ( -
    +