feat: add profile menu item to sidebar

This commit is contained in:
codytseng 2025-08-28 21:48:14 +08:00
parent cdd35b447c
commit 3dd0ecd970
10 changed files with 257 additions and 187 deletions

View 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>
)
}

View file

@ -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>