diff --git a/src/App.test.tsx b/src/App.test.tsx index 8104c76..d7408c6 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -29,8 +29,11 @@ describe('App', () => { renderApp() - const items = screen.getAllByRole('button').filter((b) => b.textContent !== '+') - expect(items.map((button) => button.textContent)).toEqual(['Alpha', 'Zebre']) + const items = screen.getAllByRole('button', { name: /^Ouvrir la note/ }) + expect(items.map((button) => button.getAttribute('aria-label'))).toEqual([ + 'Ouvrir la note Alpha', + 'Ouvrir la note Zebre', + ]) }) it('creates a note with the + button and opens the editor in edit mode', () => { diff --git a/src/App.tsx b/src/App.tsx index 18c533c..4c89e3b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -28,15 +28,15 @@ function App() { } return ( -
-
+
+
{selectedNote ? ( -
+
diff --git a/src/components/DeleteModal.tsx b/src/components/DeleteModal.tsx index d44c702..96d7bc2 100644 --- a/src/components/DeleteModal.tsx +++ b/src/components/DeleteModal.tsx @@ -9,12 +9,12 @@ function DeleteModal({ open, title, onConfirm, onCancel }: DeleteModalProps) { if (!open) return null return ( -
+

Supprimer la note ? @@ -24,14 +24,14 @@ function DeleteModal({ open, title, onConfirm, onCancel }: DeleteModalProps) { diff --git a/src/components/FloatingButton.tsx b/src/components/FloatingButton.tsx index eb7151b..5055655 100644 --- a/src/components/FloatingButton.tsx +++ b/src/components/FloatingButton.tsx @@ -9,7 +9,7 @@ function FloatingButton({ onClick, label = 'Créer une note' }: FloatingButtonPr type="button" onClick={onClick} aria-label={label} - className="fixed bottom-6 right-6 w-14 h-14 rounded-full bg-amber-400 text-3xl text-gray-800 shadow-lg active:scale-95" + className="fixed bottom-6 right-6 z-20 flex h-14 w-14 items-center justify-center rounded-full bg-amber-400 text-3xl text-gray-800 shadow-lg transition-transform hover:bg-amber-500 active:scale-95 focus:outline-none focus:ring-2 focus:ring-amber-600 focus:ring-offset-2" > + diff --git a/src/components/NoteEditor.tsx b/src/components/NoteEditor.tsx index 3d33e44..f83e843 100644 --- a/src/components/NoteEditor.tsx +++ b/src/components/NoteEditor.tsx @@ -33,7 +33,7 @@ function NoteEditor({ note, onUpdate, onDelete, autoEdit = false }: NoteEditorPr if (editing) { return (
{ event.preventDefault() save() @@ -44,7 +44,7 @@ function NoteEditor({ note, onUpdate, onDelete, autoEdit = false }: NoteEditorPr setTitle(event.target.value)} - className="w-full border border-gray-300 rounded px-3 py-2" + className="w-full rounded-lg border border-gray-300 px-3 py-3 text-base focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30" placeholder="Sans titre" /> @@ -53,19 +53,22 @@ function NoteEditor({ note, onUpdate, onDelete, autoEdit = false }: NoteEditorPr