This commit is contained in:
Vassshhh
2025-07-31 17:33:20 +07:00
parent 74fdca2007
commit 7a0a0983dd
4 changed files with 14 additions and 18 deletions

View File

@@ -167,7 +167,7 @@ function App() {
}
/>
<Route
path="/"
path="/products"
element={
<ProductsPage/>
}

View File

@@ -21,15 +21,11 @@ const Header = ({ username, scrollToProduct, scrollToCourse, setShowedModal }) =
onMouseEnter={() => setHoveredNav(2)}
onMouseLeave={() => setHoveredNav(null)}
onClick={() => {
if (username == null) {
scrollToProduct();
}
else {
navigate('/products');
}
navigate('/');
}}
>
PRODUCTS
HOME
</a>
<a
className={`${styles.navLink} ${hoveredNav === 3 ? styles.navLinkHover : ''}`}

View File

@@ -85,8 +85,8 @@ const ProductDetail = ({ product, setPostLoginAction, setShowedModal }) => {
return;
}
// Redirect dengan token dan itemsId di query
window.location.href = `http://localhost:3001/?token=${token}&itemsId=${itemsParam}&redirect_uri=http://localhost:3000/courses&redirect_failed=http://localhost:3000`;
// Redirect dengan token dan itemsId di query route ke checkout.kediritechnopark.com
window.location.href = `http://localhost:3002/?token=${token}&itemsId=${itemsParam}&redirect_uri=http://localhost:3000/products&redirect_failed=http://localhost:3000`;
};
@@ -100,8 +100,8 @@ const ProductDetail = ({ product, setPostLoginAction, setShowedModal }) => {
<div className={styles.headerRow}>
<h2 className={styles.title}>{product.name}</h2>
<div className={styles.price} style={{ color: priceColor }}>
{product.price === 0
? 'Free'
{product.price == null
? 'Pay-As-You-Go'
: `Rp ${parseInt(product.price).toLocaleString('id-ID')}`}
</div>
</div>

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import ProductDetailPage from './ProductDetailPage';
import Login from './Login';
import styles from './Styles.module.css';
import ProductDetailPage from '../ProductDetailPage';
import Login from '../Login';
import styles from '../Styles.module.css';
// Fungsi simple untuk parsing token JWT dan mengembalikan payload JSON
function parseJwt(token) {
@@ -90,7 +90,7 @@ const CoursePage = () => {
onMouseLeave={() => setHoveredCard(null)}
>
<div className={styles.courseImage}>
{product.price === 0 && (
{product.price == 0 && (
<span className={styles.courseLabel}>Free</span>
)}
</div>
@@ -100,12 +100,12 @@ const CoursePage = () => {
<div className={styles.coursePrice}>
<span
className={
product.price === 0
product.price == 0
? styles.freePrice
: styles.currentPrice
}
>
{product.price === 0
{product.price == 0
? 'Free'
: `Rp ${product.price.toLocaleString('id-ID')}`}
</span>