From 0b7acece277f80f1baeb7bb419544cdd11f7817f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 7 Dec 2025 17:57:44 +0900 Subject: feat(client): add edit deck modal with form validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add EditDeckModal component that allows users to edit existing decks. The modal pre-populates with current deck values and supports updating name and description fields with proper validation and error handling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/client/pages/HomePage.tsx | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'src/client/pages') diff --git a/src/client/pages/HomePage.tsx b/src/client/pages/HomePage.tsx index d753aa1..08eccaa 100644 --- a/src/client/pages/HomePage.tsx +++ b/src/client/pages/HomePage.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useState } from "react"; import { ApiClientError, apiClient } from "../api"; import { CreateDeckModal } from "../components/CreateDeckModal"; +import { EditDeckModal } from "../components/EditDeckModal"; import { useAuth } from "../stores"; interface Deck { @@ -18,6 +19,7 @@ export function HomePage() { const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); + const [editingDeck, setEditingDeck] = useState(null); const fetchDecks = useCallback(async () => { setIsLoading(true); @@ -119,12 +121,29 @@ export function HomePage() { borderRadius: "4px", }} > -

{deck.name}

- {deck.description && ( -

- {deck.description} -

- )} +
+
+

{deck.name}

+ {deck.description && ( +

+ {deck.description} +

+ )} +
+ +
))} @@ -136,6 +155,13 @@ export function HomePage() { onClose={() => setIsCreateModalOpen(false)} onDeckCreated={fetchDecks} /> + + setEditingDeck(null)} + onDeckUpdated={fetchDecks} + /> ); } -- cgit v1.2.3-70-g09d2