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
|
|
@ -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>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue