From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 18:10:05 +0000 (-0400) Subject: refactor X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%24%7Bsrc%7D?a=commitdiff_plain;h=6d65abc3ee7c3353a12d90634300c8d4df7822f2;p=lemmy-ui.git refactor --- diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index c0d9d31..3f3361b 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -308,36 +308,44 @@ export class CommentNode extends Component { classes="icon-inline" /> + + {cv.comment.distinguished && ( )} - {this.isPostCreator && ( - - {I18NextService.i18n.t("op")} - - )} - {isMod_ && ( - - {I18NextService.i18n.t("mod")} - - )} - {isAdmin_ && ( - - {I18NextService.i18n.t("admin")} - - )} - {cv.creator.bot_account && ( - - {I18NextService.i18n.t("bot_account").toLowerCase()} - - )} + + {this.isPostCreator && + this.getRoleLabelPill({ + label: I18NextService.i18n.t("op").toUpperCase(), + tooltip: I18NextService.i18n.t("creator"), + textClasses: "text-info", + hideOnMobile: false, + })} + + {isMod_ && + this.getRoleLabelPill({ + label: I18NextService.i18n.t("mod"), + tooltip: I18NextService.i18n.t("mod"), + hideOnMobile: true, + })} + + {isAdmin_ && + this.getRoleLabelPill({ + label: I18NextService.i18n.t("admin"), + tooltip: I18NextService.i18n.t("admin"), + hideOnMobile: true, + })} + + {cv.creator.bot_account && + this.getRoleLabelPill({ + label: I18NextService.i18n.t("bot_account").toLowerCase(), + tooltip: I18NextService.i18n.t("bot_account"), + hideOnMobile: true, + })} + {this.props.showCommunity && ( <> {I18NextService.i18n.t("to")} @@ -348,7 +356,9 @@ export class CommentNode extends Component { )} - {this.linkBtn(true)} + + {this.getLinkButton(true)} + {cv.comment.language_id !== 0 && ( { @@ -414,7 +424,7 @@ export class CommentNode extends Component { /> )}
- {this.props.showContext && this.linkBtn()} + {this.props.showContext && this.getLinkButton()} {this.props.markable && (