From 2b0db1fa312f8c96b2210a0db449d3317586e90a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 14 Mar 2024 12:49:46 -0500 Subject: [PATCH] Fix profile menu --- src/components/Menu/index.web.tsx | 2 +- src/view/com/profile/ProfileMenu.tsx | 56 ++++++++++++++++------------ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/components/Menu/index.web.tsx b/src/components/Menu/index.web.tsx index f4b03f680e..60b2342034 100644 --- a/src/components/Menu/index.web.tsx +++ b/src/components/Menu/index.web.tsx @@ -223,7 +223,7 @@ export function Item({children, label, onPress, ...rest}: ItemProps) { style={flatten([ a.flex_row, a.align_center, - a.gap_sm, + a.gap_lg, a.py_sm, a.rounded_xs, {minHeight: 32, paddingHorizontal: 10}, diff --git a/src/view/com/profile/ProfileMenu.tsx b/src/view/com/profile/ProfileMenu.tsx index e3e5709e73..f8b43d3de4 100644 --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -52,6 +52,10 @@ let ProfileMenu = ({ const reportDialogControl = useReportDialogControl() const queryClient = useQueryClient() const isSelf = currentAccount?.did === profile.did + const isFollowing = profile.viewer?.following + const isBlocked = profile.viewer?.blocking || profile.viewer?.blockedBy + const isFollowingBlockedAccount = isFollowing && isBlocked + const isLabelerAndNotBlocked = !!profile.associated?.labeler && !isBlocked const [queueMute, queueUnmute] = useProfileMuteMutationQueue(profile) const [queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile) @@ -208,22 +212,38 @@ let ProfileMenu = ({ + {hasSession && ( <> - {!!profile.associated?.labeler && - !(profile.viewer?.blocking || profile.viewer?.blockedBy) && ( - - - Follow Account - - - - )} + {!isSelf && ( + <> + {(isLabelerAndNotBlocked || isFollowingBlockedAccount) && ( + + + {isFollowing ? ( + Unfollow Account + ) : ( + Follow Account + )} + + + + )} + + )} {!isSelf && ( <> - {profile.viewer?.following && - (profile.viewer.blocking || profile.viewer.blockedBy) && ( - - - Unfollow Account - - - - )} {!profile.viewer?.blocking && !profile.viewer?.mutedByList && (