From 72e4f631a19c431e8fb75a4036c084aef5d36228 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Mon, 11 Apr 2022 00:50:25 +0430 Subject: [PATCH] reza added link to favorites --- .../Profile/components/ProfileBookmark/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/screens/Profile/components/ProfileBookmark/index.js b/src/screens/Profile/components/ProfileBookmark/index.js index 86082f6..0907a72 100644 --- a/src/screens/Profile/components/ProfileBookmark/index.js +++ b/src/screens/Profile/components/ProfileBookmark/index.js @@ -15,6 +15,7 @@ import React from "react"; import { connect } from "react-redux"; import Svg, { Path } from "react-native-svg"; import { userFavorite } from "../../../../redux/actions"; +import { useNavigation } from "@react-navigation/native"; //components import Navbar from "../../../../components/Navbar"; @@ -104,11 +105,15 @@ const ProfileBookmark = ({ }; const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => { - const colorScheme = Appearance.getColorScheme(); + const navigation = useNavigation(); + + const colorScheme = React.useMemo(() => { + return Appearance.getColorScheme(); + }, [bookmark]); const isContent = React.useMemo(() => { return bookmark?.content; - }); + }, [bookmark]); return ( { borderColor: Colors.theme1[colorScheme].greenCF, }, ]} + onPress={() => + navigation.navigate(isContent ? "Blog" : "Product", { + id: isContent ? bookmark?.id : bookmark?.id, + }) + } >