From 8ebfaf19640909c138c78f5c604c9f02fa83b308 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 7 Apr 2025 13:56:30 +0000 Subject: [PATCH] Paywall navigation and button added --- src/App.js | 38 ++++++++++++++++++++++++------------ src/components/Dashboard.js | 5 ++++- user_profile.db | Bin 57344 -> 57344 bytes 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/App.js b/src/App.js index ee6e42b..b417149 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,6 @@ -import React, { useState} from 'react'; -import { Routes, Route, Navigate } from 'react-router-dom'; +// App.js +import React, { useState } from 'react'; +import { Routes, Route, Navigate, useNavigate, useLocation } from 'react-router-dom'; import SessionExpiredHandler from './components/SessionExpiredHandler.js'; import GettingStarted from './components/GettingStarted.js'; import SignIn from './components/SignIn.js'; @@ -9,27 +10,39 @@ import Dashboard from './components/Dashboard.js'; import UserProfile from './components/UserProfile.js'; import FinancialProfileForm from './components/FinancialProfileForm.js'; import MilestoneTracker from "./components/MilestoneTracker.js"; +import Paywall from "./components/Paywall.js"; import './App.css'; function App() { - console.log("App rendered"); + const navigate = useNavigate(); + const location = useLocation(); - const [isAuthenticated, setIsAuthenticated] = useState(() => { - return !!localStorage.getItem('token'); // Check localStorage - }); + const [isAuthenticated, setIsAuthenticated] = useState(() => !!localStorage.getItem('token')); + + const premiumPaths = ['/milestone-tracker', '/paywall', '/financial-profile']; + + const showPremiumCTA = !premiumPaths.includes(location.pathname); return (
-

AptivaAI - Career Guidance Platform (beta)

- - {/* Redirect root to /signin */} - } /> +
+

AptivaAI - Career Guidance Platform (beta)

+ {showPremiumCTA && ( + + )} +
- {/* Public routes */} + + } /> } /> } /> + } /> - {/* Protected routes */} {isAuthenticated && ( <> } /> @@ -41,7 +54,6 @@ function App() { )} - {/* Catch-all for unknown routes */} } /> diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index b00a5fe..b0fc0a7 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -384,6 +384,7 @@ function Dashboard() { )}
+
Loading Chatbot...

)}
- + + +
vsWDI`kTL{vf$BH^mFL{R@{NJ-+h#$5mwc>ET#QZZlYiZlVr61vWMrOv fXTQp1+xrIW##ScgKs34Jej5izC!0tL!`~MGI)5kS delta 158 zcmZoTz}#?vd4e?K{)sZqjQckxq{v&E8X21!8=9CJ8XFoL8ylJ$niv|H8kray85@}Z zp`nS1i6M{!k~B5~0z*?1V-uiylg)qSIXAHUVBq_)Sy135pIQ?aV-tH5E2CVfC^Hin za4Iq}F&o=A8gekQGji&4FfuYSPrkEXWwP~s19l@TQv)j_v&lvG+t}DdQW*Ze0047e BCz=2N