+ {/* Default view */}
{!showChildSelector && !showSubscriptionSelector && !showNamingInput && (
<>
@@ -184,11 +169,11 @@ const ProductDetail = ({ willDo, setWillDo, subscriptions, product, requestLogin
sub.product_id === product.id || sub.product_parent_id === product.id
) && product.end_date ? 'Perpanjang' : 'Checkout'}
-
>
)}
+ {/* Child selector */}
{showChildSelector && (
Pilih Paket
@@ -198,25 +183,16 @@ const ProductDetail = ({ willDo, setWillDo, subscriptions, product, requestLogin
type="radio"
value={child.id}
checked={selectedChildIds.includes(child.id)}
- onChange={e => {
- const checked = e.target.checked;
- setSelectedChildIds(prev =>
- checked ? [...prev, child.id] : prev.filter(id => id !== child.id)
- );
- }}
+ onChange={() => setSelectedChildIds([child.id])}
/>
-
- {child.name}
+
{child.name}
+
Rp {parseInt(child.price || 0).toLocaleString('id-ID')}
-
- Rp {parseInt(child.price || 0).toLocaleString('id-ID')}
-
-
))}
-
)}
+ {/* Subscription selector */}
{showSubscriptionSelector && !showNamingInput && (
Kamu sudah punya produk ini
-
{setShowedModal('');navigate('/dashboard')}}>
+
{ setShowedModal(''); navigate('/dashboard') }}>
Atau
-
);
};
diff --git a/src/components/ProductSection.module.css b/src/components/ProductSection.module.css
index 7a45caa..b6e842a 100644
--- a/src/components/ProductSection.module.css
+++ b/src/components/ProductSection.module.css
@@ -91,7 +91,6 @@
.carouselContainer {
position: relative;
margin: 0 auto;
- padding: 0 56px;
min-height: 380px; /* compact */
}
@@ -133,7 +132,6 @@
}
.carouselContainer {
- padding: 0 60px;
min-height: 420px;
}
@@ -167,7 +165,6 @@
}
.carouselContainer {
- padding: 0 50px;
min-height: 400px;
}
@@ -210,7 +207,6 @@
}
.carouselContainer {
- padding: 0 40px;
min-height: 370px;
}
@@ -253,7 +249,6 @@
}
.carouselContainer {
- padding: 0 30px;
min-height: 320px;
}
@@ -296,7 +291,6 @@
}
.carouselContainer {
- padding: 0 25px;
min-height: 300px;
}