From 7f501c19769ea39149fb3d0f6d45176d79a33b9a Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 8 Sep 2025 12:14:41 +0700 Subject: Move lihat keranjang button and hide scrollbar --- .../product-detail/components/AddToCart.tsx | 267 +++++++++++++++------ 1 file changed, 195 insertions(+), 72 deletions(-) diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx index ee7cb385..9664c33a 100644 --- a/src-migrate/modules/product-detail/components/AddToCart.tsx +++ b/src-migrate/modules/product-detail/components/AddToCart.tsx @@ -205,102 +205,225 @@ const AddToCart = ({ active={addCartAlert} close={() => setAddCartAlert(false)} > - {/* HEADER ITEM YANG DITAMBAHKAN */} -
-
- -
+ {/* ===== MOBILE LAYOUT: konten scroll + footer fixed di dalam popup ===== */} +
+ {/* area scroll */} +
+ {/* HEADER ITEM */} +
+
+ +
-
- {!!product.manufacture.name ? ( - + {!!product.manufacture.name ? ( + + {product.manufacture.name} + + ) : ( + '-' )} - className=' hover:underline' - color={'red'} - > - {product.manufacture.name} - - ) : ( - '-' - )} -

{product.name}

-

{product.code}

- - {!!product.lowest_price && product.lowest_price.price > 0 && ( - <> -
- {product.lowest_price.discount_percentage > 0 && ( - <> -
- {Math.floor(product.lowest_price.discount_percentage)}% -
-
- Rp {formatCurrency(product.lowest_price.price || 0)} +

{product.name}

+

{product.code}

+ + {!!product.lowest_price && product.lowest_price.price > 0 && ( + <> +
+ {product.lowest_price.discount_percentage > 0 && ( + <> +
+ {Math.floor( + product.lowest_price.discount_percentage + )} + % +
+
+ Rp {formatCurrency(product.lowest_price.price || 0)} +
+ + )} +
+ Rp{' '} + {formatCurrency( + product.lowest_price.price_discount || 0 + )}
- - )} -
- Rp{' '} - {formatCurrency(product.lowest_price.price_discount || 0)} -
-
- - )} +
+ + )} + + {!!product.lowest_price && product.lowest_price.price === 0 && ( + + Hubungi kami untuk dapatkan harga terbaik,{' '} + + klik disini + + + )} +
- {!!product.lowest_price && product.lowest_price.price === 0 && ( - - Hubungi kami untuk dapatkan harga terbaik,{' '} + {/* sembunyikan link header di mobile agar tidak dobel */} +
- klik disini + Lihat Keranjang - - )} +
+
+ + {/* PROMO KHUSUS MOBILE */} +
+ +
+ + {/* PRODUCT SIMILAR */} +
+
+ Kamu Mungkin Juga Suka +
+ + + + + + + + +
-
+ {/* footer tombol: selalu terlihat di bawah popup mobile */} +
- Lihat Keranjang + Cek Keranjang
- {/* === PROMO KHUSUS MOBILE (DI ATAS PRODUCT SIMILAR) === */} - + {/* ===== DESKTOP LAYOUT: tetap seperti semula ===== */} +
+ {/* HEADER ITEM */} +
+
+ +
+ +
+ {!!product.manufacture.name ? ( + + {product.manufacture.name} + + ) : ( + '-' + )} +

{product.name}

+

{product.code}

+ + {!!product.lowest_price && product.lowest_price.price > 0 && ( + <> +
+ {product.lowest_price.discount_percentage > 0 && ( + <> +
+ {Math.floor(product.lowest_price.discount_percentage)} + % +
+
+ Rp {formatCurrency(product.lowest_price.price || 0)} +
+ + )} +
+ Rp{' '} + {formatCurrency(product.lowest_price.price_discount || 0)} +
+
+ + )} + + {!!product.lowest_price && product.lowest_price.price === 0 && ( + + Hubungi kami untuk dapatkan harga terbaik,{' '} + + klik disini + + + )} +
+ +
+ + Lihat Keranjang + +
+
+ + {/* PROMO (desktop biarkan sama posisinya) */}
- - {/* PRODUCT SIMILAR: tetap seperti semula, muncul di mobile & desktop */} -
-
- Kamu Mungkin Juga Suka + {/* PRODUCT SIMILAR */} +
+
+ Kamu Mungkin Juga Suka +
+ + +
- - -
-- cgit v1.2.3