From 53beb321db42fe5cf8225d8af5478d9f6613d84d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 27 Jun 2024 11:59:51 -0500 Subject: [PATCH] Handle blocks --- src/components/ProfileCard.tsx | 35 +++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 7257064b77..23725e37a6 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -57,21 +57,19 @@ export function Card({ const moderation = moderateProfile(profile, moderationOpts) return ( - +
- - - + - {profile.description && } +
) } @@ -144,7 +142,13 @@ export function NameAndHandle({ ) } -export function Description({description}: {description?: string}) { +export function Description({ + profile: profileUnshadowed, +}: { + profile: AppBskyActorDefs.ProfileViewDetailed +}) { + const profile = useProfileShadow(profileUnshadowed) + const {description} = profile const rt = React.useMemo(() => { if (!description) return const rt = new RichTextApi({text: description || ''}) @@ -152,6 +156,13 @@ export function Description({description}: {description?: string}) { return rt }, [description]) if (!rt) return null + if ( + profile.viewer && + (profile.viewer.blockedBy || + profile.viewer.blocking || + profile.viewer.blockingByList) + ) + return null return (