X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fpost%2Fpost-listing.tsx;h=eb4dc8d974807547758e5d785ece3debf0510c35;hb=9ce164245f51b834997f31f3f12497ee87474965;hp=462087f34a13ffe1301d803f52ab735bb3ff6e3d;hpb=0bd0a497303bc5181cefafc7cca506c6ab493fc8;p=lemmy-ui.git diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 462087f..eb4dc8d 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -1,4 +1,4 @@ -import { getRoleLabelPill, myAuthRequired } from "@utils/app"; +import { myAuthRequired } from "@utils/app"; import { canShare, share } from "@utils/browser"; import { getExternalHost, getHttpBase } from "@utils/env"; import { @@ -55,6 +55,7 @@ import { setupTippy } from "../../tippy"; import { Icon, PurgeWarning, Spinner } from "../common/icon"; import { MomentTime } from "../common/moment-time"; import { PictrsImage } from "../common/pictrs-image"; +import { UserBadges } from "../common/user-badges"; import { VoteButtons, VoteButtonsCompact } from "../common/vote-buttons"; import { CommunityLink } from "../community/community-link"; import { PersonListing } from "../person/person-listing"; @@ -406,26 +407,13 @@ export class PostListing extends Component { return (
- - - - {this.creatorIsMod_ && - getRoleLabelPill({ - label: I18NextService.i18n.t("mod"), - tooltip: I18NextService.i18n.t("mod"), - classes: "text-bg-primary", - })} - {this.creatorIsAdmin_ && - getRoleLabelPill({ - label: I18NextService.i18n.t("admin"), - tooltip: I18NextService.i18n.t("admin"), - classes: "text-bg-danger", - })} - {post_view.creator.bot_account && - getRoleLabelPill({ - label: I18NextService.i18n.t("bot_account").toLowerCase(), - tooltip: I18NextService.i18n.t("bot_account"), - })} + + {this.props.showCommunity && ( <> {" "} @@ -477,8 +465,8 @@ export class PostListing extends Component { return ( <> -
-
+
+

{url && this.props.showBody ? ( { ) : ( this.postLink )} -

+
{/** - * If there is a URL, an embed title, and we were not told to show the - * body by the parent component, show the MetadataCard/body toggle. + * If there is (a) a URL and an embed title, or (b) a post body, and + * we were not told to show the body by the parent component, show the + * MetadataCard/body toggle. */} {!this.props.showBody && - post.url && - post.embed_title && + ((post.url && post.embed_title) || post.body) && this.showPreviewButton()} {post.removed && ( @@ -614,7 +602,7 @@ export class PostListing extends Component { {this.commentsButton} {canShare() && (