ok
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 40vw;
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
background-color: #e2e8f0;
|
||||
border-radius: 0.75rem;
|
||||
@@ -22,7 +22,7 @@
|
||||
margin-bottom: 1.5rem;
|
||||
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
@@ -94,10 +94,6 @@
|
||||
.buttonGroup {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 63vw;
|
||||
}
|
||||
}
|
||||
|
||||
.childSelector {
|
||||
|
||||
@@ -12,22 +12,6 @@ const ProductDetail = ({ subscriptions, product, requestLogin, setShowedModal })
|
||||
const [showNamingInput, setShowNamingInput] = useState(false);
|
||||
const [customName, setCustomName] = useState('');
|
||||
|
||||
const parseJWT = (token) => {
|
||||
try {
|
||||
const base64Url = token.split('.')[1];
|
||||
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
||||
const jsonPayload = decodeURIComponent(
|
||||
atob(base64)
|
||||
.split('')
|
||||
.map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
|
||||
.join('')
|
||||
);
|
||||
return JSON.parse(jsonPayload);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const onCheckout = () => {
|
||||
const tokenCookie = document.cookie.split('; ').find(row => row.startsWith('token='));
|
||||
const token = tokenCookie ? tokenCookie.split('=')[1] : '';
|
||||
@@ -170,11 +154,13 @@ const ProductDetail = ({ subscriptions, product, requestLogin, setShowedModal })
|
||||
className={`${styles.button} ${styles.checkoutButton}`}
|
||||
onClick={() => {
|
||||
const token = (document.cookie.split('; ').find(row => row.startsWith('token=')) || '').split('=')[1] || '';
|
||||
const url = `https://${product.site_url}/dashboard/${product.name.split('%%%')[0]}?token=${token}`;
|
||||
const url = product.end_date
|
||||
? `https://${product.site_url}/dashboard/${product.name.split('%%%')[0]}?token=${token}`
|
||||
: `https://${product.site_url}`;
|
||||
window.location.href = url;
|
||||
}}
|
||||
>
|
||||
KUNJUNGI
|
||||
PELAJARI LEBIH LANJUT
|
||||
</button>
|
||||
)}
|
||||
|
||||
@@ -293,7 +279,7 @@ const ProductDetail = ({ subscriptions, product, requestLogin, setShowedModal })
|
||||
subscriptions.some(sub =>
|
||||
String(sub.product_id) === String(product.id) || String(sub.product_parent_id) === String(product.id)
|
||||
);
|
||||
if(hasMatchingSubscription) setShowSubscriptionSelector(true);
|
||||
if (hasMatchingSubscription) setShowSubscriptionSelector(true);
|
||||
}}
|
||||
>
|
||||
Kembali
|
||||
|
||||
Reference in New Issue
Block a user