X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcomment%2Fcomment-node.tsx;h=c6b37fdb2636f8d1589704d5c3b687082c7236f6;hb=9869b911cf480ee88c7b1e7d2f689cc2e1c65157;hp=4ad1538357810a99a0955f86f7f85ea528b37d02;hpb=7f3d1c4ebdec261b7021122caa7bb77552f08002;p=lemmy-ui.git diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 4ad1538..c6b37fd 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -62,6 +62,7 @@ import { I18NextService, UserService } from "../../services"; import { setupTippy } from "../../tippy"; import { Icon, PurgeWarning, Spinner } from "../common/icon"; import { MomentTime } from "../common/moment-time"; +import { UserBadges } from "../common/user-badges"; import { VoteButtonsCompact } from "../common/vote-buttons"; import { CommunityLink } from "../community/community-link"; import { PersonListing } from "../person/person-listing"; @@ -196,6 +197,17 @@ export class CommentNode extends Component { return this.commentView.comment.id; } + get hasBadges(): boolean { + const cv = this.commentView; + + return ( + this.isPostCreator || + isMod(cv.creator.id, this.props.moderators) || + isAdmin(cv.creator.id, this.props.admins) || + cv.creator.bot_account + ); + } + componentWillReceiveProps( nextProps: Readonly<{ children?: InfernoNode } & CommentNodeProps> ): void { @@ -308,32 +320,21 @@ export class CommentNode extends Component { classes="icon-inline" /> - - - + + + {cv.comment.distinguished && ( - - )} - {this.isPostCreator && ( -
- {I18NextService.i18n.t("creator")} -
- )} - {isMod_ && ( -
- {I18NextService.i18n.t("mod")} -
- )} - {isAdmin_ && ( -
- {I18NextService.i18n.t("admin")} -
- )} - {cv.creator.bot_account && ( -
- {I18NextService.i18n.t("bot_account").toLowerCase()} -
+ )} + + + {this.props.showCommunity && ( <> {I18NextService.i18n.t("to")} @@ -344,7 +345,9 @@ export class CommentNode extends Component { )} - {this.linkBtn(true)} + + {this.getLinkButton(true)} + {cv.comment.language_id !== 0 && ( { @@ -410,7 +413,7 @@ export class CommentNode extends Component { /> )}
- {this.props.showContext && this.linkBtn()} + {this.props.showContext && this.getLinkButton()} {this.props.markable && (