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:
parent
98c66dec8c
commit
371f47f866
7 changed files with 98 additions and 16 deletions
15
src/containers/profile/ProfileLoader/index.tsx
Normal file
15
src/containers/profile/ProfileLoader/index.tsx
Normal 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 };
|
6
src/containers/profile/ProfileLoader/styles.scss
Normal file
6
src/containers/profile/ProfileLoader/styles.scss
Normal file
|
@ -0,0 +1,6 @@
|
|||
.loader {
|
||||
min-height: 33vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue