From 6d65abc3ee7c3353a12d90634300c8d4df7822f2 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:10:05 -0400 Subject: [PATCH] refactor --- .../components/comment/comment-node.tsx | 90 +++++++++++++------ 1 file changed, 63 insertions(+), 27 deletions(-) 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 && (