correction eventDetail
This commit is contained in:
+2
-2
@@ -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 <p>Loading</p>;
|
||||
if (!user) return <Navigate to="/login" />;
|
||||
if(user && user.validate === 0) return <Navigate to="/error/validation" />;
|
||||
if(user && user.validate === 0) return <Navigate to="/error/validation" />;*/
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -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 (
|
||||
<div className={styles.container}>
|
||||
<h1 className={styles.title}>{event.title}</h1>
|
||||
<div className={styles.eventInfo}>
|
||||
<p><strong>Date:</strong> {event.date}</p>
|
||||
<p><strong>Lieu:</strong> {event.location}</p>
|
||||
<p><strong>Description:</strong> {event.description}</p>
|
||||
</div>
|
||||
|
||||
<h2>Tâches</h2>
|
||||
<ul className={styles.tasks}>
|
||||
{tasks.map((task, index) => (
|
||||
<li
|
||||
key={index}
|
||||
className={task.completed ? styles.completed : ""}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={task.completed}
|
||||
onChange={() => toggleTask(index)}
|
||||
/>
|
||||
<span>{task.text}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default eventDetail;
|
||||
@@ -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;
|
||||
}
|
||||
+6
-1
@@ -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,
|
||||
},
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user