reza added link to favorites

master
Reza_ashrafi 2 years ago
parent 600a46ed2a
commit 72e4f631a1
  1. 14
      src/screens/Profile/components/ProfileBookmark/index.js

@ -15,6 +15,7 @@ import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Svg, { Path } from "react-native-svg"; import Svg, { Path } from "react-native-svg";
import { userFavorite } from "../../../../redux/actions"; import { userFavorite } from "../../../../redux/actions";
import { useNavigation } from "@react-navigation/native";
//components //components
import Navbar from "../../../../components/Navbar"; import Navbar from "../../../../components/Navbar";
@ -104,11 +105,15 @@ const ProfileBookmark = ({
}; };
const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => { 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(() => { const isContent = React.useMemo(() => {
return bookmark?.content; return bookmark?.content;
}); }, [bookmark]);
return ( return (
<Pressable <Pressable
@ -119,6 +124,11 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => {
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[colorScheme].greenCF,
}, },
]} ]}
onPress={() =>
navigation.navigate(isContent ? "Blog" : "Product", {
id: isContent ? bookmark?.id : bookmark?.id,
})
}
> >
<View style={tw("flex flex-row-reverse items-end")}> <View style={tw("flex flex-row-reverse items-end")}>
<Image <Image

Loading…
Cancel
Save