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

notifications: added profile indicator

This commit is contained in:
Fedor Katurov 2023-03-12 11:07:32 +06:00
parent 97590d88af
commit dc90f2505c
10 changed files with 127 additions and 37 deletions
src/components/common/Avatar

View file

@ -14,22 +14,37 @@ interface Props extends DivProps {
url?: string;
username?: string;
size?: number;
hasUpdates?: boolean;
preset?: typeof imagePresets[keyof typeof imagePresets];
}
const Avatar = forwardRef<HTMLDivElement, Props>(
(
{ url, username, size, className, preset = imagePresets.avatar, ...rest },
{
url,
username,
size,
className,
preset = imagePresets.avatar,
hasUpdates,
...rest
},
ref,
) => {
return (
<Square
<div
{...rest}
image={getURLFromString(url, preset) || '/images/john_doe.svg'}
className={classNames(styles.avatar, className)}
size={size}
ref={ref}
/>
className={classNames(styles.container, {
[styles.has_dot]: hasUpdates,
})}
>
<Square
image={getURLFromString(url, preset) || '/images/john_doe.svg'}
className={classNames(styles.avatar, className)}
size={size}
ref={ref}
/>
</div>
);
},
);