Add default profile picture for users who do not set one

This commit is contained in:
abias 2023-06-16 22:39:38 -04:00
parent 7407858dc9
commit 19e599e1de
2 changed files with 7 additions and 13 deletions

View file

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

View file

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