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

displaying user description

This commit is contained in:
Fedor Katurov 2019-11-12 15:31:51 +07:00
parent 371f47f866
commit 7f04fe1e36
7 changed files with 59 additions and 3 deletions

View file

@ -2,10 +2,8 @@
@include outer_shadow();
padding: $gap;
background: $content_bg;
// position: relative;
textarea {
// margin-bottom: 40px;
padding-bottom: 0 !important;
}
}

View 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 };

View 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;
}