Don't show icons / banners for banned users and removed communities. (#962)

- Fixes #961
This commit is contained in:
Dessalines 2023-03-26 22:10:35 -04:00 committed by GitHub
parent 1ad36d2c1d
commit 9bab9c3cab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

View 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>
</>
);

View 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>

View 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>
</>
);

View 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">