changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'
|
||||
import Layout from './components/Layout.jsx'
|
||||
import ProtectedRoute from './components/ProtectedRoute.jsx'
|
||||
import Connexion from './pages/Connexion'
|
||||
import Inscription from './pages/Inscription'
|
||||
import Accueil from './pages/Accueil'
|
||||
@@ -11,6 +12,8 @@ import Admin from './pages/Admin'
|
||||
import Profile from './pages/Profile'
|
||||
import SaisirCodeUnique from './pages/SaisirCodeUnique.jsx'
|
||||
import Perdu from './pages/Perdu'
|
||||
import NotFound from './pages/NotFound'
|
||||
import Sitemap from './pages/Sitemap'
|
||||
import MentionsLegales from './pages/MentionsLegales'
|
||||
import Confidentialite from './pages/Confidentialite'
|
||||
import Contact from './pages/Contact.jsx'
|
||||
@@ -22,18 +25,53 @@ export default function App() {
|
||||
<Route path="/" element={<Navigate to="/connexion" replace />} />
|
||||
<Route path="/connexion" element={<Connexion />} />
|
||||
<Route path="/inscription" element={<Inscription />} />
|
||||
|
||||
{/* Pages publiques */}
|
||||
<Route path="/accueil" element={<Layout><Accueil /></Layout>} />
|
||||
<Route path="/regles-jeu" element={<Layout><ReglesJeu /></Layout>} />
|
||||
<Route path="/participation" element={<Layout><Participation /></Layout>} />
|
||||
<Route path="/mes-gains" element={<Layout><MesGains /></Layout>} />
|
||||
<Route path="/employe" element={<Layout><Employe /></Layout>} />
|
||||
<Route path="/admin" element={<Layout><Admin /></Layout>} />
|
||||
<Route path="/profile" element={<Layout><Profile /></Layout>} />
|
||||
<Route path="/saisir-code-unique" element={<Layout><SaisirCodeUnique /></Layout>} />
|
||||
<Route path="/perdu" element={<Layout><Perdu /></Layout>} />
|
||||
<Route path="/mentions-legales" element={<Layout><MentionsLegales /></Layout>} />
|
||||
<Route path="/confidentialite" element={<Layout><Confidentialite /></Layout>} />
|
||||
<Route path="/contact" element={<Layout><Contact /></Layout>} />
|
||||
<Route path="/sitemap" element={<Layout><Sitemap /></Layout>} />
|
||||
|
||||
{/* Pages CLIENT */}
|
||||
<Route path="/mes-gains" element={
|
||||
<ProtectedRoute roles={['CLIENT']}>
|
||||
<Layout><MesGains /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/saisir-code-unique" element={
|
||||
<ProtectedRoute roles={['CLIENT']}>
|
||||
<Layout><SaisirCodeUnique /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/profile" element={
|
||||
<ProtectedRoute roles={['CLIENT']}>
|
||||
<Layout><Profile /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/perdu" element={
|
||||
<ProtectedRoute roles={['CLIENT']}>
|
||||
<Layout><Perdu /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
|
||||
{/* Page EMPLOYEE */}
|
||||
<Route path="/employe" element={
|
||||
<ProtectedRoute roles={['EMPLOYEE']}>
|
||||
<Layout><Employe /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
|
||||
{/* Page ADMIN */}
|
||||
<Route path="/admin" element={
|
||||
<ProtectedRoute roles={['ADMIN']}>
|
||||
<Layout><Admin /></Layout>
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user