50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { useSession } from '../../context/session'
|
||
import type { PopupProps } from '../_shared/Popup'
|
||
import { Popup } from '../_shared/Popup'
|
||
import styles from '../_shared/Popup.module.scss'
|
||
|
||
type ProfilePopupProps = Omit<PopupProps, 'children'>
|
||
|
||
export const ProfilePopup = (props: ProfilePopupProps) => {
|
||
const {
|
||
session,
|
||
actions: { signOut }
|
||
} = useSession()
|
||
|
||
return (
|
||
<Popup {...props} horizontalAnchor="right">
|
||
<ul class="nodash">
|
||
<li>
|
||
<a href={`/author/${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()
|
||
}}
|
||
>
|
||
Выйти из аккаунта
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</Popup>
|
||
)
|
||
}
|