From a1b0e672387747085c85c6c446cea49f09af7719 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sat, 23 Aug 2025 08:49:46 +0700 Subject: Move stock position mobile --- .../product-detail/components/PriceAction.tsx | 43 ++++++++++++++++------ .../product-detail/components/ProductDetail.tsx | 7 ++-- 2 files changed, 34 insertions(+), 16 deletions(-) (limited to 'src-migrate/modules') diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index 850c2d9d..f5c2d7b3 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -17,7 +17,9 @@ type Props = { product: IProductDetail; }; -const PPN : number = process.env.NEXT_PUBLIC_PPN ? parseFloat(process.env.NEXT_PUBLIC_PPN) : 0; +const PPN: number = process.env.NEXT_PUBLIC_PPN + ? parseFloat(process.env.NEXT_PUBLIC_PPN) + : 0; const PriceAction = ({ product }: Props) => { const { activePrice, @@ -104,6 +106,21 @@ const PriceAction = ({ product }: Props) => { Termasuk PPN: Rp{' '} {formatCurrency(Math.round(activePrice.price_discount * PPN))} + {isMobile && ( +
+ + Stock : {sla?.qty}{' '} + + {/* + {' '} + */} +
+ )} )} @@ -149,19 +166,21 @@ const PriceAction = ({ product }: Props) => { -
- - Stock : {sla?.qty}{' '} - - {/* + {isDesktop && ( +
+ + Stock : {sla?.qty}{' '} + + {/* {' '} */} -
+
+ )}
{qtyPickUp > 0 && ( diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx index a6b4e6de..e6b77fb9 100644 --- a/src-migrate/modules/product-detail/components/ProductDetail.tsx +++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx @@ -72,9 +72,8 @@ const ProductDetail = ({ product }: Props) => { product?.variants?.find((variant) => variant.is_in_bu) || product?.variants?.[0]; setSelectedVariant(selectedVariant); - }, []); // eslint-disable-line react-hooks/exhaustive-deps + }, []); - // Gabungkan semua gambar produk (utama + tambahan) // Gabungkan semua gambar produk (utama + tambahan) const allImages = (() => { const arr: string[] = []; @@ -147,8 +146,8 @@ const ProductDetail = ({ product }: Props) => { className='flex overflow-x-auto snap-x snap-mandatory scroll-smooth no-scrollbar' style={{ scrollBehavior: 'smooth', - msOverflowStyle: 'none', // IE/Edge lama - scrollbarWidth: 'none', // Firefox + msOverflowStyle: 'none', + scrollbarWidth: 'none', }} > {allImages.length > 0 ? ( -- cgit v1.2.3