Handle blocks
This commit is contained in:
@@ -57,21 +57,19 @@ export function Card({
|
|||||||
const moderation = moderateProfile(profile, moderationOpts)
|
const moderation = moderateProfile(profile, moderationOpts)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.flex_1, a.gap_xs]}>
|
<View style={[a.flex_1, a.gap_sm]}>
|
||||||
<Header>
|
<Header>
|
||||||
<Avatar profile={profile} moderationOpts={moderationOpts} />
|
<Avatar profile={profile} moderationOpts={moderationOpts} />
|
||||||
<NameAndHandle profile={profile} moderationOpts={moderationOpts} />
|
<NameAndHandle profile={profile} moderationOpts={moderationOpts} />
|
||||||
<FollowButton profile={profile} logContext={logContext} />
|
<FollowButton profile={profile} logContext={logContext} />
|
||||||
</Header>
|
</Header>
|
||||||
|
|
||||||
<View style={[a.mb_xs]}>
|
<ProfileCardPills
|
||||||
<ProfileCardPills
|
followedBy={Boolean(profile.viewer?.followedBy)}
|
||||||
followedBy={Boolean(profile.viewer?.followedBy)}
|
moderation={moderation}
|
||||||
moderation={moderation}
|
/>
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
{profile.description && <Description description={profile.description} />}
|
<Description profile={profile} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -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(() => {
|
const rt = React.useMemo(() => {
|
||||||
if (!description) return
|
if (!description) return
|
||||||
const rt = new RichTextApi({text: description || ''})
|
const rt = new RichTextApi({text: description || ''})
|
||||||
@@ -152,6 +156,13 @@ export function Description({description}: {description?: string}) {
|
|||||||
return rt
|
return rt
|
||||||
}, [description])
|
}, [description])
|
||||||
if (!rt) return null
|
if (!rt) return null
|
||||||
|
if (
|
||||||
|
profile.viewer &&
|
||||||
|
(profile.viewer.blockedBy ||
|
||||||
|
profile.viewer.blocking ||
|
||||||
|
profile.viewer.blockingByList)
|
||||||
|
)
|
||||||
|
return null
|
||||||
return (
|
return (
|
||||||
<RichText
|
<RichText
|
||||||
value={rt}
|
value={rt}
|
||||||
@@ -224,6 +235,12 @@ export function FollowButtonInner({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (!profile.viewer) return null
|
if (!profile.viewer) return null
|
||||||
|
if (
|
||||||
|
profile.viewer.blockedBy ||
|
||||||
|
profile.viewer.blocking ||
|
||||||
|
profile.viewer.blockingByList
|
||||||
|
)
|
||||||
|
return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
|||||||
Reference in New Issue
Block a user