From 21d6815de16b233a565f3b19790a73245532309e Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 8 Jun 2022 14:22:10 -0500 Subject: [PATCH] Don't show follow button for yourself --- web/components/follow-list.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/web/components/follow-list.tsx b/web/components/follow-list.tsx index 0eef1170..c935f73d 100644 --- a/web/components/follow-list.tsx +++ b/web/components/follow-list.tsx @@ -36,6 +36,7 @@ export function FollowList(props: { userIds: string[] }) { } onFollow={() => onFollow(userId)} onUnfollow={() => onUnfollow(userId)} + hideFollowButton={userId === currentUser?.id} /> ))} @@ -47,9 +48,17 @@ function UserFollowItem(props: { isFollowing: boolean onFollow: () => void onUnfollow: () => void + hideFollowButton?: boolean className?: string }) { - const { userId, isFollowing, onFollow, onUnfollow, className } = props + const { + userId, + isFollowing, + onFollow, + onUnfollow, + hideFollowButton, + className, + } = props const user = useUserById(userId) return ( @@ -58,11 +67,13 @@ function UserFollowItem(props: { {user && } - + {!hideFollowButton && ( + + )} ) }