From 43736709a96f3b9708fc4dfd2d23ba06cccef211 Mon Sep 17 00:00:00 2001 From: Gilles Soulier Date: Sun, 24 May 2026 15:47:48 +0200 Subject: [PATCH] =?UTF-8?q?refactor(todos):=20formulaires=20cr=C3=A9ation?= =?UTF-8?q?=20et=20=C3=A9dition=20migr=C3=A9s=20vers=20Modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/TodosPage.tsx | 115 ++++++++++++++----------------- 1 file changed, 52 insertions(+), 63 deletions(-) diff --git a/frontend/src/pages/TodosPage.tsx b/frontend/src/pages/TodosPage.tsx index c087bf2..b56507a 100644 --- a/frontend/src/pages/TodosPage.tsx +++ b/frontend/src/pages/TodosPage.tsx @@ -4,6 +4,7 @@ import type { Todo, TodoCreate, TodoFilters } from '../api/todos' import { fetchTodos, createTodo, updateTodo, deleteTodo, postponeTodo } from '../api/todos' import SwipeableRow from '../components/todos/SwipeableRow' import TodoForm from '../components/todos/TodoForm' +import Modal from '../components/Modal' type EditingTodo = Todo | null @@ -151,22 +152,14 @@ export default function TodosPage() { {/* Formulaire de création */} {showForm && ( -
-
- setShowForm(false)} extended /> -
-
- setShowForm(false)} /> -
-
+ setShowForm(false)}> + setShowForm(false)} extended /> + )} {/* Formulaire d'édition */} {editingTodo && ( -
-

- Modifier la tâche -

+ setEditingTodo(null)}> handleUpdate(editingTodo.id, data)} onCancel={() => setEditingTodo(null)} @@ -182,7 +175,7 @@ export default function TodosPage() { tags: editingTodo.tags, }} /> -
+ )} {loading && ( @@ -377,58 +370,54 @@ export default function TodosPage() { {/* FAB mobile (au-dessus de la barre de navigation) */} - {!showForm && ( - - )} + {/* Bouton création laptop */} - {!showForm && ( - - )} + ) }