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

#23 added superpowers ui tab

This commit is contained in:
Fedor Katurov 2021-03-19 17:00:26 +07:00
parent c939dcbce8
commit b1f019ebae
15 changed files with 162 additions and 42 deletions

View file

@ -29,7 +29,9 @@ const ProfileLayoutUnconnected: FC<IProps> = ({ history, nodeSetCoverImage }) =>
useEffect(() => {
if (user && user.id && user.cover) {
nodeSetCoverImage(user.cover);
return () => nodeSetCoverImage(null);
return () => {
nodeSetCoverImage(undefined);
};
}
}, [user]);

View file

@ -2,6 +2,8 @@ import React, { FC, useCallback } from 'react';
import styles from './styles.module.scss';
import classNames from 'classnames';
import { IAuthState } from '~/redux/auth/types';
import { Tabs } from '~/components/dialogs/Tabs';
import { Tab } from '~/components/dialogs/Tab';
interface IProps {
tab: string;
@ -19,30 +21,20 @@ const ProfileTabs: FC<IProps> = ({ tab, is_own, setTab }) => {
);
return (
<div className={styles.wrap}>
<div
className={classNames(styles.tab, { [styles.active]: tab === 'profile' })}
onClick={changeTab('profile')}
>
<Tabs>
<Tab active={tab === 'profile'} onClick={changeTab('profile')}>
Профиль
</div>
<div
className={classNames(styles.tab, { [styles.active]: tab === 'messages' })}
onClick={changeTab('messages')}
>
</Tab>
<Tab active={tab === 'messages'} onClick={changeTab('messages')}>
Сообщения
</div>
</Tab>
{is_own && (
<>
<div
className={classNames(styles.tab, { [styles.active]: tab === 'settings' })}
onClick={changeTab('settings')}
>
Настройки
</div>
</>
<Tab active={tab === 'settings'} onClick={changeTab('settings')}>
Настройки
</Tab>
)}
</div>
</Tabs>
);
};