From 3a5b3db60d9b3eb89f3c493aac0276df68c8ab88 Mon Sep 17 00:00:00 2001 From: NiketanG Date: Fri, 23 Apr 2021 14:56:44 +0530 Subject: [PATCH] Added Likes Screen to view Users that liked a Post --- src/app/Screens/Likes/index.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/Screens/Likes/index.tsx b/src/app/Screens/Likes/index.tsx index bd3d96f..2ad0e8a 100644 --- a/src/app/Screens/Likes/index.tsx +++ b/src/app/Screens/Likes/index.tsx @@ -25,7 +25,7 @@ type Props = { type LikeListItemProps = { item: Like; - openProfile: (username: string) => void; + openProfile: (username: string, profilePic?: string) => void; }; const LikeListItem: React.FC = ({ item, openProfile }) => { @@ -39,7 +39,7 @@ const LikeListItem: React.FC = ({ item, openProfile }) => { alignItems: "center", margin: 16, }} - onPress={() => openProfile(item.user)} + onPress={() => openProfile(item.user, user?.profilePic)} > = ({ route, navigation }) => { }, [likes, searchTerm]); const { height } = useWindowDimensions(); - const openProfile = () => {}; + const goBack = () => navigation.goBack(); + + const openProfile = (username: string, profilePic?: string) => { + navigation.navigate("Profile", { + username, + profilePic, + showBackArrow: true, + goBack, + }); + }; return (