]> Untitled Git - lemmy-ui.git/commitdiff
Don't show icons / banners for banned users and removed communities. (#962)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 27 Mar 2023 02:10:35 +0000 (22:10 -0400)
committerGitHub <noreply@github.com>
Mon, 27 Mar 2023 02:10:35 +0000 (22:10 -0400)
- Fixes #961

src/shared/components/community/community-link.tsx
src/shared/components/community/sidebar.tsx
src/shared/components/person/person-listing.tsx
src/shared/components/person/profile.tsx

index b65e3d1071e0b60d35741651e6a49a23688ea975..04e7a5168c62f79f6a88a36294e2d50ba029dad8 100644 (file)
@@ -58,9 +58,10 @@ export class CommunityLink extends Component<CommunityLinkProps, any> {
     let icon = this.props.community.icon;
     return (
       <>
-        {!this.props.hideAvatar && showAvatars() && icon && (
-          <PictrsImage src={icon} icon />
-        )}
+        {!this.props.hideAvatar &&
+          !this.props.community.removed &&
+          showAvatars() &&
+          icon && <PictrsImage src={icon} icon />}
         <span className="overflow-wrap-anywhere">{displayName}</span>
       </>
     );
index 144075b5196bb46b832ff2508165b949988c4f89..688a8e8c57d99ea6f18569f88aaab047c332485d 100644 (file)
@@ -119,7 +119,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
     return (
       <div>
         <h5 className="mb-0">
-          {this.props.showIcon && (
+          {this.props.showIcon && !community.removed && (
             <BannerIconHeader icon={community.icon} banner={community.banner} />
           )}
           <span className="mr-2">{community.title}</span>
index 3050450b05163cc75c83c39222c58828e6bbf581..6cf4ad1353768f1f6cdb8a54e0eda4bb59c5a332 100644 (file)
@@ -73,9 +73,10 @@ export class PersonListing extends Component<PersonListingProps, any> {
     let avatar = this.props.person.avatar;
     return (
       <>
-        {avatar && !this.props.hideAvatar && showAvatars() && (
-          <PictrsImage src={avatar} icon />
-        )}
+        {avatar &&
+          !this.props.hideAvatar &&
+          !this.props.person.banned &&
+          showAvatars() && <PictrsImage src={avatar} icon />}
         <span>{displayName}</span>
       </>
     );
index d12a981fc72b29c7b517521d8662a3f587810b4b..0195cb8716f6f7a70b612ba314acbb083b87aaea 100644 (file)
@@ -384,7 +384,12 @@ export class Profile extends Component<any, ProfileState> {
     return (
       pv && (
         <div>
-          <BannerIconHeader banner={pv.person.banner} icon={pv.person.avatar} />
+          {!isBanned(pv.person) && (
+            <BannerIconHeader
+              banner={pv.person.banner}
+              icon={pv.person.avatar}
+            />
+          )}
           <div className="mb-3">
             <div className="">
               <div className="mb-0 d-flex flex-wrap">