X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcomment%2Fcomment-node.tsx;h=662b67be4655ed962bf051c21713a812d67a9b63;hb=61867ee73d7ba9ac6865bd6fcd1ba11f51a5f060;hp=b6d491b2ebb5d32ce5d1f727e64f90870abcc165;hpb=0b7e2b7e4df01117c1ea1e63e1a49ab99baba78c;p=lemmy-ui.git diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index b6d491b..662b67b 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"; @@ -309,41 +310,19 @@ export class CommentNode extends Component { /> - - - + {cv.comment.distinguished && ( - + )} - {this.isPostCreator && - this.getRoleLabelPill({ - label: I18NextService.i18n.t("op").toUpperCase(), - tooltip: I18NextService.i18n.t("creator"), - parentClasses: "text-info", - shrinkToSingleLetter: false, - })} - - {isMod_ && - this.getRoleLabelPill({ - label: I18NextService.i18n.t("mod"), - tooltip: I18NextService.i18n.t("mod"), - shrunkenLabelClasses: "text-info", - })} - - {isAdmin_ && - this.getRoleLabelPill({ - label: I18NextService.i18n.t("admin"), - tooltip: I18NextService.i18n.t("admin"), - shrunkenLabelClasses: "text-danger", - })} - - {cv.creator.bot_account && - this.getRoleLabelPill({ - label: I18NextService.i18n.t("bot_account").toLowerCase(), - tooltip: I18NextService.i18n.t("bot_account"), - })} + {this.props.showCommunity && ( <> @@ -1199,50 +1178,6 @@ export class CommentNode extends Component { } } - getRoleLabelPill({ - label, - tooltip, - parentClasses, - shrunkenLabelClasses, - hideOnMobile = false, - shrinkToSingleLetter = true, - }: { - label: string; - tooltip: string; - parentClasses?: string; - shrunkenLabelClasses?: string; - hideOnMobile?: boolean; - shrinkToSingleLetter?: boolean; - }) { - const parentClassNames = classNames( - `badge me-2 text-bg-light ${parentClasses}`, - { - "d-none d-md-inline": hideOnMobile, - } - ); - - let fullLabelClassNames = "d-none d-md-inline"; - let shrunkenLabelClassNames = `d-inline d-md-none ${shrunkenLabelClasses}`; - - if (!shrinkToSingleLetter) { - fullLabelClassNames = ""; - shrunkenLabelClassNames = "d-none"; - } - - return ( - - {label} - - {label[0].toUpperCase()} - - - ); - } - getLinkButton(small = false) { const cv = this.commentView;