diff --git a/src/containers/profile/ProfileSidebarMenu/index.tsx b/src/containers/profile/ProfileSidebarMenu/index.tsx index e7a4884c..dadcf52f 100644 --- a/src/containers/profile/ProfileSidebarMenu/index.tsx +++ b/src/containers/profile/ProfileSidebarMenu/index.tsx @@ -1,14 +1,17 @@ -import React, { VFC } from 'react'; +import React, { useCallback, VFC } from 'react'; import classNames from 'classnames'; import { Filler } from '~/components/containers/Filler'; import { Group } from '~/components/containers/Group'; import { Button } from '~/components/input/Button'; +import { Icon } from '~/components/input/Icon'; +import { MenuButton, MenuItemWithIcon } from '~/components/menu'; 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 { useAuth } from '~/hooks/auth/useAuth'; import markdown from '~/styles/common/markdown.module.scss'; import styles from './styles.module.scss'; @@ -18,8 +21,14 @@ interface ProfileSidebarMenuProps { } const ProfileSidebarMenu: VFC = ({ onClose }) => { + const { logout } = useAuth(); const { setActiveTab } = useStackContext(); + const onLogout = useCallback(() => { + logout(); + onClose(); + }, [onClose]); + return (
@@ -30,8 +39,6 @@ const ProfileSidebarMenu: VFC = ({ onClose }) => { setActiveTab(0)}>Настройки - setActiveTab(1)}>Заметки - setActiveTab(2)}>Удалённые посты
@@ -40,14 +47,11 @@ const ProfileSidebarMenu: VFC = ({ onClose }) => { - - - - + + + } position="top-end"> + Выйти +
); diff --git a/src/containers/sidebars/ProfileSidebar/index.tsx b/src/containers/sidebars/ProfileSidebar/index.tsx index 8aad811b..4e17fd44 100644 --- a/src/containers/sidebars/ProfileSidebar/index.tsx +++ b/src/containers/sidebars/ProfileSidebar/index.tsx @@ -15,7 +15,7 @@ interface ProfileSidebarProps extends DialogComponentProps { const ProfileSidebar: VFC = ({ onRequestClose }) => { return ( - +