correction eventDetail
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user