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 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 (
<Pressable
@ -119,6 +124,11 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => {
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")}>
<Image

Loading…
Cancel
Save