webapp/src/components/Nav/ProfilePopup.tsx
kvakazyambra 11874c6c1d auth context
topic page fix, getAuthor, getTopic
newapi -> testapi
fixes
2022-11-14 01:09:20 +01:00

49 lines
1.1 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 { Popup, PopupProps } from './Popup'
import styles from './Popup.module.scss'
import { useAuth } from '../../context/auth'
type ProfilePopupProps = Omit<PopupProps, 'children'>
export const ProfilePopup = (props: ProfilePopupProps) => {
const {
session,
actions: { signOut }
} = useAuth()
return (
<Popup {...props} horizontalAnchor="right">
<ul class="nodash">
<li>
<a href={`/${session().user?.slug}`}>Профиль</a>
</li>
<li>
<a href="#">Черновики</a>
</li>
<li>
<a href="#">Подписки</a>
</li>
<li>
<a href="#">Комментарии</a>
</li>
<li>
<a href="#">Закладки</a>
</li>
<li>
<a href="#">Настройки</a>
</li>
<li class={styles.topBorderItem}>
<a
href="#"
onClick={(event) => {
event.preventDefault()
signOut()
}}
>
Выйти из&nbsp;аккаунта
</a>
</li>
</ul>
</Popup>
)
}