From 8e0c670ff6bac6af6a74cbf2b952b79233ee8e12 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Wed, 17 Feb 2021 17:26:52 -0800 Subject: displaying mutual friends only if they exist --- src/components/suggestedPeople/MutualFriends.tsx | 110 ++++++++++++----------- 1 file changed, 56 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/components/suggestedPeople/MutualFriends.tsx b/src/components/suggestedPeople/MutualFriends.tsx index 32efd4a0..d8b37bca 100644 --- a/src/components/suggestedPeople/MutualFriends.tsx +++ b/src/components/suggestedPeople/MutualFriends.tsx @@ -31,63 +31,65 @@ const MutualFriends: React.FC = () => { return ( <> - - - Mutual Friends - - {friendsPreview.map((profilePreview) => ( - - ))} - {friends && friends.length > 4 && ( - setDrawerVisible(true)}> - - + - {count} - - - )} - - - - - Mutual Friends - - {username} and you are both friends with - + {friends && friends.length > 0 && ( + + + Mutual Friends + + {friendsPreview.map((profilePreview) => ( + + ))} + {friends && friends.length > 4 && ( + setDrawerVisible(true)}> + + + + {count} - - - - {friends.map((profilePreview) => ( - - ))} - - - setDrawerVisible(false)}> - Cancel - - + )} + + + + + Mutual Friends + + {username} and you are both friends with + + + + + + {friends.map((profilePreview) => ( + + ))} + + + setDrawerVisible(false)}> + Cancel + + + + - - + + )} ); -- cgit v1.2.3-70-g09d2