fix: hide blocked user content

This commit is contained in:
gosangam
2026-06-13 00:47:11 +05:30
parent 25a729959f
commit 6a0559e608
4 changed files with 113 additions and 11 deletions
+16 -3
View File
@@ -51,6 +51,7 @@ export function ProfileHeader({
relationship,
enableActions = false,
country,
interactiveCounts = true,
}: {
avatarURL: string | null;
name: string;
@@ -75,6 +76,10 @@ export function ProfileHeader({
* this header with key={handle} so the live count + relationship state
* below re-seeds cleanly when navigating between profiles. */
enableActions?: boolean;
/** When false, the follower/following stats render as plain text (no
* click target) and the follow-list drawer isn't mounted — used on a
* blocked profile, where the lists endpoint is gated server-side. */
interactiveCounts?: boolean;
}) {
// Owner affordances ride on `editHref`; the follow-action row rides on
// `enableActions`. Mutually exclusive by construction.
@@ -128,12 +133,20 @@ export function ProfileHeader({
<Stat
n={followers}
label="followers"
onClick={() => setFollowList("followers")}
onClick={
interactiveCounts
? () => setFollowList("followers")
: undefined
}
/>
<Stat
n={following}
label="following"
onClick={() => setFollowList("following")}
onClick={
interactiveCounts
? () => setFollowList("following")
: undefined
}
/>
</>
) : null}
@@ -181,7 +194,7 @@ export function ProfileHeader({
onClose={() => setZoomOpen(false)}
/>
) : null}
{showCounts ? (
{showCounts && interactiveCounts ? (
<FollowListDrawer
open={followList !== null}
mode={followList ?? "followers"}