From 4f7ef327e06cfba8e68f7e31f969ec15f8d3b375 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Tue, 28 Oct 2025 22:39:49 +0700 Subject: styling --- .../components/Product/ProductMobileVariant.jsx | 36 +++++++++++++--------- .../product/styles/desc_mobile_variant.module.css | 18 +++++++++++ 2 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 src/lib/product/styles/desc_mobile_variant.module.css (limited to 'src') diff --git a/src/lib/product/components/Product/ProductMobileVariant.jsx b/src/lib/product/components/Product/ProductMobileVariant.jsx index d3d22d80..1d461382 100644 --- a/src/lib/product/components/Product/ProductMobileVariant.jsx +++ b/src/lib/product/components/Product/ProductMobileVariant.jsx @@ -19,6 +19,7 @@ import whatsappUrl from '@/core/utils/whatsappUrl'; import { getAuth } from '~/libs/auth'; import SimilarBottom from '~/modules/product-detail/components/SimilarBottom'; import ProductSimilar from '../ProductSimilar'; +import styles from '../../styles/desc_mobile_variant.module.css'; const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { const router = useRouter(); @@ -175,12 +176,14 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { }; fetchData(); }, [product]); + console.log(product); + console.log(product.parent.description); return ( {/* PRICE & ACTIONS: tetap punyamu, hanya hapus input number lama */} {/* ===== BAR BAWAH (fixed) ===== */} -
+
{/* HARGA & PPN (logikamu tetap) */} {activeVariant.isFlashSale && activeVariant?.price?.discountPercentage > 0 ? ( @@ -196,7 +199,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { {currencyFormat(activeVariant?.price?.priceDiscount)}
-
+
Termasuk PPN:{' '} {currencyFormat( activeVariant?.price.priceDiscount * process.env.NEXT_PUBLIC_PPN @@ -204,11 +207,11 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
) : ( -
+
{activeVariant?.price?.price > 0 ? ( <> {currencyFormat(activeVariant?.price?.price)} -
+
Termasuk PPN:{' '} {currencyFormat( activeVariant?.price.price * process.env.NEXT_PUBLIC_PPN @@ -238,7 +241,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { )} {/* ⬇️ TAMBAHKAN BLOK INI DI DALAM BAR: STOK & STEPPER */} -
+
{ colorScheme='red' isDisabled={product.stock === 0} > - Beli + Beli Sekarang
@@ -491,11 +494,11 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { @@ -556,7 +559,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => { const informationTabOptions = [ { value: 'specification', label: 'Spesifikasi' }, - // { value: 'description', label: 'Deskripsi' }, + { value: 'description', label: 'Deskripsi' }, // { value: 'information', label: 'Info Penting' } ]; @@ -575,11 +578,14 @@ const TabButton = ({ children, active, ...props }) => { ); }; -const TabContent = ({ children, active, className, ...props }) => ( -
- {children} -
-); +const TabContent = ({ children, active, className = '', ...props }) => { + if (!active) return null; // <— jangan render kalau tidak aktif + return ( +
+ {children} +
+ ); +}; const SpecificationContent = ({ children, label }) => (
diff --git a/src/lib/product/styles/desc_mobile_variant.module.css b/src/lib/product/styles/desc_mobile_variant.module.css new file mode 100644 index 00000000..d2c86d77 --- /dev/null +++ b/src/lib/product/styles/desc_mobile_variant.module.css @@ -0,0 +1,18 @@ +.richtextHtml { + line-height: 1.7; + /* word-break: break-word; */ + overflow-x: auto; +} +.richtextHtml h1 { + font-weight: 600; + margin: 0.5rem 0; + font-size: clamp(1.5rem, 2.5vw, 2rem); + line-height: 1.25; +} +.richtextHtml table { + width: 100%; + max-width: 100%; + border-collapse: collapse; + table-layout: auto; + margin: 12px 0; +} -- cgit v1.2.3