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,34 @@
import Profile from '@/components/Profile'
import PrimaryPageLayout from '@/layouts/PrimaryPageLayout'
import { useNostr } from '@/providers/NostrProvider'
import { UserRound } from 'lucide-react'
import { forwardRef } from 'react'
import { useTranslation } from 'react-i18next'
const ProfilePage = forwardRef((_, ref) => {
const { pubkey } = useNostr()
return (
<PrimaryPageLayout
pageName="profile"
titlebar={<ProfilePageTitlebar />}
displayScrollToTopButton
ref={ref}
>
<Profile id={pubkey ?? undefined} />
</PrimaryPageLayout>
)
})
ProfilePage.displayName = 'ProfilePage'
export default ProfilePage
function ProfilePageTitlebar() {
const { t } = useTranslation()
return (
<div className="flex gap-2 items-center h-full pl-3">
<UserRound />
<div className="text-lg font-semibold">{t('Profile')}</div>
</div>
)
}