From b69ad1264ddcd315b178fdd3e88902e5d97e1708 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:41:14 -0400 Subject: [PATCH 01/11] make post creator badge stand out more --- src/shared/components/comment/comment-node.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 4ad15383..70369c70 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -315,8 +315,8 @@ export class CommentNode extends Component { )} {this.isPostCreator && ( -
- {I18NextService.i18n.t("creator")} +
+ {I18NextService.i18n.t("op").toUpperCase()}
)} {isMod_ && ( From 1faa9f354bc1429d14ff6437ff46b1eee1249cca Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:49:09 -0400 Subject: [PATCH 02/11] add tooltip --- src/shared/components/comment/comment-node.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 70369c70..d7cda869 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -315,7 +315,11 @@ export class CommentNode extends Component { )} {this.isPostCreator && ( -
+
{I18NextService.i18n.t("op").toUpperCase()}
)} From 03a4bfad467fab50e3f5fb8fc669da7084a54596 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:19:34 -0400 Subject: [PATCH 03/11] remove toUpperCase since the translation is uppercase --- src/shared/components/comment/comment-node.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index d7cda869..4c0e8b67 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -320,7 +320,7 @@ export class CommentNode extends Component { aria-label={I18NextService.i18n.t("creator")} data-tippy-content={I18NextService.i18n.t("creator")} > - {I18NextService.i18n.t("op").toUpperCase()} + {I18NextService.i18n.t("op")}
)} {isMod_ && ( From 9e1eb5fe19584264677ac5a1ed448fadee63beb9 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 11:42:00 -0400 Subject: [PATCH 04/11] always show badge on mobile --- src/shared/components/comment/comment-node.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 4c0e8b67..0fe43e26 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -316,7 +316,7 @@ export class CommentNode extends Component { )} {this.isPostCreator && (
From c020debf6d34fdd07da9346eccde6fe22da0b513 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 27 Jun 2023 11:44:17 -0400 Subject: [PATCH 05/11] use span --- src/shared/components/comment/comment-node.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 0fe43e26..c0d9d319 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -315,28 +315,28 @@ export class CommentNode extends Component { )} {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.props.showCommunity && ( <> 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 06/11] 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 c0d9d319..3f3361b2 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 && (