matrix-art

An image gallery for Matrix
git clone git://archive.git.mtrnord.blog/MTRNord/matrix-art.git
Log | Files | Refs | README | LICENSE

commit 2e32f3410bee980c4b2fd7fcb2e685be9689ef19
parent 56216abe03d31a7efb3f90a5ce568f02260e00ee
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sun, 30 Jan 2022 21:05:41 +0100

Cleanup lints and add some fallback for users without avatar

Diffstat:
Mcomponents/editIcon.tsx | 2+-
Mcomponents/uploadIcon.tsx | 2+-
Mpages/profile/[userid].tsx | 6+++++-
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/components/editIcon.tsx b/components/editIcon.tsx @@ -18,7 +18,7 @@ export class EditIcon extends PureComponent<Props, State> { this.state = { className: (props.className || "") + " dark:fill-white fill-black", - onClick: props.onClick || (() => { }) + onClick: props.onClick || (() => {/*noop*/ }) }; } static propTypes = { diff --git a/components/uploadIcon.tsx b/components/uploadIcon.tsx @@ -18,7 +18,7 @@ export class UploadIcon extends PureComponent<Props, State> { this.state = { className: (props.className || "") + " dark:fill-white fill-black", - onClick: props.onClick || (() => { }) + onClick: props.onClick || (() => {/*noop*/ }) }; } diff --git a/pages/profile/[userid].tsx b/pages/profile/[userid].tsx @@ -235,7 +235,11 @@ class Profile extends PureComponent<Props, State> { </> ) ) - : <img className="block object-cover rounded-md" src={this.context.client.downloadLink(avatar_url)!} height="100" width="100" alt={displayname} title={displayname} /> + : (avatar_url ? + <img className="block object-cover rounded-md" src={this.context.client.downloadLink(avatar_url)!} height="100" width="100" alt={displayname} title={displayname} /> + : + <div className="rounded-md bg-slate-500 flex justify-center items-center"></div> + ) } </div> </span>