From 5a3c49176a9ce703714db2ddd9241088d11489ce Mon Sep 17 00:00:00 2001 From: "Haru.Kusano" Date: Thu, 5 Jun 2025 15:30:41 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BB=AE=EF=BC=9A=E6=9D=90=E6=96=99=E3=83=97?= =?UTF-8?q?=E3=83=AB=E3=83=80=E3=82=A6=E3=83=B3=E3=81=AE=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/StuffNameDropDown.tsx | 16 ++++++++++++++++ frontend/src/pages/TaskListPage.tsx | 13 +++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 frontend/src/components/StuffNameDropDown.tsx diff --git a/frontend/src/components/StuffNameDropDown.tsx b/frontend/src/components/StuffNameDropDown.tsx new file mode 100644 index 0000000..32b613a --- /dev/null +++ b/frontend/src/components/StuffNameDropDown.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { toBuyApi } from '../services/api'; +import { FormControl, InputLabel, Select, MenuItem } from "@mui/material"; + +const StuffNameDropDown = ({ value, onChange }) => { + return ( + + 材料を選択 + + + ); +}; + +export default StuffNameDropDown; \ No newline at end of file diff --git a/frontend/src/pages/TaskListPage.tsx b/frontend/src/pages/TaskListPage.tsx index 80ef225..d5d6aab 100644 --- a/frontend/src/pages/TaskListPage.tsx +++ b/frontend/src/pages/TaskListPage.tsx @@ -44,7 +44,7 @@ const EMPTY_TASK: Omit & {category: string} & {newAddition: b amount: 0, shop: '', category: '', - newAddition: false + newAddition: false, } const TaskListPage: React.FC = () => { @@ -52,12 +52,11 @@ const TaskListPage: React.FC = () => { const [tobuys, setToBuys] = useState([]); // 新規タスク作成ダイアログの表示状態 const [openDialog, setOpenDialog] = useState(false); - // 新規タスクの入力内容 - const [newTask, setNewTask] = useState(EMPTY_TASK); + //在庫登録ダイアログの表示状態 const [openInfoDialog, setOpenInfoDialog] = useState(false); - const [selectedTask, setSelectedTask] = useState(); + const [selectedTask, setSelectedTask] = useState(); const [newToBuy, setNewToBuy] = useState(EMPTY_TASK); @@ -165,6 +164,7 @@ const TaskListPage: React.FC = () => { setOpenInfoDialog(true)} //onClick={() => handleDeleteTask(task.id)} > @@ -228,7 +228,8 @@ const TaskListPage: React.FC = () => { } label="食材を新規追加" - checked={newTask.newAddition} + checked={newToBuy.newAddition} + onChange={(e) => setNewToBuy({ ...newToBuy, newAddition:(e.target as HTMLInputElement).checked })} /> @@ -306,7 +307,7 @@ const TaskListPage: React.FC = () => {