From: Jay Sitter Date: Sun, 2 Jul 2023 23:47:41 +0000 (-0400) Subject: Merge branch 'main' into fix/fix-badges-spacing-componentize X-Git-Url: http://these/git/?a=commitdiff_plain;h=4e1e29b9a59f9155cc5aea4271e26208e33d815d;hp=-c;p=lemmy-ui.git Merge branch 'main' into fix/fix-badges-spacing-componentize --- 4e1e29b9a59f9155cc5aea4271e26208e33d815d diff --combined src/shared/components/post/post-listing.tsx index bc853b3,654f92d..2900407 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@@ -1,4 -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,7 -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"; @@@ -407,13 -406,26 +407,13 @@@ export class PostListing extends Compon 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 && ( <> {" "} @@@ -485,12 -497,12 +485,12 @@@ {/** - * 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 && (