feat: following badge

This commit is contained in:
codytseng 2025-10-16 22:42:24 +08:00
parent f7051ed46b
commit f23493742b
10 changed files with 67 additions and 23 deletions

View file

@ -20,10 +20,10 @@ import { toast } from 'sonner'
export default function FollowButton({ pubkey }: { pubkey: string }) {
const { t } = useTranslation()
const { pubkey: accountPubkey, checkLogin } = useNostr()
const { followings, follow, unfollow } = useFollowList()
const { followingSet, follow, unfollow } = useFollowList()
const [updating, setUpdating] = useState(false)
const [hover, setHover] = useState(false)
const isFollowing = useMemo(() => followings.includes(pubkey), [followings, pubkey])
const isFollowing = useMemo(() => followingSet.has(pubkey), [followingSet, pubkey])
if (!accountPubkey || (pubkey && pubkey === accountPubkey)) return null