reza fixed strings on Cart

master
Reza_ashrafi 3 years ago
parent ed0b11f49b
commit 7aed7b068d
  1. 43
      src/screens/ShoppingCart/components/Product.js
  2. 6
      src/screens/ShoppingCart/index.js

@ -51,9 +51,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
]} ]}
/> />
<View <View
style={tw( style={tw(`flex ${ios ? "items-start pl-3" : "items-end pr-2"}`)}
`flex ${ios ? "items-start pl-3" : "items-end pr-2"}`
)}
> >
<Text <Text
style={{ style={{
@ -63,7 +61,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
fontFamily: "bold", fontFamily: "bold",
}} }}
> >
{product.product.book.name} {product?.product?.book?.name || " "}
</Text> </Text>
<Text <Text
style={{ style={{
@ -73,7 +71,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
fontFamily: "regular", fontFamily: "regular",
}} }}
> >
{"پایه" + " " + grades[product.product.book.gradeId]} {"پایه" + " " + grades[product?.product?.book?.gradeId] || " "}
</Text> </Text>
<Text <Text
style={{ style={{
@ -82,7 +80,7 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
fontFamily: "regular", fontFamily: "regular",
}} }}
> >
{product.productType === 2 ? "نسخه فیزیکی" : "نسخه دیجیتال"} {product?.productType || 1 === 2 ? "نسخه فیزیکی" : "نسخه دیجیتال"}
</Text> </Text>
<View <View
style={tw( style={tw(
@ -109,15 +107,13 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
}, },
]} ]}
> >
{separate(product?.product?.price)} {separate(product?.product?.price) || ' '}
</Text> </Text>
</View> </View>
</View> </View>
</View> </View>
<View <View
style={tw( style={tw(`flex justify-between ${ios ? "items-end" : "items-start"}`)}
`flex justify-between ${ios ? "items-end" : "items-start"}`
)}
> >
<AntDesign <AntDesign
name="close" name="close"
@ -151,7 +147,9 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
} }
style={[ style={[
tw( tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${mobile ? 'px-2' : "px-3"}` `rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2" : "px-3"
}`
), ),
{ {
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[colorScheme].greenCF,
@ -199,7 +197,9 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
} }
style={[ style={[
tw( tw(
`rounded-md py-0 flex flex-row justify-center items-center border ${mobile ? 'px-2.5' : 'px-3.5'}` `rounded-md py-0 flex flex-row justify-center items-center border ${
mobile ? "px-2.5" : "px-3.5"
}`
), ),
{ {
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[colorScheme].greenCF,
@ -217,12 +217,25 @@ function Product({ product, grades, pushToCart, loading, mobile }) {
</Text> </Text>
</Pressable> </Pressable>
</View> </View>
<View style={tw(`flex items-center justify-center ${ios ? "flex-row-reverse" : "flex-row"}`)}> <View
style={tw(
`flex items-center justify-center ${
ios ? "flex-row-reverse" : "flex-row"
}`
)}
>
<Text style={[{ fontSize: fontSize.sm, fontFamily: "regular" }]}> <Text style={[{ fontSize: fontSize.sm, fontFamily: "regular" }]}>
{" " + "تومان"} {" " + "تومان"}
</Text> </Text>
<Text style={[{ fontSize: mobile ? fontSize.xl : fontSize.xl4, fontFamily: "regular" }]}> <Text
{separate(product.product.price * product.count)} style={[
{
fontSize: mobile ? fontSize.xl : fontSize.xl4,
fontFamily: "regular",
},
]}
>
{separate(product?.product?.price * product?.count) || ' '}
</Text> </Text>
</View> </View>
</View> </View>

@ -157,18 +157,18 @@ function ShoppingCart({
> >
<PriceStatus <PriceStatus
name="مبلغ سبد خرید" name="مبلغ سبد خرید"
value={isEmpty ? 0 : separate(Math.round(factorInfo?.sumPrice))} value={isEmpty ? 0 : separate(Math.round(factorInfo?.sumPrice || 0))}
type="normal" type="normal"
/> />
<PriceStatus <PriceStatus
name="میزان تخفیف" name="میزان تخفیف"
value={isEmpty ? 0 : separate(Math.round(factorInfo?.offPrice))} value={isEmpty ? 0 : separate(Math.round(factorInfo?.offPrice || 0))}
type="error" type="error"
/> />
<PriceStatus <PriceStatus
name="مالیات بر ارزش افزوده" name="مالیات بر ارزش افزوده"
value={ value={
isEmpty ? 0 : separate(Math.round(factorInfo?.sumPrice * 0.009)) isEmpty ? 0 : separate(Math.round((factorInfo?.sumPrice || 0) * 0.009))
} }
type="error" type="error"
/> />

Loading…
Cancel
Save