webapp/src/components/Nav/ProfilePopup.tsx

46 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-10-26 19:22:22 +00:00
import { Popup, PopupProps } from './Popup'
import { signOut, useAuthStore } from '../../stores/auth'
2022-11-02 21:55:29 +00:00
import styles from './Popup.module.scss'
2022-10-26 19:22:22 +00:00
type ProfilePopupProps = Omit<PopupProps, 'children'>
export const ProfilePopup = (props: ProfilePopupProps) => {
const { session } = useAuthStore()
return (
<Popup {...props} horizontalAnchor="right">
2022-10-26 19:22:22 +00:00
<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>
2022-11-02 21:55:29 +00:00
<li class={styles.topBorderItem}>
<a
href="#"
onClick={(event) => {
event.preventDefault()
signOut()
}}
>
Выйти из&nbsp;аккаунта
</a>
2022-10-26 19:22:22 +00:00
</li>
</ul>
</Popup>
)
}