mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
added profile sidebar just to test if I can
This commit is contained in:
parent
b4edba1beb
commit
d9a1b5cf13
10 changed files with 209 additions and 10 deletions
31
src/components/profile/ProfileSidebarInfo/index.tsx
Normal file
31
src/components/profile/ProfileSidebarInfo/index.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import React, { FC } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { ProfileAvatar } from '~/containers/profile/ProfileAvatar';
|
||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||
import { getPrettyDate } from '~/utils/dom';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
|
||||
interface IProps {
|
||||
is_loading: boolean;
|
||||
user: IUser;
|
||||
}
|
||||
|
||||
const ProfileSidebarInfo: FC<IProps> = ({ is_loading, user }) => (
|
||||
<div className={styles.wrap}>
|
||||
<div className={styles.avatar}>
|
||||
<ProfileAvatar />
|
||||
</div>
|
||||
|
||||
<div className={styles.field}>
|
||||
<div className={styles.name}>
|
||||
{is_loading ? <Placeholder width="80%" /> : user.fullname || user.username}
|
||||
</div>
|
||||
|
||||
<div className={styles.description}>
|
||||
{is_loading ? <Placeholder /> : getPrettyDate(user.last_seen)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export { ProfileSidebarInfo };
|
39
src/components/profile/ProfileSidebarInfo/styles.module.scss
Normal file
39
src/components/profile/ProfileSidebarInfo/styles.module.scss
Normal file
|
@ -0,0 +1,39 @@
|
|||
.wrap.wrap {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
flex: 0 0 100px;
|
||||
display: flex;
|
||||
margin: $gap;
|
||||
box-shadow: transparentize(white, 0.95) 0 0 0 1px;
|
||||
border-radius: $radius;
|
||||
background: transparentize(black, 0.8);
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: $radius;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
flex: 0 0 100px;
|
||||
left: -$gap;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.field {
|
||||
flex: 1;
|
||||
padding: $gap;
|
||||
}
|
||||
|
||||
.name {
|
||||
font: $font_24_bold;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: transparentize($color: white, $amount: 0.7);
|
||||
font: $font_14_regular;
|
||||
text-transform: lowercase;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue