From dbb04dab825730da26405cb4d91c6bed944c1348 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 21 Mar 2020 00:15:45 -0400 Subject: [PATCH] Changing comment actions to flex row. Fixes #611 --- ui/src/components/comment-node.tsx | 798 ++++++++++++++--------------- 1 file changed, 372 insertions(+), 426 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index b2d041506..7813168be 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -147,88 +147,79 @@ export class CommentNode extends Component { this.props.node.comment.parent_id && 'ml-2'}`} > - + ) : ( + + + + )} + + + + + + {this.state.score} + + + + + + + {/* end of user row */} {this.state.showEdit && ( { )} /> )} -
    +
    {this.props.showContext && this.linkBtn} {this.props.markable && ( -
  • - -
  • + )} {UserService.Instance.user && !this.props.viewOnly && ( <> -
  • + + {WebSocketService.Instance.site.enable_downvotes && ( -
  • - {WebSocketService.Instance.site.enable_downvotes && ( -
  • - -
  • )} -
  • + + + {!this.state.showAdvanced ? ( -
  • -
  • - -
  • - {!this.state.showAdvanced ? ( -
  • - -
  • ) : ( <> {!this.myComment && ( -
  • +
  • + )} {!this.props.showContext && this.linkBtn} -
  • - -
  • + + + {this.myComment && ( <> -
  • -
  • - + -
  • -
  • - -
  • + + + )} {/* Admins and mods can remove comments */} {(this.canMod || this.canAdmin) && ( <> -
  • - {!node.comment.removed ? ( - - {i18n.t('remove')} - - ) : ( - - {i18n.t('restore')} - - )} -
  • + {!node.comment.removed ? ( + + ) : ( + + )} )} {/* Mods can ban from community, and appoint as mods to community */} {this.canMod && ( <> - {!this.isMod && ( -
  • - {!node.comment.banned_from_community ? ( - + {i18n.t('ban')} + + ) : ( + + ))} + {!node.comment.banned_from_community && + (!this.state.showConfirmAppointAsMod ? ( + + ) : ( + <> + +
  • - )} - {!node.comment.banned_from_community && ( -
  • - {!this.state.showConfirmAppointAsMod ? ( - - {this.isMod - ? i18n.t('remove_as_mod') - : i18n.t('appoint_as_mod')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - - )} -
  • - )} + {i18n.t('no')} + + + ))} )} {/* Community creators and admins can transfer community to another mod */} {(this.amCommunityCreator || this.canAdmin) && - this.isMod && ( -
  • - {!this.state.showConfirmTransferCommunity ? ( - - {i18n.t('transfer_community')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - + this.isMod && + (!this.state.showConfirmTransferCommunity ? ( + + ) : ( + <> + + + + + ))} {/* Admins can ban from all, and appoint other admins */} {this.canAdmin && ( <> - {!this.isAdmin && ( -
  • - {!node.comment.banned ? ( - + {i18n.t('ban_from_site')} + + ) : ( + + ))} + {!node.comment.banned && + (!this.state.showConfirmAppointAsAdmin ? ( + + ) : ( + <> + +
  • - )} - {!node.comment.banned && ( -
  • - {!this.state.showConfirmAppointAsAdmin ? ( - - {this.isAdmin - ? i18n.t('remove_as_admin') - : i18n.t('appoint_as_admin')} - - ) : ( - <> - - {i18n.t('are_you_sure')} - - - {i18n.t('yes')} - - - {i18n.t('no')} - - - )} -
  • - )} + {i18n.t('no')} + + + ))} )} {/* Site Creator can transfer to another admin */} - {this.amSiteCreator && this.isAdmin && ( -
  • - {!this.state.showConfirmTransferSite ? ( - + {i18n.t('transfer_site')} + + ) : ( + <> + +
  • - )} + {i18n.t('yes')} + + + + ))} )} )} -
+ + {/* end of button group */} )} @@ -761,9 +707,9 @@ export class CommentNode extends Component { get linkBtn() { let node = this.props.node; return ( -
  • +
  • + ); }