From f0df1a21f6a53baa12a7e44300ac2035adeb7f53 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 4 Oct 2023 12:05:14 +0700 Subject: mobile version --- src/lib/cart/components/Cart.jsx | 30 +++++++++++++++---------- src/lib/checkout/components/Checkout.jsx | 35 +++++++++++++++++++----------- src/lib/variant/components/VariantCard.jsx | 2 +- 3 files changed, 41 insertions(+), 26 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index acd23af6..5716d01b 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -32,7 +32,7 @@ const Cart = () => { const [cart, setCart] = useState(null) - const {setRefreshCart} = useProductCartContext() + const { setRefreshCart } = useProductCartContext() useEffect(() => { if (!auth) return @@ -115,7 +115,7 @@ const Cart = () => { selected: true }).then(() => { getCart().then(() => { - if(promotionActiveId){ + if (promotionActiveId) { setPromotionType(false) } }) @@ -438,7 +438,7 @@ const Cart = () => { product.program.items && product.program.items.map((item) => (
- + { - {product?.hasFlashsale && ( -
-
- {currencyFormat(product?.price?.price)} + {product?.hasFlashsale ? ( + <> +
+
+ {currencyFormat(product?.price?.price)} +
+
+ {product?.price?.discountPercentage}% +
-
- {product?.price?.discountPercentage}% +
+ {currencyFormat(product?.price?.priceDiscount)}
+ + ) : ( +
+ {currencyFormat(product?.price?.price)}
)} -
- {currencyFormat(product?.price?.priceDiscount)} -
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 6d2f62e0..4739cd18 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -633,8 +633,11 @@ const Checkout = () => { Berakhir dalam{' '} {item.remainingTime} lagi,{' '}
-
handlingTnC(item)} > - Baca S&K +
handlingTnC(item)} + > + Baca S&K
@@ -1045,21 +1048,27 @@ const Checkout = () => { /> - {product?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.price?.price)} + {product?.hasFlashsale ? ( + <> +
+
+ {currencyFormat(product?.price?.price)} +
+
+ {product?.price?.discountPercentage}% +
-
- {product?.price?.discountPercentage}% +
+ {currencyFormat(product?.price?.priceDiscount)}
+ + ) : ( +
+ {product.price.priceDiscount > 0 + ? currencyFormat(product?.price?.priceDiscount) + : 'Call For Price'}
)} -
- {product.price.priceDiscount > 0 - ? currencyFormat(product?.price?.priceDiscount) - : 'Call For Price'} -
diff --git a/src/lib/variant/components/VariantCard.jsx b/src/lib/variant/components/VariantCard.jsx index 0f9f02f6..64b6d146 100644 --- a/src/lib/variant/components/VariantCard.jsx +++ b/src/lib/variant/components/VariantCard.jsx @@ -43,7 +43,7 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => { Berat Item : {product?.weight} Kg

- {product.price.discountPercentage > 0 && ( + {product.hasFlashsale && ( <>

{currencyFormat(product.price.price)} -- cgit v1.2.3