1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-05-05 17:46:41 +07:00

added empty avatar placeholder

This commit is contained in:
Fedor Katurov 2022-09-21 12:26:35 +07:00
parent 080d59858c
commit 8fc06a4819
6 changed files with 470 additions and 23 deletions
src/components/main/UserButton

View file

@ -1,5 +1,6 @@
import { FC } from 'react';
import { Avatar } from '~/components/common/Avatar';
import { Group } from '~/components/containers/Group';
import { Icon } from '~/components/input/Icon';
import { ImagePresets } from '~/constants/urls';
@ -19,15 +20,7 @@ const UserButton: FC<IProps> = ({ username, photo, onClick }) => {
<button className={styles.wrap} onClick={onClick}>
<Group horizontal className={styles.user_button}>
<div className={styles.username}>{username}</div>
<div
className={styles.user_avatar}
style={{
backgroundImage: `url('${getURL(photo, ImagePresets.avatar)}')`,
}}
>
{(!photo || !photo.id) && <Icon icon="profile" />}
</div>
<Avatar url={getURL(photo, ImagePresets.avatar)} size={32} />
</Group>
</button>
);