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; let icon = this.props.community.icon;
return ( return (
<> <>
{!this.props.hideAvatar && showAvatars() && icon && ( {!this.props.hideAvatar &&
<PictrsImage src={icon} icon /> !this.props.community.removed &&
)} showAvatars() &&
icon && <PictrsImage src={icon} icon />}
<span className="overflow-wrap-anywhere">{displayName}</span> <span className="overflow-wrap-anywhere">{displayName}</span>
</> </>
); );

View file

@ -119,7 +119,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
return ( return (
<div> <div>
<h5 className="mb-0"> <h5 className="mb-0">
{this.props.showIcon && ( {this.props.showIcon && !community.removed && (
<BannerIconHeader icon={community.icon} banner={community.banner} /> <BannerIconHeader icon={community.icon} banner={community.banner} />
)} )}
<span className="mr-2">{community.title}</span> <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; let avatar = this.props.person.avatar;
return ( return (
<> <>
{avatar && !this.props.hideAvatar && showAvatars() && ( {avatar &&
<PictrsImage src={avatar} icon /> !this.props.hideAvatar &&
)} !this.props.person.banned &&
showAvatars() && <PictrsImage src={avatar} icon />}
<span>{displayName}</span> <span>{displayName}</span>
</> </>
); );

View file

@ -384,7 +384,12 @@ export class Profile extends Component<any, ProfileState> {
return ( return (
pv && ( pv && (
<div> <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="mb-3">
<div className=""> <div className="">
<div className="mb-0 d-flex flex-wrap"> <div className="mb-0 d-flex flex-wrap">