Add default profile picture for users who do not set one (#1339)

This commit is contained in:
SleeplessOne1917 2023-06-17 12:00:13 +00:00 committed by GitHub
parent 7c2a471031
commit 4bdddb1710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View file

@ -107,16 +107,6 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
setupTippy(); setupTippy();
} }
// TODO wut?
// componentDidUpdate(lastProps: UserDetailsProps) {
// for (const key of Object.keys(lastProps)) {
// if (lastProps[key] !== this.props[key]) {
// this.fetchUserData();
// break;
// }
// }
// }
render() { render() {
return ( return (
<div> <div>

View file

@ -73,10 +73,14 @@ export class PersonListing extends Component<PersonListingProps, any> {
const avatar = this.props.person.avatar; const avatar = this.props.person.avatar;
return ( return (
<> <>
{avatar && {!this.props.hideAvatar &&
!this.props.hideAvatar &&
!this.props.person.banned && !this.props.person.banned &&
showAvatars() && <PictrsImage src={avatar} icon />} showAvatars() && (
<PictrsImage
src={avatar ?? "/static/assets/icons/icon-96x96.png"}
icon
/>
)}
<span>{displayName}</span> <span>{displayName}</span>
</> </>
); );