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, + }) + } >