From 79d8c5fd8bab260676694a79cb8bdf4fcf76d3c5 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sun, 7 Sep 2025 10:33:08 +0700 Subject: Initial Commit --- .../product-detail/components/AddToCart.tsx | 56 ++++++++++++++-------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx index 1cb58a75..ee7cb385 100644 --- a/src-migrate/modules/product-detail/components/AddToCart.tsx +++ b/src-migrate/modules/product-detail/components/AddToCart.tsx @@ -20,6 +20,7 @@ import axios from 'axios'; import useDevice from '@/core/hooks/useDevice'; import MobileView from '@/core/components/views/MobileView'; import DesktopView from '@/core/components/views/DesktopView'; +import ProductPromoSection from '~/modules/product-promo/components/Section'; type Props = { variantId: number | null; quantity?: number; @@ -177,33 +178,34 @@ const AddToCart = ({ return (
- + + - + + { - setAddCartAlert(false); - }} + close={() => setAddCartAlert(false)} > + {/* HEADER ITEM YANG DITAMBAHKAN */}
+
{!!product.manufacture.name ? ( {product.name}

{product.code}

+ {!!product.lowest_price && product.lowest_price.price > 0 && ( <>
@@ -267,6 +271,7 @@ const AddToCart = ({ )}
+
+ + {/* === PROMO KHUSUS MOBILE (DI ATAS PRODUCT SIMILAR) === */} + +
+ +
+
+ + {/* PRODUCT SIMILAR: tetap seperti semula, muncul di mobile & desktop */}
Kamu Mungkin Juga Suka -- cgit v1.2.3 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 From a65744437ce3618282456cb63ff8f4bad7b1cec4 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 8 Sep 2025 12:46:12 +0700 Subject: fix button and image size mobile --- src-migrate/modules/product-detail/components/AddToCart.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx index 9664c33a..147fd6d2 100644 --- a/src-migrate/modules/product-detail/components/AddToCart.tsx +++ b/src-migrate/modules/product-detail/components/AddToCart.tsx @@ -211,7 +211,7 @@ const AddToCart = ({
{/* HEADER ITEM */}
-
+
- Cek Keranjang + Lihat Keranjang
-- cgit v1.2.3