Admin : page admin + responsive + CookieBanner + Toast + BackToTop
Build & Deploy / build (push) Successful in 32s
Build & Deploy / build (push) Successful in 32s
This commit is contained in:
+11
-1
@@ -10,10 +10,14 @@ import AboutPage from "./pages/AboutPage";
|
||||
import ContactPage from "./pages/ContactPage";
|
||||
import CGU from "./pages/CGU";
|
||||
import MentionsLegales from "./pages/MentionsLegales";
|
||||
import Admin from "./pages/Admin";
|
||||
import AdminRoute from "./components/AdminRoute";
|
||||
|
||||
import Sidebar from "./components/Sidebar";
|
||||
import Footer from "./components/Footer";
|
||||
import CookieBanner from "./components/CookieBanner";
|
||||
import Toasts from "./components/Toast";
|
||||
import BackToTop from "./components/BackToTop";
|
||||
|
||||
import styles from "./App.module.css";
|
||||
|
||||
@@ -27,7 +31,8 @@ type NavItem =
|
||||
| "about"
|
||||
| "contact"
|
||||
| "cgu"
|
||||
| "mentions-legales";
|
||||
| "mentions-legales"
|
||||
| "admin";
|
||||
|
||||
interface User {
|
||||
id: number;
|
||||
@@ -96,6 +101,7 @@ export default function App() {
|
||||
: location.pathname === "/contact" ? "contact"
|
||||
: location.pathname === "/cgu" ? "cgu"
|
||||
: location.pathname === "/mentions-legales"? "mentions-legales"
|
||||
: location.pathname === "/admin"? "admin"
|
||||
: "home";
|
||||
|
||||
useEffect(() => {
|
||||
@@ -120,6 +126,7 @@ export default function App() {
|
||||
: item === "about" ? "/about"
|
||||
: item === "contact" ? "/contact"
|
||||
: item === "cgu" ? "/cgu"
|
||||
: item === 'admin' ? '/admin'
|
||||
: "/mentions-legales";
|
||||
navigate(path);
|
||||
};
|
||||
@@ -144,6 +151,7 @@ export default function App() {
|
||||
|
||||
return (
|
||||
<div className={styles.app}>
|
||||
<Toasts />
|
||||
<div className={styles.contentWrapper}>
|
||||
<Sidebar
|
||||
activeNav={activeNav}
|
||||
@@ -161,12 +169,14 @@ export default function App() {
|
||||
<Route path="/contact" element={<ContactPage />} />
|
||||
<Route path="/cgu" element={<CGU />} />
|
||||
<Route path="/mentions-legales" element={<MentionsLegales />} />
|
||||
<Route path="/admin" element={<AdminRoute user={authState.user}><Admin /></AdminRoute>} />
|
||||
<Route path="*" element={<Navigate to="/" />} />
|
||||
</Routes>
|
||||
</main>
|
||||
</div>
|
||||
<Footer onNavClick={handleNavClick} />
|
||||
<CookieBanner />
|
||||
<BackToTop />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user