Skip to content

Commit

Permalink
Change follow list item order (#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinnnnn authored Sep 13, 2023
1 parent 5928e5a commit c949af2
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions apps/mobile/src/components/Feed/Posts/PostBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ function PostBottomSheet(
}
}, [followUser, unfollowUser, isFollowing, userToFollow.dbid]);

const followUserText = useMemo(() => {
if (isFollowing) {
return `Unfollow ${username}`;
} else {
return `Follow ${username}`;
}
}, [isFollowing, username]);

const media = getVideoOrImageUrlForNftPreview({
tokenRef: token,
preferStillFrameFromGif: true,
Expand All @@ -156,29 +148,41 @@ function PostBottomSheet(
}, [token]);

const inner = useMemo(() => {
if (isOwnPost)
if (isOwnPost) {
return (
<>
<BottomSheetRow text="Share" onPress={handleShare} />
<BottomSheetRow text="View item detail" onPress={handleViewNftDetail} />
<BottomSheetRow text="Delete" isConfirmationRow onPress={handleDeletePost} />
</>
);
}

if (isFollowing) {
return (
<>
<BottomSheetRow text="Share" onPress={handleShare} />
<BottomSheetRow text="View item detail" onPress={handleViewNftDetail} />
<BottomSheetRow text={`Unfollow ${username}`} onPress={handleFollowUser} />
</>
);
}

return (
<>
<BottomSheetRow text="Share" onPress={handleShare} />
<BottomSheetRow text={followUserText} onPress={handleFollowUser} />
<BottomSheetRow text={`Follow ${username}`} onPress={handleFollowUser} />
<BottomSheetRow text="View item detail" onPress={handleViewNftDetail} />
</>
);
}, [
followUserText,
handleDeletePost,
handleFollowUser,
handleShare,
handleViewNftDetail,
isFollowing,
isOwnPost,
username,
]);

return (
Expand Down

0 comments on commit c949af2

Please sign in to comment.