diff --git a/frontend/src/pages/TaskListPage.tsx b/frontend/src/pages/TaskListPage.tsx index 7ab3160..807287f 100644 --- a/frontend/src/pages/TaskListPage.tsx +++ b/frontend/src/pages/TaskListPage.tsx @@ -32,7 +32,7 @@ import { } from '@mui/material'; import { Add as AddIcon, Delete as DeleteIcon, ShoppingBasket as ShoppingBasketIcon, - SoupKitchen as SoupKitchenIcon + SoupKitchen as SoupKitchenIcon, Edit as EditIcon } from '@mui/icons-material'; import { ToBuy, Stuff, Stock } from '../types/types'; import { TOBUY_ERRORS } from '../constants/errorMessages'; @@ -64,7 +64,7 @@ const TaskListPage: React.FC = () => { //在庫登録ダイアログの表示状態 const [openInfoDialog, setOpenInfoDialog] = useState(false); - + const [selectedTask, setSelectedTask] = useState(0); const [newToBuy, setNewToBuy] = useState(EMPTY_TOBUY); @@ -126,14 +126,14 @@ const TaskListPage: React.FC = () => { console.error(`${TOBUY_ERRORS.DELETE_FAILED}:`, error); } }; - + /** * 買うものリストの在庫登録(購入処理)を行うハンドラー */ const handleBuy = async (tobuyId: number) => { try { const today = new Date().toISOString().substring(0, 10); - await toBuyApi.buy({tobuyId, ...newStock, lastUpdate: today}); + await toBuyApi.buy({ tobuyId, ...newStock, lastUpdate: today }); fetchTasks(); // 削除後の買うもの一覧を再取得 } catch (error) { console.error(`${TOBUY_ERRORS.BUY_FAILED}:`, error); @@ -194,13 +194,28 @@ const TaskListPage: React.FC = () => { textDecoration: false ? 'line-through' : 'none', }} /> - {/* 買い物リスト:食材情報記入ボタン */} + {/* 買い物リスト:数量変更ボタン */} + + { + setOpenInfoDialog(true) + //setSelectedTask(tobuy.tobuyId) + // handleDeleteTask(tobuy.tobuyId) + }} + > + + + + {/* 買い物リスト:食材情報記入ボタン */} { setOpenInfoDialog(true) setSelectedTask(tobuy.tobuyId) @@ -210,7 +225,7 @@ const TaskListPage: React.FC = () => { - + {/* 買い物リスト:食材削除ボタン */} { 材料のみ追加 - - setOpenDialog(true)} - > - - - + + setOpenDialog(true)} + > + + + {/*新規料理追加ボタン - 画面下部に固定表示 */} 料理から追加 - - { - setOpenDialog(true); - //handleNavigate('/AddDishies1'); - }} - //selected={isSelected('/test')} - > - - - + + { + setOpenDialog(true); + //handleNavigate('/AddDishies1'); + }} + //selected={isSelected('/test')} + > + + + {/* 新規タスク作成ダイアログ */} setOpenDialog(false)} disableScrollLock={true}> @@ -371,7 +386,7 @@ const TaskListPage: React.FC = () => { label="価格" fullWidth value={newStock.price} - onChange={(e) => setNewStock({...newStock, price: parseInt(e.target.value)})} + onChange={(e) => setNewStock({ ...newStock, price: parseInt(e.target.value) })} /> {/* 消費・賞味期限入力フィールド */} { fullWidth multiline value={newStock.expDate} - onChange={(e) => setNewStock({...newStock, expDate: e.target.value})} + onChange={(e) => setNewStock({ ...newStock, expDate: e.target.value })} /> {/* 購入日入力フィールド */} { fullWidth multiline value={newStock.buyDate} - onChange={(e) => setNewStock({...newStock, buyDate: e.target.value})} + onChange={(e) => setNewStock({ ...newStock, buyDate: e.target.value })} />