feat: following badge
This commit is contained in:
parent
f7051ed46b
commit
f23493742b
10 changed files with 67 additions and 23 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue