From 82518c96aa98f6ab948554e8d5702df59ea31fb8 Mon Sep 17 00:00:00 2001 From: Vassshhh Date: Mon, 11 Aug 2025 16:38:35 +0700 Subject: [PATCH] ok --- src/App.js | 42 ++- src/components/AboutUsSection.js | 4 +- src/components/AcademySection.js | 81 +++--- src/components/ClientsSection.js | 32 ++- src/components/CreateProductPage.js | 239 ++++++++++++++++ src/components/Dashboard.js | 363 +++++-------------------- src/components/Dashboard.module.css | 10 + src/components/Footer.js | 40 +-- src/components/Header.js | 13 +- src/components/HeroSection.js | 35 ++- src/components/HeroSection.module.css | 109 ++++++++ src/components/KnowledgeBaseSection.js | 6 +- src/components/Login.js | 4 +- src/components/ProductDetailPage.js | 25 +- src/components/ProductSection.js | 6 +- src/components/ServicesSection.js | 2 +- src/components/Styles.module.css | 38 ++- src/components/pages/ProductsPage.js | 4 +- 18 files changed, 636 insertions(+), 417 deletions(-) create mode 100644 src/components/CreateProductPage.js create mode 100644 src/components/HeroSection.module.css diff --git a/src/App.js b/src/App.js index 013bdd8..91847a1 100644 --- a/src/App.js +++ b/src/App.js @@ -14,6 +14,7 @@ import ClientsSection from './components/ClientsSection'; import Footer from './components/Footer'; import ProductDetailPage from './components/ProductDetailPage'; import Dashboard from './components/Dashboard'; +import CreateProductPage from './components/CreateProductPage'; import ProductsPage from './components/pages/ProductsPage'; import processProducts from './helper/processProducts'; @@ -31,6 +32,8 @@ function HomePage({ return ( <> + + - @@ -75,6 +77,7 @@ function App() { const [subscriptions, setSubscriptions] = useState(null); const [selectedProduct, setSelectedProduct] = useState({}); const [showedModal, setShowedModal] = useState(null); + const [subProductOf, setSubProductOf] = useState(null); const [username, setUsername] = useState(null); const productSectionRef = useRef(null); @@ -103,7 +106,7 @@ function App() { const match = document.cookie.match(new RegExp('(^| )token=([^;]+)')); if (match) { const token = match[2]; - fetch('https://bot.kediritechnopark.com/webhook/user-dev/data', { + fetch('https://bot.kediritechnopark.com/webhook/user-production/data', { method: 'GET', headers: { 'Content-Type': 'application/json', @@ -121,7 +124,11 @@ function App() { } } }) - .catch(err => console.error('Fetch error:', err)); + .catch(err => { + document.cookie = 'token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC'; + setUsername(null); + window.location.reload(); + }); } }, []); @@ -147,7 +154,7 @@ function App() { // Jika sudah login, tidak langsung fetch di sini — akan diproses saat subscriptions tersedia } }, []); - + useEffect(() => { const params = new URLSearchParams(window.location.search); const modalType = params.get('modal'); @@ -193,7 +200,7 @@ function App() { } else {// Assuming you already imported processProducts from './processProducts' - fetch('https://bot.kediritechnopark.com/webhook/store-dev/products', { + fetch('https://bot.kediritechnopark.com/webhook/store-production/products', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -220,7 +227,7 @@ function App() { window.location.href = decodeURIComponent(unauthorizedUri); } else { - fetch('https://bot.kediritechnopark.com/webhook/store-dev/products', { + fetch('https://bot.kediritechnopark.com/webhook/store-production/products', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -241,7 +248,7 @@ function App() { } }) .catch(err => console.error('Fetch product error:', err)); - + console.log('modal') } } @@ -304,7 +311,17 @@ function App() { } /> } /> - } /> + { + setShowedModal(e); + setSubProductOf(productId); + }} + /> + } + />