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

message notifications working

This commit is contained in:
Fedor Katurov 2019-11-13 12:53:29 +07:00
parent 83c9900af1
commit 7583a57b04
11 changed files with 137 additions and 32 deletions

View file

@ -1,4 +1,4 @@
import React, { FC, useState } from 'react';
import React, { FC, useState, useCallback } from 'react';
import { BetterScrollDialog } from '../BetterScrollDialog';
import { ProfileInfo } from '~/containers/profile/ProfileInfo';
import { IDialogProps } from '~/redux/types';
@ -6,18 +6,30 @@ import { connect } from 'react-redux';
import { selectAuthProfile } from '~/redux/auth/selectors';
import { ProfileMessages } from '~/containers/profile/ProfileMessages';
import { ProfileDescription } from '~/components/profile/ProfileDescription';
import * as AUTH_ACTIONS from '~/redux/auth/actions';
import { IAuthState } from '~/redux/auth/types';
const TAB_CONTENT = {
profile: <ProfileDescription />,
messages: <ProfileMessages />,
};
const mapStateToProps = selectAuthProfile;
const mapDispatchToProps = {};
const mapDispatchToProps = {
authSetProfile: AUTH_ACTIONS.authSetProfile,
};
type IProps = IDialogProps & ReturnType<typeof mapStateToProps> & {};
type IProps = IDialogProps & ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
const ProfileDialogUnconnected: FC<IProps> = ({ onRequestClose, is_loading, user }) => {
const [tab, setTab] = useState('profile');
const ProfileDialogUnconnected: FC<IProps> = ({
onRequestClose,
authSetProfile,
is_loading,
user,
tab,
}) => {
const setTab = useCallback((val: IAuthState['profile']['tab']) => authSetProfile({ tab: val }), [
authSetProfile,
]);
return (
<BetterScrollDialog