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

messages form

This commit is contained in:
Fedor Katurov 2019-11-12 15:15:45 +07:00
parent 98c66dec8c
commit 371f47f866
7 changed files with 98 additions and 16 deletions

View file

@ -0,0 +1,15 @@
import React, { FC } from 'react';
import styles from './styles.scss';
import { LoaderCircle } from '~/components/input/LoaderCircle';
interface IProps {}
const ProfileLoader: FC<IProps> = ({}) => {
return (
<div className={styles.loader}>
<LoaderCircle size={40} />
</div>
);
};
export { ProfileLoader };

View file

@ -0,0 +1,6 @@
.loader {
min-height: 33vh;
display: flex;
align-items: center;
justify-content: center;
}

View file

@ -6,6 +6,7 @@ import * as AUTH_ACTIONS from '~/redux/auth/actions';
import { Message } from '~/components/profile/Message';
import { Group } from '~/components/containers/Group';
import pick from 'ramda/es/pick';
import { NodeNoComments } from '~/components/node/NodeNoComments';
const mapStateToProps = state => ({
profile: selectAuthProfile(state),
@ -25,6 +26,9 @@ const ProfileMessagesUnconnected: FC<IProps> = ({ profile, user: { id }, authGet
authGetMessages(profile.user.username);
}, [profile.user]);
if (!profile.messages.length || profile.is_loading)
return <NodeNoComments is_loading={profile.is_loading_messages || profile.is_loading} />;
return (
<Group className={styles.messages}>
{profile.messages