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
e45dee3c9f
commit
98c66dec8c
24 changed files with 456 additions and 42 deletions
|
@ -1,27 +1,32 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, useState } from 'react';
|
||||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
import styles from './styles.scss';
|
||||
import { ProfileInfo } from '~/containers/profile/ProfileInfo';
|
||||
import { IDialogProps } from '~/redux/types';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectAuthProfile } from '~/redux/auth/selectors';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { CommentForm } from '~/components/node/CommentForm';
|
||||
import { ProfileMessages } from '~/containers/profile/ProfileMessages';
|
||||
|
||||
const TAB_CONTENT = {
|
||||
profile: <div>PROFILE</div>,
|
||||
messages: <ProfileMessages />,
|
||||
};
|
||||
const mapStateToProps = selectAuthProfile;
|
||||
const mapDispatchToProps = {};
|
||||
|
||||
type IProps = IDialogProps & ReturnType<typeof mapStateToProps> & {};
|
||||
|
||||
const ProfileDialogUnconnected: FC<IProps> = ({ onRequestClose, is_loading, user }) => (
|
||||
<BetterScrollDialog
|
||||
header={<ProfileInfo is_loading={is_loading} user={user} />}
|
||||
onClose={onRequestClose}
|
||||
>
|
||||
<ProfileMessages />
|
||||
</BetterScrollDialog>
|
||||
);
|
||||
const ProfileDialogUnconnected: FC<IProps> = ({ onRequestClose, is_loading, user }) => {
|
||||
const [tab, setTab] = useState('messages');
|
||||
|
||||
return (
|
||||
<BetterScrollDialog
|
||||
header={<ProfileInfo is_loading={is_loading} user={user} tab={tab} setTab={setTab} />}
|
||||
onClose={onRequestClose}
|
||||
>
|
||||
{TAB_CONTENT[tab] || null}
|
||||
</BetterScrollDialog>
|
||||
);
|
||||
};
|
||||
|
||||
const ProfileDialog = connect(
|
||||
mapStateToProps,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue