数量表示調整

dev-frontend-stock
akito.nishiwaki 5 months ago
parent b3002ec297
commit 4e73ccf51c
  1. 16
      frontend/src/pages/TaskListPage.tsx

@ -57,8 +57,7 @@ const TaskListPage: React.FC = () => {
//在庫登録ダイアログの表示状態 //在庫登録ダイアログの表示状態
const [openInfoDialog, setOpenInfoDialog] = useState(false); const [openInfoDialog, setOpenInfoDialog] = useState(false);
const [selectedTask, setSelectedTask] = useState<Task>(); const [selectedTask, setSelectedTask] = useState<ToBuy["tobuy_id"]>(0);
const [newToBuy, setNewToBuy] = useState(EMPTY_TASK); const [newToBuy, setNewToBuy] = useState(EMPTY_TASK);
@ -153,8 +152,8 @@ const TaskListPage: React.FC = () => {
*/} */}
{/* タスクのタイトルと説明 - 完了状態に応じて取り消し線を表示 */} {/* タスクのタイトルと説明 - 完了状態に応じて取り消し線を表示 */}
<ListItemText <ListItemText
primary={tobuy.stuff_name} primary={`${tobuy.stuff_name} × ${tobuy.amount}`}
secondary={tobuy.amount} //secondary={tobuy.amount}
sx={{ sx={{
textDecoration: false ? 'line-through' : 'none', textDecoration: false ? 'line-through' : 'none',
}} }}
@ -165,7 +164,11 @@ const TaskListPage: React.FC = () => {
<IconButton <IconButton
edge="end" edge="end"
aria-label="食材情報追加" aria-label="食材情報追加"
//onClick={() => handleDeleteTask(task.id)} onClick={() => {
setOpenInfoDialog(true)
setSelectedTask(tobuy.tobuy_id)
handleDeleteTask(tobuy.tobuy_id)
}}
> >
<ShoppingBasketIcon /> <ShoppingBasketIcon />
</IconButton> </IconButton>
@ -306,8 +309,9 @@ const TaskListPage: React.FC = () => {
<Button onClick={() => setOpenInfoDialog(false)}></Button> <Button onClick={() => setOpenInfoDialog(false)}></Button>
<Button onClick={() => { <Button onClick={() => {
if (selectedTask) { if (selectedTask) {
handleDeleteTask(selectedTask.id) handleDeleteTask(selectedTask)
setOpenInfoDialog(false) setOpenInfoDialog(false)
setNewToBuy(EMPTY_TASK); // 入力内容をリセット
} }
}} }}
variant="contained"> variant="contained">

Loading…
Cancel
Save