reza fixed add to cart button

master
Reza_ashrafi 3 years ago
parent e4e653118c
commit 86cde35622
  1. 23
      src/screens/Product/components/Book.js
  2. 64
      src/screens/Profile/components/List.js
  3. 4
      src/screens/Profile/components/ProfileAddress/index.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(

@ -121,38 +121,38 @@ const List = ({ mobile, theme }) => {
name: "کتابهای من",
onPress: () => navigation.push("AR"),
},
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
<G data-name="Group 2005">
<Path
d="M18.085 20.769H6.528c-3.467 0-5.778-2-5.778-6.673V7.423C.75 2.75 3.061.75 6.528.75h11.557c3.467 0 5.778 2 5.778 6.673v6.673c0 4.671-2.313 6.673-5.778 6.673Z"
fill="none"
stroke={
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
data-name="vuesax/linear/music-playlist"
/>
<Path
data-name="Vector"
d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z"
fill="none"
stroke={
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</G>
</Svg>
),
name: "دورههای ویدئویی",
onPress: () => navigation.push("MyCourses"),
},
// {
// icon: (
// <Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
// <G data-name="Group 2005">
// <Path
// d="M18.085 20.769H6.528c-3.467 0-5.778-2-5.778-6.673V7.423C.75 2.75 3.061.75 6.528.75h11.557c3.467 0 5.778 2 5.778 6.673v6.673c0 4.671-2.313 6.673-5.778 6.673Z"
// fill="none"
// stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// }
// strokeLinecap="round"
// strokeLinejoin="round"
// strokeWidth={1.5}
// data-name="vuesax/linear/music-playlist"
// />
// <Path
// data-name="Vector"
// d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z"
// fill="none"
// stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// }
// strokeLinecap="round"
// strokeLinejoin="round"
// strokeWidth={1.5}
// />
// </G>
// </Svg>
// ),
// name: "دورههای ویدئویی",
// onPress: () => navigation.push("MyCourses"),
// },
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.5} height={25.5}>

@ -310,7 +310,7 @@ const ProfileAddress = ({
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex: 1,
paddingBottom: 20,
paddingBottom : 20
}}
>
<Navbar
@ -405,7 +405,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(ProfileAddress);
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: height,
paddingBottom: 100,
position: "relative",
},
container: {

Loading…
Cancel
Save