Skip to content

Commit

Permalink
Added Likes Screen to view Users that liked a Post
Browse files Browse the repository at this point in the history
  • Loading branch information
NiketanG committed Apr 23, 2021
1 parent 9d2e5e8 commit 3a5b3db
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/Screens/Likes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Props = {

type LikeListItemProps = {
item: Like;
openProfile: (username: string) => void;
openProfile: (username: string, profilePic?: string) => void;
};

const LikeListItem: React.FC<LikeListItemProps> = ({ item, openProfile }) => {
Expand All @@ -39,7 +39,7 @@ const LikeListItem: React.FC<LikeListItemProps> = ({ item, openProfile }) => {
alignItems: "center",
margin: 16,
}}
onPress={() => openProfile(item.user)}
onPress={() => openProfile(item.user, user?.profilePic)}
>
<UserAvatar size={32} profilePicture={user?.profilePic} />
<View
Expand Down Expand Up @@ -80,7 +80,16 @@ const Likes: React.FC<Props> = ({ 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 (
<View
Expand Down

0 comments on commit 3a5b3db

Please sign in to comment.