This commit is contained in:
Vassshhh
2025-08-12 02:31:50 +07:00
parent 82518c96aa
commit f577a23d10
2 changed files with 13 additions and 31 deletions

View File

@@ -10,7 +10,7 @@
} }
.image { .image {
width: 40vw; width: 100%;
height: 260px; height: 260px;
background-color: #e2e8f0; background-color: #e2e8f0;
border-radius: 0.75rem; border-radius: 0.75rem;
@@ -22,7 +22,7 @@
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: contain;
background-position: center; background-position: center;
} }
@@ -94,10 +94,6 @@
.buttonGroup { .buttonGroup {
gap: 0.5rem; gap: 0.5rem;
} }
.image {
width: 63vw;
}
} }
.childSelector { .childSelector {

View File

@@ -12,22 +12,6 @@ const ProductDetail = ({ subscriptions, product, requestLogin, setShowedModal })
const [showNamingInput, setShowNamingInput] = useState(false); const [showNamingInput, setShowNamingInput] = useState(false);
const [customName, setCustomName] = useState(''); 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 onCheckout = () => {
const tokenCookie = document.cookie.split('; ').find(row => row.startsWith('token=')); const tokenCookie = document.cookie.split('; ').find(row => row.startsWith('token='));
const token = tokenCookie ? tokenCookie.split('=')[1] : ''; const token = tokenCookie ? tokenCookie.split('=')[1] : '';
@@ -170,11 +154,13 @@ const ProductDetail = ({ subscriptions, product, requestLogin, setShowedModal })
className={`${styles.button} ${styles.checkoutButton}`} className={`${styles.button} ${styles.checkoutButton}`}
onClick={() => { onClick={() => {
const token = (document.cookie.split('; ').find(row => row.startsWith('token=')) || '').split('=')[1] || ''; 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; window.location.href = url;
}} }}
> >
KUNJUNGI PELAJARI LEBIH LANJUT
</button> </button>
)} )}