webapp/src/components/Nav/Private.tsx
Igor Lobanov 62f934c1f1 Merge remote-tracking branch 'origin/dev' into header-module-css
# Conflicts:
#	src/components/Nav/Private.tsx
2022-10-04 12:31:01 +02:00

44 lines
1.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 type { Author } from '../../graphql/types.gen'
import Userpic from '../Author/Userpic'
import { Icon } from './Icon'
import './Private.module.scss'
import { useAuthStore } from '../../stores/auth'
import { useRouter } from '../../stores/router'
export default () => {
const { session } = useAuthStore()
const { getPage } = useRouter()
return (
<div class="userControl col">
<div class="userControlItem userControlItemWritePost">
<a href="/create">
<span class="text-label">опубликовать материал</span>
<Icon name="pencil" />
</a>
</div>
<div class="userControlItem userControlItemSearch">
<a href="/search">
<Icon name="search" />
</a>
</div>
<div class="userControlItem userControlItemInbox">
<a href="/inbox">
{/*FIXME: replace with route*/}
<div classList={{ entered: getPage().path === '/inbox' }}>
<Icon name="inbox-white" counter={session().info?.unread || 0} />
</div>
</a>
</div>
<div class="userControlItem">
<a href={`/${session().user?.slug}`}>
{/*FIXME: replace with route*/}
<div classList={{ entered: getPage().path === `/${session().user?.slug}` }}>
<Userpic user={session().user as Author} />
</div>
</a>
</div>
</div>
)
}