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

added empty profile sidebar

This commit is contained in:
Fedor Katurov 2022-01-11 16:34:26 +07:00
parent 7f7c12df2b
commit 0c9d5467ed
12 changed files with 138 additions and 43 deletions

View file

@ -27,7 +27,9 @@ const ProfileInfo: FC<IProps> = ({ isOwn }) => {
return (
<div>
<Group className={styles.wrap} horizontal>
<ProfileAvatar canEdit={isOwn} onChangePhoto={updatePhoto} photo={photo} />
<div className={styles.avatar}>
<ProfileAvatar canEdit={isOwn} onChangePhoto={updatePhoto} photo={photo} />
</div>
<div className={styles.field}>
<div className={styles.name}>

View file

@ -8,13 +8,6 @@
}
.avatar {
@include outer_shadow();
border-radius: $radius;
width: 100px;
height: 100px;
background: $content_bg 50% 50% no-repeat;
background-size: cover;
position: absolute;
bottom: 0;
left: $gap;

View file

@ -0,0 +1,25 @@
import React, { VFC } from 'react';
import { Group } from '~/components/containers/Group';
import { Filler } from '~/components/containers/Filler';
import { ProfileAvatar } from '~/components/profile/ProfileAvatar';
import { usePatchUser } from '~/hooks/auth/usePatchUser';
import { useUser } from '~/hooks/auth/useUser';
interface ProfileSidebarHeadProps {}
const ProfileSidebarHead: VFC<ProfileSidebarHeadProps> = () => {
const { user } = useUser();
const { updatePhoto } = usePatchUser();
return (
<Group horizontal>
<ProfileAvatar canEdit onChangePhoto={updatePhoto} photo={user.photo} size={72} />
<Filler>
<h2>{user.fullname || user.username}</h2>
</Filler>
</Group>
);
};
export { ProfileSidebarHead };