2026-06-28 14:31:38 +02:00
|
|
|
|
import { Navigate, Route, Routes } from 'react-router'
|
|
|
|
|
|
import { RequireAuth, RequireGuest } from './auth/guards'
|
2026-06-28 02:22:07 +02:00
|
|
|
|
import AppLayout from './components/layout/AppLayout'
|
|
|
|
|
|
import Button from './components/ui/Button'
|
|
|
|
|
|
import DigitalProgressBar from './components/ui/DigitalProgressBar'
|
|
|
|
|
|
import Panel from './components/ui/Panel'
|
|
|
|
|
|
|
2026-06-28 14:31:38 +02:00
|
|
|
|
// Placeholder for the authenticated app home. The real scenario UI lands in the
|
|
|
|
|
|
// frontend feature tickets (#53–#56); for now it shows the primitives + theme.
|
|
|
|
|
|
function ScenariosPlaceholder() {
|
2026-06-28 02:16:41 +02:00
|
|
|
|
return (
|
2026-06-28 02:22:07 +02:00
|
|
|
|
<AppLayout>
|
|
|
|
|
|
<Panel className="mx-auto max-w-md space-y-4">
|
|
|
|
|
|
<h2 className="text-primary font-bold uppercase tracking-wider">
|
|
|
|
|
|
Emergency Fund
|
|
|
|
|
|
</h2>
|
|
|
|
|
|
<DigitalProgressBar current={750} capacity={1000} />
|
|
|
|
|
|
<p className="font-digital text-primary text-xl">$750 / $1000</p>
|
|
|
|
|
|
<Button glow>+ Add Bucket</Button>
|
|
|
|
|
|
</Panel>
|
|
|
|
|
|
</AppLayout>
|
2026-06-28 02:16:41 +02:00
|
|
|
|
)
|
2026-06-28 02:06:56 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-28 14:31:38 +02:00
|
|
|
|
// Placeholders replaced by the real auth screens in #52 Stories 4 (login) and 5
|
|
|
|
|
|
// (register).
|
|
|
|
|
|
function LoginPlaceholder() {
|
|
|
|
|
|
return <div>LOGIN</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function RegisterPlaceholder() {
|
|
|
|
|
|
return <div>REGISTER</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Routes>
|
|
|
|
|
|
{/* Guest-only routes (redirect to the app if already signed in). */}
|
|
|
|
|
|
<Route element={<RequireGuest />}>
|
|
|
|
|
|
<Route path="/login" element={<LoginPlaceholder />} />
|
|
|
|
|
|
<Route path="/register" element={<RegisterPlaceholder />} />
|
|
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Authenticated-only routes (redirect to /login if signed out). */}
|
|
|
|
|
|
<Route element={<RequireAuth />}>
|
|
|
|
|
|
<Route path="/" element={<ScenariosPlaceholder />} />
|
|
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Unknown paths fall back to the app root (which re-guards). */}
|
|
|
|
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
|
|
|
|
</Routes>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-28 02:06:56 +02:00
|
|
|
|
export default App
|