diff --git a/src/layout.jsx b/src/layout.jsx index 4fa0991..313b6ae 100644 --- a/src/layout.jsx +++ b/src/layout.jsx @@ -9,11 +9,11 @@ import { AuthContext } from "./contexts/auth/AuthContext.js"; function Layout(){ - const { user, loading } = useContext(AuthContext); + /*const { user, loading } = useContext(AuthContext); if (loading) return

Loading

; if (!user) return ; - if(user && user.validate === 0) return ; + if(user && user.validate === 0) return ;*/ return (
diff --git a/src/pages/eventDetail/eventDetail.jsx b/src/pages/eventDetail/eventDetail.jsx new file mode 100644 index 0000000..5f196cb --- /dev/null +++ b/src/pages/eventDetail/eventDetail.jsx @@ -0,0 +1,58 @@ +import { useState } from "react"; +import styles from "./eventDetail.module.css"; + + +function eventDetail(){ + + const [tasks, setTasks] = useState([ + { text: "Préparer les slides", completed: false }, + { text: "Réserver la salle", completed: false }, + { text: "Envoyer les invitations", completed: false }, + { text: "Tester la configuration technique", completed: false }, + { text: "Organiser le catering", completed: false }, + ]); + + const event = { + title: "Conférence React 2025", + date: "27 Décembre 2025", + location: "Paris, France", + description: + "Une conférence dédiée aux développeurs React pour partager les dernières nouveautés et bonnes pratiques.", + }; + + const toggleTask = (index) => { + const newTasks = [...tasks]; + newTasks[index].completed = !newTasks[index].completed; + setTasks(newTasks); + }; + + return ( +
+

{event.title}

+
+

Date: {event.date}

+

Lieu: {event.location}

+

Description: {event.description}

+
+ +

Tâches

+
    + {tasks.map((task, index) => ( +
  • + toggleTask(index)} + /> + {task.text} +
  • + ))} +
+
+ ); +} + +export default eventDetail; diff --git a/src/pages/eventDetail/eventDetail.module.css b/src/pages/eventDetail/eventDetail.module.css new file mode 100644 index 0000000..3c314c4 --- /dev/null +++ b/src/pages/eventDetail/eventDetail.module.css @@ -0,0 +1,44 @@ +.container { + max-width: 600px; + margin: 40px auto; + background-color: #fff; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0,0,0,0.1); + padding: 20px; + font-family: Arial, sans-serif; +} + +.title { + font-size: 2rem; + color: #333; + margin-bottom: 10px; +} + +.eventInfo p { + margin: 5px 0; + font-size: 1rem; + color: #555; +} + +.tasks { + list-style: none; + padding: 0; +} + +.tasks li { + background-color: #f9f9f9; + margin: 5px 0; + padding: 10px; + border-radius: 5px; + display: flex; + align-items: center; +} + +.tasks li.completed { + text-decoration: line-through; + opacity: 0.6; +} + +.tasks input[type="checkbox"] { + margin-right: 10px; +} diff --git a/src/router.js b/src/router.js index 73e049e..abe0254 100644 --- a/src/router.js +++ b/src/router.js @@ -10,6 +10,7 @@ import AdminPage from "./pages/Admin/AdminPage.jsx"; import ValidationErrorPage from "./pages/waitValidationPage/ValidationErrorPage.jsx"; import VolunteerProfilePage from "./pages/VolunteerProfile/VolunteerProfilePage.jsx"; import PageNotFound from "./pages/PageNotFound/PageNotFound.jsx"; +import eventDetail from "./pages/eventDetail/eventDetail.jsx"; const router = createBrowserRouter([ { @@ -59,7 +60,11 @@ const router = createBrowserRouter([ { path: "/profile/:id", Component: VolunteerProfilePage, - } + }, + { + path: "/eventDetail", + Component: eventDetail, + }, ] } ])