feat: add profile menu item to sidebar
This commit is contained in:
parent
cdd35b447c
commit
3dd0ecd970
10 changed files with 257 additions and 187 deletions
19
src/components/Sidebar/ProfileButton.tsx
Normal file
19
src/components/Sidebar/ProfileButton.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { usePrimaryPage } from '@/PageManager'
|
||||
import { useNostr } from '@/providers/NostrProvider'
|
||||
import { UserRound } from 'lucide-react'
|
||||
import SidebarItem from './SidebarItem'
|
||||
|
||||
export default function ProfileButton() {
|
||||
const { navigate, current } = usePrimaryPage()
|
||||
const { checkLogin } = useNostr()
|
||||
|
||||
return (
|
||||
<SidebarItem
|
||||
title="Profile"
|
||||
onClick={() => checkLogin(() => navigate('profile'))}
|
||||
active={current === 'profile'}
|
||||
>
|
||||
<UserRound strokeWidth={3} />
|
||||
</SidebarItem>
|
||||
)
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import RelaysButton from './ExploreButton'
|
|||
import HomeButton from './HomeButton'
|
||||
import NotificationsButton from './NotificationButton'
|
||||
import PostButton from './PostButton'
|
||||
import ProfileButton from './ProfileButton'
|
||||
import SearchButton from './SearchButton'
|
||||
import SettingsButton from './SettingsButton'
|
||||
|
||||
|
|
@ -24,6 +25,7 @@ export default function PrimaryPageSidebar() {
|
|||
<RelaysButton />
|
||||
<NotificationsButton />
|
||||
<SearchButton />
|
||||
<ProfileButton />
|
||||
<SettingsButton />
|
||||
<PostButton />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue