From 56dc1f2256290b6e5dab066a0c583c27d1dbb96e Mon Sep 17 00:00:00 2001 From: sebvtl728 Date: Sat, 18 Jan 2025 17:48:14 +0100 Subject: [PATCH] 404 --- frontend/src/components/CriticalAlert.css | 24 --------------- frontend/src/components/CriticalAlert.jsx | 2 +- frontend/src/components/Pages/NotFound.css | 35 ++++++++++++++++++++++ frontend/src/components/Pages/NotFound.jsx | 16 ++++++++++ frontend/src/main.jsx | 2 ++ 5 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 frontend/src/components/Pages/NotFound.css create mode 100644 frontend/src/components/Pages/NotFound.jsx diff --git a/frontend/src/components/CriticalAlert.css b/frontend/src/components/CriticalAlert.css index b9297b4..c95c391 100644 --- a/frontend/src/components/CriticalAlert.css +++ b/frontend/src/components/CriticalAlert.css @@ -19,27 +19,3 @@ box-shadow: 0 0 10px rgba(255, 0, 0, 0.8); } -.critical-alert-box h2 { - margin: 0; - color: red; -} - -.critical-alert-box p { - font-size: 18px; - font-weight: bold; -} - -/* Bandeau temporaire de test */ -.test-banner { - position: fixed; - top: 0; - left: 0; - width: 100%; - background-color: red; - color: white; - text-align: center; - padding: 10px; - font-size: 16px; - font-weight: bold; - z-index: 99999; -} \ No newline at end of file diff --git a/frontend/src/components/CriticalAlert.jsx b/frontend/src/components/CriticalAlert.jsx index 72bcf79..68f2d7c 100644 --- a/frontend/src/components/CriticalAlert.jsx +++ b/frontend/src/components/CriticalAlert.jsx @@ -17,7 +17,7 @@ const CriticalAlert = () => { // Disparition automatique de l'alerte après 2 secondes setTimeout(() => { setShowAlert(false); - }, 2000); + }, 1000); // Calcul du temps écoulé const startTimestamp = parseInt(startTime, 10); diff --git a/frontend/src/components/Pages/NotFound.css b/frontend/src/components/Pages/NotFound.css new file mode 100644 index 0000000..5ec1bea --- /dev/null +++ b/frontend/src/components/Pages/NotFound.css @@ -0,0 +1,35 @@ +.notfound-container { + text-align: center; + padding: 50px; +} + +.notfound-container h1 { + font-size: 100px; + color: red; + margin-bottom: 10px; +} + +.notfound-container h2 { + font-size: 30px; + margin-bottom: 10px; +} + +.notfound-container p { + font-size: 18px; + margin-bottom: 20px; +} + +.back-home { + display: inline-block; + padding: 10px 20px; + background-color: #007BFF; + color: white; + text-decoration: none; + border-radius: 5px; + font-size: 18px; + transition: background 0.3s ease; +} + +.back-home:hover { + background-color: #0056b3; +} \ No newline at end of file diff --git a/frontend/src/components/Pages/NotFound.jsx b/frontend/src/components/Pages/NotFound.jsx new file mode 100644 index 0000000..7f53c6c --- /dev/null +++ b/frontend/src/components/Pages/NotFound.jsx @@ -0,0 +1,16 @@ +import React from "react"; +import { Link } from "react-router-dom"; +import "./NotFound.css"; // Style dédié + +const NotFound = () => { + return ( +
+

404

+

Oups ! Page introuvable

+

Il semble que la page que vous recherchez n'existe pas.

+ Retour à l'accueil +
+ ); +}; + +export default NotFound; \ No newline at end of file diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index 975399f..4f7881f 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -8,6 +8,7 @@ import SimpleReactLightbox from "simple-react-lightbox"; import CriticalAlert from "./components/CriticalAlert"; import AdminDashboard from "./components/Pages/AdminDashboard"; import Backtime from "./components/Pages/Backtime"; +import NotFound from "./components/Pages/NotFound"; // Lazy loading des pages const Home = lazy(() => import('./components/Pages/Home.jsx')); @@ -43,6 +44,7 @@ function YourApp() { } /> } /> } /> + } />