feat(app): câbler router Sprint 1 — login/register/dashboard + redirect / (étape 4)
This commit is contained in:
parent
464eb27f1e
commit
d0f77e04f9
1 changed files with 27 additions and 11 deletions
|
|
@ -1,14 +1,39 @@
|
||||||
import React, { Suspense } from 'react'
|
import React, { Suspense } from 'react'
|
||||||
import { Routes, Route } from 'react-router-dom'
|
import { Navigate, Routes, Route } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { LoginPage } from '@/features/auth/pages/LoginPage'
|
||||||
|
import { RegisterPage } from '@/features/auth/pages/RegisterPage'
|
||||||
|
import { ProtectedRoute } from '@/features/auth/components/ProtectedRoute'
|
||||||
|
|
||||||
const DesignSystemPage = import.meta.env.DEV
|
const DesignSystemPage = import.meta.env.DEV
|
||||||
? React.lazy(() => import('@/features/design-system/DesignSystemPage'))
|
? React.lazy(() => import('@/features/design-system/DesignSystemPage'))
|
||||||
: () => null
|
: () => null
|
||||||
|
|
||||||
|
function DashboardStub() {
|
||||||
|
return (
|
||||||
|
<main className="min-h-screen bg-canvas p-6">
|
||||||
|
<h1 className="text-2xl font-semibold text-ink-1">Dashboard — stub</h1>
|
||||||
|
<p className="mt-2 text-sm text-ink-3">
|
||||||
|
Cette vue sera remplacée par DashboardPage au prochain lot du Sprint 1.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export function AppRouter() {
|
export function AppRouter() {
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<ScaffoldPlaceholder />} />
|
<Route path="/" element={<Navigate to="/dashboard" replace />} />
|
||||||
|
<Route path="/login" element={<LoginPage />} />
|
||||||
|
<Route path="/register" element={<RegisterPage />} />
|
||||||
|
<Route
|
||||||
|
path="/dashboard"
|
||||||
|
element={
|
||||||
|
<ProtectedRoute>
|
||||||
|
<DashboardStub />
|
||||||
|
</ProtectedRoute>
|
||||||
|
}
|
||||||
|
/>
|
||||||
{import.meta.env.DEV && (
|
{import.meta.env.DEV && (
|
||||||
<Route
|
<Route
|
||||||
path="/design-system"
|
path="/design-system"
|
||||||
|
|
@ -22,12 +47,3 @@ export function AppRouter() {
|
||||||
</Routes>
|
</Routes>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function ScaffoldPlaceholder() {
|
|
||||||
return (
|
|
||||||
<main className="p-6">
|
|
||||||
<h1 className="text-2xl font-semibold">Expria — scaffold Sprint 0</h1>
|
|
||||||
<p>Aucune feature n'est encore branchée. Les routes seront ajoutées au fil des sprints.</p>
|
|
||||||
</main>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue