X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fcomment%2Fcomment-node.tsx;h=7b7f29e5cbc5fda864a6df18f9dfb201150d597f;hb=2911cd8cdb348629a97d60239723b1925210df0a;hp=3f3361b202f55866dea1944c1cc46733aa167f68;hpb=6d65abc3ee7c3353a12d90634300c8d4df7822f2;p=lemmy-ui.git diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 3f3361b..7b7f29e 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"; @@ -113,7 +114,7 @@ interface CommentNodeProps { moderators?: CommunityModeratorView[]; admins?: PersonView[]; noBorder?: boolean; - noIndent?: boolean; + isTopLevel?: boolean; viewOnly?: boolean; locked?: boolean; markable?: boolean; @@ -291,14 +292,10 @@ export class CommentNode extends Component { mark: this.isCommentNew || this.commentView.comment.distinguished, })} > -
+
- - - + {cv.comment.distinguished && ( - + )} - {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 && ( <> @@ -1158,7 +1132,7 @@ export class CommentNode extends Component { allLanguages={this.props.allLanguages} siteLanguages={this.props.siteLanguages} hideImages={this.props.hideImages} - isChild={!this.props.noIndent} + isChild={!this.props.isTopLevel} depth={this.props.node.depth + 1} finished={this.props.finished} onCommentReplyRead={this.props.onCommentReplyRead} @@ -1200,32 +1174,6 @@ export class CommentNode extends Component { } } - getRoleLabelPill({ - label, - tooltip, - textClasses, - hideOnMobile, - }: { - label: string; - tooltip: string; - textClasses?: string; - hideOnMobile?: boolean; - }) { - const classnames = classNames(`badge me-2 text-bg-light ${textClasses}`, { - "d-none d-md-inline": hideOnMobile, - }); - - return ( - - {label} - - ); - } - getLinkButton(small = false) { const cv = this.commentView; @@ -1509,6 +1457,7 @@ export class CommentNode extends Component { comment_id: i.commentId, removed: !i.commentView.comment.removed, auth: myAuthRequired(), + reason: i.state.removeReason, }); }