From 1841a2d178a332633470c4cda629a2600b3e7c3b Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 11 Apr 2023 14:56:42 +0700 Subject: layout popup add to cart --- .../product/components/Product/ProductDesktop.jsx | 58 +++++++++++----------- .../product/components/Product/ProductMobile.jsx | 57 ++++++++++----------- 2 files changed, 54 insertions(+), 61 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 0bff3ceb..bb2b2db9 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -321,38 +321,36 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { -
- setAddCartAlert(false)} - > -
-
- {product.name} -
-
- {product.name} -
-
- - Lihat Keranjang - -
+ + setAddCartAlert(false)} + > +
+
+ {product.name}
-
-
Kamu Mungkin Juga Suka
- - - +
{product.name}
+
+ + Lihat Keranjang +
- -
+
+ +
+
Kamu Mungkin Juga Suka
+ + + +
+
) diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 43ef0e5e..0a7d690a 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -89,7 +89,6 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { quantity, selected: true }) - // toast.success('Berhasil menambahkan ke keranjang') setAddCartAlert(true) } @@ -270,37 +269,33 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
-
- setAddCartAlert(false)} - > -
-
- {product.name} -
-
- {product.name} -
-
- - Lihat Keranjang - -
-
-
-
Kamu Mungkin Juga Suka
- - - -
-
+ setAddCartAlert(false)} + > +
+
+ {product.name} +
+
{product.name}
+
+ + Lihat Keranjang + +
+
+
+
Kamu Mungkin Juga Suka
+ + +
+
) } -- cgit v1.2.3 From fbf187e7a2db052bf4fe78cfdbcc7c1cfaa82d75 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 11 Apr 2023 15:00:03 +0700 Subject: fix cart bug --- src/lib/cart/components/Cart.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index d18b1a28..d0685fe3 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -329,7 +329,7 @@ const Cart = () => { Keranjang belanja anda masih kosong )} - {products?.map((product) => ( + {products && products?.map((product) => ( Date: Tue, 11 Apr 2023 15:26:24 +0700 Subject: fix product slider layout --- .../product/components/Product/ProductMobile.jsx | 2 +- src/lib/product/components/ProductSlider.jsx | 46 +++++++++++----------- 2 files changed, 25 insertions(+), 23 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 0a7d690a..b75a191b 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -290,7 +290,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
-
Kamu Mungkin Juga Suka
+
Kamu Mungkin Juga Suka
diff --git a/src/lib/product/components/ProductSlider.jsx b/src/lib/product/components/ProductSlider.jsx index c8bd3a82..931a8db7 100644 --- a/src/lib/product/components/ProductSlider.jsx +++ b/src/lib/product/components/ProductSlider.jsx @@ -12,7 +12,7 @@ const bannerClassName = const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) => { const bannerRef = useRef('') - const { isMobile } = useDevice() + const { isMobile, isDesktop } = useDevice() const changeBannerOpacity = (swiper) => { if (!bannerMode) return @@ -32,27 +32,29 @@ const ProductSlider = ({ products, simpleTitle = false, bannerMode = false }) => />
)} - - {bannerMode && ( - - - - )} - {products?.products?.map((product, index) => ( - - - - ))} - + {(isMobile || isDesktop) && ( + + {bannerMode && ( + + + + )} + {products?.products?.map((product, index) => ( + + + + ))} + + )} ) } -- cgit v1.2.3