]> Untitled Git - lemmy-ui.git/commitdiff
Merge remote-tracking branch 'lemmy/main' into fix/fix-long-words-in-titles-overflow
authorJay Sitter <jay@jaysitter.com>
Mon, 3 Jul 2023 21:13:33 +0000 (17:13 -0400)
committerJay Sitter <jay@jaysitter.com>
Mon, 3 Jul 2023 21:13:33 +0000 (17:13 -0400)
* lemmy/main:
  v0.18.1-rc.9
  fix: Fix comment collapse and vote buttons not having focus style (#1789)
  Add missing modlog reasons (#1787)
  Fix search page breaking on initial load when logged in (#1781)
  feat: Add PR template (#1785)
  v0.18.1-rc.8
  Fix profile loading spinner
  fix: Move getRoleLabelPill to the only component that uses it
  fix: Remove unused hasBadges() function
  fix: Fix badge alignment and break out into component
  fix: Fix up filter row gaps and margins a little
  fix: Fix heading levels
  fix: Simplify row classes a bit
  fix: Fix some gaps in search filters
  fix: Fix row gap on search options
  fix: Add bottom margin to inbox controls
  fix: Small cleanup to search/inbox controls

1  2 
src/shared/components/post/post-listing.tsx

index 9bb416afeeefb06fcb6be1a8ff68e58ef14ce1f7,84851de90262da51c8bb60b29c92b4e387215a1d..5dcff2fce1407ddb4a8e4f0673ca2ac990283e58
@@@ -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,6 -55,7 +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 +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 && (
            <>
              {" "}
  
      return (
        <>
 -        <div className="post-title overflow-hidden">
 -          <h1 className="h5 d-inline">
 +        <div className="post-title">
-           <h5 className="d-inline text-break">
++          <h1 className="h5 d-inline text-break">
              {url && this.props.showBody ? (
                <a
                  className={
              ) : (
                this.postLink
              )}
-           </h5>
+           </h1>
  
            {/**
             * If there is (a) a URL and an embed title, or (b) a post body, and
        UserService.Instance.myUserInfo?.local_user_view.person.id
      );
    }
    handleEditClick(i: PostListing) {
      i.setState({ showEdit: true });
    }
        post_id: i.postView.post.id,
        removed: !i.postView.post.removed,
        auth: myAuthRequired(),
+       reason: i.state.removeReason,
      });
    }
  
    handlePurgeSubmit(i: PostListing, event: any) {
      event.preventDefault();
      i.setState({ purgeLoading: true });
-     if (i.state.purgeType == PurgeType.Person) {
+     if (i.state.purgeType === PurgeType.Person) {
        i.props.onPurgePerson({
          person_id: i.postView.creator.id,
          reason: i.state.purgeReason,
          auth: myAuthRequired(),
        });
-     } else if (i.state.purgeType == PurgeType.Post) {
+     } else if (i.state.purgeType === PurgeType.Post) {
        i.props.onPurgePost({
          post_id: i.postView.post.id,
          reason: i.state.purgeReason,