0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console): display default avatar when the avatar is empty (#1191)

This commit is contained in:
Xiao Yijun 2022-06-22 10:52:22 +08:00 committed by GitHub
parent 9194a6ee54
commit 71ed416bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ const UserInfo = () => {
setShowDropdown(true);
}}
>
<img src={avatar ?? getAvatarById(id)} />
<img src={avatar || getAvatarById(id)} />
<div className={styles.wrapper}>
<div className={styles.name}>{name || t('users.unnamed')}</div>
</div>

View file

@ -120,7 +120,7 @@ const UserDetails = () => {
{userId && data && (
<>
<Card className={styles.header}>
<img className={styles.avatar} src={data.avatar ?? getAvatarById(userId)} />
<img className={styles.avatar} src={data.avatar || getAvatarById(userId)} />
<div className={styles.metadata}>
<div className={styles.name}>{data.name ?? '-'}</div>
<div>

View file

@ -127,7 +127,7 @@ const Users = () => {
<ItemPreview
title={name || t('users.unnamed')}
subtitle={conditionalString(username)}
icon={<img className={styles.avatar} src={avatar ?? getAvatarById(id)} />}
icon={<img className={styles.avatar} src={avatar || getAvatarById(id)} />}
to={`/users/${id}`}
size="compact"
/>