1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added imagecaching

This commit is contained in:
Fedor Katurov 2019-11-07 12:20:17 +07:00
parent 88f50e3348
commit 1320f0851f
16 changed files with 43 additions and 35 deletions

View file

@ -4,6 +4,7 @@ import styles from './styles.scss';
import { getURL } from '~/utils/dom';
import { Icon } from '~/components/input/Icon';
import { IUser } from '~/redux/auth/types';
import { PRESETS } from '~/constants/urls';
interface IProps {
user: Partial<IUser>;
@ -14,7 +15,10 @@ const UserButton: FC<IProps> = ({ user: { username, photo }, onLogout }) => (
<div className={styles.wrap}>
<Group horizontal className={styles.user_button}>
<div>{username}</div>
<div className={styles.user_avatar} style={{ backgroundImage: `url('${getURL(photo)}')` }}>
<div
className={styles.user_avatar}
style={{ backgroundImage: `url('${getURL(photo, PRESETS.avatar)}')` }}
>
{(!photo || !photo.id) && <Icon icon="profile" />}
</div>
</Group>