From 7a0a0983dd986a2ad64e3cb0af683f458c46f0e2 Mon Sep 17 00:00:00 2001 From: Vassshhh Date: Thu, 31 Jul 2025 17:33:20 +0700 Subject: [PATCH] ok --- src/App.js | 2 +- src/components/Header.js | 10 +++------- src/components/ProductDetailPage.js | 8 ++++---- src/components/pages/ProductsPage.js | 12 ++++++------ 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/App.js b/src/App.js index f0ffaaa..0c1cf07 100644 --- a/src/App.js +++ b/src/App.js @@ -167,7 +167,7 @@ function App() { } /> } diff --git a/src/components/Header.js b/src/components/Header.js index 33736c1..083f4d7 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -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 { 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 }) => {

{product.name}

- {product.price === 0 - ? 'Free' + {product.price == null + ? 'Pay-As-You-Go' : `Rp ${parseInt(product.price).toLocaleString('id-ID')}`}
diff --git a/src/components/pages/ProductsPage.js b/src/components/pages/ProductsPage.js index d35250a..e54eea9 100644 --- a/src/components/pages/ProductsPage.js +++ b/src/components/pages/ProductsPage.js @@ -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)} >
- {product.price === 0 && ( + {product.price == 0 && ( Free )}
@@ -100,12 +100,12 @@ const CoursePage = () => {
- {product.price === 0 + {product.price == 0 ? 'Free' : `Rp ${product.price.toLocaleString('id-ID')}`}