]> Untitled Git - lemmy-ui.git/commitdiff
Merge branch 'main' into fix/fix-badges-spacing-componentize
authorJay Sitter <jsit@users.noreply.github.com>
Sun, 2 Jul 2023 23:47:41 +0000 (19:47 -0400)
committerGitHub <noreply@github.com>
Sun, 2 Jul 2023 23:47:41 +0000 (19:47 -0400)
1  2 
src/shared/components/post/post-listing.tsx

index bc853b37f846594aaf1c2f044a3034eb6799c118,654f92dceb05518eb7315195965f1f24aa3794de..29004078d1f67a8537d63acd7d4cb7f199014846
@@@ -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 (
        <div className="small mb-1 mb-md-0">
 -        <span className="me-1">
 -          <PersonListing person={post_view.creator} />
 -        </span>
 -        {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"),
 -          })}
 +        <PersonListing person={post_view.creator} />
 +        <UserBadges
 +          classNames="ms-1"
 +          isMod={this.creatorIsMod_}
 +          isAdmin={this.creatorIsAdmin_}
 +          isBot={post_view.creator.bot_account}
 +        />
          {this.props.showCommunity && (
            <>
              {" "}
            </h5>
  
            {/**
-            * 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 && (