mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
displaying user description
This commit is contained in:
parent
371f47f866
commit
7f04fe1e36
7 changed files with 59 additions and 3 deletions
|
@ -2,10 +2,8 @@
|
|||
@include outer_shadow();
|
||||
padding: $gap;
|
||||
background: $content_bg;
|
||||
// position: relative;
|
||||
|
||||
textarea {
|
||||
// margin-bottom: 40px;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
|
32
src/components/profile/ProfileDescription/index.tsx
Normal file
32
src/components/profile/ProfileDescription/index.tsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
import React, { FC } from 'react';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import { formatText } from '~/utils/dom';
|
||||
import styles from './styles.scss';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectAuthProfile } from '~/redux/auth/selectors';
|
||||
import { ProfileLoader } from '~/containers/profile/ProfileLoader';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
profile: selectAuthProfile(state),
|
||||
});
|
||||
|
||||
type IProps = ReturnType<typeof mapStateToProps> & {};
|
||||
|
||||
const ProfileDescriptionUnconnected: FC<IProps> = ({ profile: { user, is_loading } }) => {
|
||||
if (is_loading) return <ProfileLoader />;
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
{user.description && <div className={styles.content}>{formatText(user.description)}</div>}
|
||||
{!user.description && (
|
||||
<div className={styles.placeholder}>
|
||||
{user.fullname || user.username} пока ничего не рассказал о себе
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const ProfileDescription = connect(mapStateToProps)(ProfileDescriptionUnconnected);
|
||||
|
||||
export { ProfileDescription };
|
14
src/components/profile/ProfileDescription/styles.scss
Normal file
14
src/components/profile/ProfileDescription/styles.scss
Normal file
|
@ -0,0 +1,14 @@
|
|||
.content {
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 33vh;
|
||||
padding: 40px;
|
||||
box-sizing: border-box;
|
||||
color: transparentize($color: white, $amount: 0.8);
|
||||
text-transform: uppercase;
|
||||
font: $font_16_semibold;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue