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

@ -1,30 +0,0 @@
import { useFetchFollowings } from '@/hooks'
import { toFollowingList } from '@/lib/link'
import { SecondaryPageLink } from '@/PageManager'
import { useFollowList } from '@/providers/FollowListProvider'
import { useNostr } from '@/providers/NostrProvider'
import { Loader } from 'lucide-react'
import { useTranslation } from 'react-i18next'
export default function Followings({ pubkey }: { pubkey: string }) {
const { t } = useTranslation()
const { pubkey: accountPubkey } = useNostr()
const { followings: selfFollowings } = useFollowList()
const { followings, isFetching } = useFetchFollowings(pubkey)
return (
<SecondaryPageLink
to={toFollowingList(pubkey)}
className="flex gap-1 hover:underline w-fit items-center"
>
{accountPubkey === pubkey ? (
selfFollowings.length
) : isFetching ? (
<Loader className="animate-spin size-4" />
) : (
followings.length
)}
<div className="text-muted-foreground">{t('Following')}</div>
</SecondaryPageLink>
)
}