1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/containers/profile/ProfileSidebarMenu/index.tsx
muerwre a39d000ff2
add user notifications (#148)
* added notification settings

* notifications: added list to profile

* notifications: changed appearance for comment notifications
2023-03-11 17:16:31 +06:00

83 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { useCallback, VFC } from 'react';
import classNames from 'classnames';
import { Superpower } from '~/components/boris/Superpower';
import { Filler } from '~/components/containers/Filler';
import { Group } from '~/components/containers/Group';
import { Zone } from '~/components/containers/Zone';
import { VerticalMenu } from '~/components/menu/VerticalMenu';
import { useStackContext } from '~/components/sidebar/SidebarStack';
import { ProfileSidebarHead } from '~/containers/profile/ProfileSidebarHead';
import { ProfileStats } from '~/containers/profile/ProfileStats';
import { ThemeSwitcher } from '~/containers/settings/ThemeSwitcher';
import { useAuth } from '~/hooks/auth/useAuth';
import markdown from '~/styles/common/markdown.module.scss';
import { ProfileSidebarLogoutButton } from '../ProfileSidebarLogoutButton';
import { ProfileToggles } from '../ProfileToggles';
import styles from './styles.module.scss';
interface ProfileSidebarMenuProps {
onClose: () => void;
}
const ProfileSidebarMenu: VFC<ProfileSidebarMenuProps> = ({ onClose }) => {
const { logout } = useAuth();
const { setActiveTab } = useStackContext();
const onLogout = useCallback(() => {
logout();
onClose();
}, [onClose]);
return (
<div className={styles.wrap}>
<div>
<ProfileSidebarHead />
</div>
<Filler className={classNames(markdown.wrapper, styles.text)}>
<Group>
<VerticalMenu className={styles.menu}>
<VerticalMenu.Item onClick={() => setActiveTab(0)}>
Настройки
</VerticalMenu.Item>
<Superpower>
<VerticalMenu.Item onClick={() => setActiveTab(1)}>
Уведомления
</VerticalMenu.Item>
</Superpower>
<VerticalMenu.Item onClick={() => setActiveTab(2)}>
Заметки
</VerticalMenu.Item>
</VerticalMenu>
<Group className={styles.toggles}>
<Zone>
<ProfileToggles />
</Zone>
<Zone>
<ThemeSwitcher />
</Zone>
</Group>
<div className={styles.stats}>
<ProfileStats />
</div>
</Group>
</Filler>
<Group className={styles.buttons} horizontal>
<Filler />
<ProfileSidebarLogoutButton onLogout={onLogout} />
</Group>
</div>
);
};
export { ProfileSidebarMenu };