summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/ProductDetail.tsx
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2025-03-27 14:44:54 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2025-03-27 14:44:54 +0700
commit969e193708e01ffb88c0d81d72d63dad200e0ef8 (patch)
tree59c44292727bdfecb2970cb1d8130c53c0075653 /src-migrate/modules/product-detail/components/ProductDetail.tsx
parentf88f457fd1b91298ea8a7f9f396e49660a81e276 (diff)
parentd64f70fbc89e2cea6cbd95f5c3e3af437a3c2810 (diff)
Merge branch 'new-release' into feature/integrasi_biteship
# Conflicts: # src/lib/address/components/EditAddress.jsx
Diffstat (limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/ProductDetail.tsx34
1 files changed, 23 insertions, 11 deletions
diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx
index b036cc2d..4667e086 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -66,7 +66,11 @@ const ProductDetail = ({ product }: Props) => {
if (typeof auth === 'object') {
setIsApproval(auth?.feature?.soApproval);
}
- setSelectedVariant(product?.variants[0])
+ const selectedVariant =
+ product?.variants?.find((variant) => variant.is_in_bu) ||
+ product?.variants?.[0];
+ setSelectedVariant(selectedVariant);
+ // setSelectedVariant(product?.variants[0])
}, []);
return (
@@ -102,7 +106,12 @@ const ProductDetail = ({ product }: Props) => {
)}
<div className='h-4 md:h-10' />
- {!!activeVariantId && !isApproval && <ProductPromoSection product={product} productId={activeVariantId} />}
+ {!!activeVariantId && !isApproval && (
+ <ProductPromoSection
+ product={product}
+ productId={activeVariantId}
+ />
+ )}
{/* <div className={style['section-card']}>
<h2 className={style['heading']}>
@@ -117,15 +126,18 @@ const ProductDetail = ({ product }: Props) => {
<div className={style['section-card']}>
<h2 className={style['heading']}>Informasi Produk</h2>
<div className='h-4' />
- <div
- className={style['description']}
- dangerouslySetInnerHTML={{
- __html:
- !product.description || product.description == '<p><br></p>'
- ? 'Belum ada deskripsi'
- : product.description,
- }}
- />
+ <div className='overflow-x-auto'>
+ <div
+ className={style['description']}
+ dangerouslySetInnerHTML={{
+ __html:
+ !product.description ||
+ product.description == '<p><br></p>'
+ ? 'Belum ada deskripsi'
+ : product.description,
+ }}
+ />
+ </div>
</div>
</div>
</div>