diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index 8787661..b4ee2ef 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -55,32 +55,37 @@ function Book({ const physicalProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 2)[0]; - },[book]); + }, [book]); const digitalProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 1)[0]; - },[book]); + }, [book]); const videoProduct = React.useMemo(() => { return book?.product?.filter((product) => product?.productType === 4)[0]; - },[book]); + }, [book]); const physicalAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === physicalProduct?.id - )[0]; + (product) => + product?.productId === physicalProduct?.id && product?.condition < 2 + )?.length; }, [userProducts, book]); + console.log(physicalAvailabileInCart); + const digitalAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === digitalProduct?.id - )[0]; + (product) => + product?.productId === digitalProduct?.id && product?.condition < 2 + )?.length; }, [userProducts, book]); const videoAvailabileInCart = React.useMemo(() => { return userProducts?.filter( - (product) => product?.productId === videoProduct?.id - )[0]; + (product) => + product?.productId === videoProduct?.id && product?.condition < 2 + )?.length; }, [userProducts, book]); const addToCart = React.useCallback( diff --git a/src/screens/Profile/components/List.js b/src/screens/Profile/components/List.js index dc2062d..eee7600 100644 --- a/src/screens/Profile/components/List.js +++ b/src/screens/Profile/components/List.js @@ -121,38 +121,38 @@ const List = ({ mobile, theme }) => { name: "کتاب‌های من", onPress: () => navigation.push("AR"), }, - { - icon: ( - - - - - - - ), - name: "دوره‌های ویدئویی", - onPress: () => navigation.push("MyCourses"), - }, + // { + // icon: ( + // + // + // + // + // + // + // ), + // name: "دوره‌های ویدئویی", + // onPress: () => navigation.push("MyCourses"), + // }, { icon: ( diff --git a/src/screens/Profile/components/ProfileAddress/index.js b/src/screens/Profile/components/ProfileAddress/index.js index d71e807..64e99b9 100644 --- a/src/screens/Profile/components/ProfileAddress/index.js +++ b/src/screens/Profile/components/ProfileAddress/index.js @@ -310,7 +310,7 @@ const ProfileAddress = ({ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", flex: 1, - paddingBottom: 20, + paddingBottom : 20 }} >