diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index 9acb663..8787661 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -55,31 +55,31 @@ function Book({ const physicalProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 2)[0]; - }); + },[book]); const digitalProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 1)[0]; - }); + },[book]); const videoProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 4)[0]; - }); + },[book]); const physicalAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === book?.product[1]?.id + (product) => product?.productId === physicalProduct?.id )[0]; }, [userProducts, book]); const digitalAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === book?.product[0]?.id + (product) => product?.productId === digitalProduct?.id )[0]; }, [userProducts, book]); const videoAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === book?.product[2]?.id + (product) => product?.productId === videoProduct?.id )[0]; }, [userProducts, book]); @@ -131,9 +131,9 @@ function Book({ }, [userProducts]); return ( - + {!mobile ? : null} - {imageSlider ? : null} + {/* {imageSlider ? : null} */} - {book?.text ? ( - navigation.push("Info", { - type: { name: "توضیحات", value: "productDescription" }, - data : book?.text - }) - } - /> + title="توضیحات" + key={"4"} + onPress={() => + navigation.push("Info", { + type: { name: "توضیحات", value: "productDescription" }, + data: book?.text, + }) + } + /> ) : null} navigation.push("Info", { type: { name: "پرسش و پاسخ", value: "productQuestion" }, - data: [] + data: [], }) } /> @@ -671,7 +670,7 @@ function Book({ /> ) : null} - + ); } diff --git a/src/screens/Product/components/Rates.js b/src/screens/Product/components/Rates.js index 1eba865..83ca47f 100644 --- a/src/screens/Product/components/Rates.js +++ b/src/screens/Product/components/Rates.js @@ -43,7 +43,7 @@ function Rates({ rate, productId, addVote, isBuyed = null, theme }) { tintColor={ theme === "light" ? Colors.theme1.white : Colors.theme1.dark } - value={4} + startingValue={rate} onFinishRating={(rating) => addVote({ productId, vote: rating })} readonly={!isBuyed} /> diff --git a/src/screens/Product/index.js b/src/screens/Product/index.js index 134d1f9..b32767a 100644 --- a/src/screens/Product/index.js +++ b/src/screens/Product/index.js @@ -6,6 +6,7 @@ import { ScrollView, SafeAreaView, StatusBar, + KeyboardAvoidingView, } from "react-native"; import Book from "./components/Book"; import { book } from "../../redux/actions"; @@ -22,6 +23,7 @@ function Product({ route, book, getBook, grades }) { style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", + flex: 1, }} >