1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

Добавил тему "Веспера"

This commit is contained in:
muerwre 2022-08-14 15:19:54 +07:00 committed by GitHub
parent 5d34090238
commit aee4b662d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
148 changed files with 1331 additions and 1338 deletions

View file

@ -14,7 +14,12 @@ export interface ProfileAvatarProps {
onChangePhoto: (file: File) => void;
}
const ProfileAvatar: FC<ProfileAvatarProps> = ({ photo, onChangePhoto, canEdit, size }) => {
const ProfileAvatar: FC<ProfileAvatarProps> = ({
photo,
onChangePhoto,
canEdit,
size,
}) => {
const onInputChange = useCallback(
async (event: ChangeEvent<HTMLInputElement>) => {
if (!event.target.files?.length) {
@ -23,10 +28,12 @@ const ProfileAvatar: FC<ProfileAvatarProps> = ({ photo, onChangePhoto, canEdit,
onChangePhoto(event.target.files[0]);
},
[onChangePhoto]
[onChangePhoto],
);
const backgroundImage = photo ? `url("${getURL(photo, ImagePresets.avatar)}")` : undefined;
const backgroundImage = photo
? `url("${getURL(photo, ImagePresets.avatar)}")`
: undefined;
return (
<div
@ -38,7 +45,15 @@ const ProfileAvatar: FC<ProfileAvatarProps> = ({ photo, onChangePhoto, canEdit,
}}
>
{canEdit && <input type="file" onInput={onInputChange} />}
{canEdit && <Button iconLeft="photo_add" round iconOnly className={styles.can_edit} />}
{canEdit && (
<Button
color="info"
iconLeft="photo_add"
round
iconOnly
className={styles.button}
/>
)}
</div>
);
};