|
|
@ -282,8 +282,6 @@ const AddRecipe: React.FC = () => { |
|
|
|
|
|
|
|
|
|
|
|
))}</List>)} |
|
|
|
))}</List>)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{ position: "fixed", left: "80%", transform: 'translateX(-50%)', bottom: "10%" }}> |
|
|
|
<div style={{ position: "fixed", left: "80%", transform: 'translateX(-50%)', bottom: "10%" }}> |
|
|
|
<Box sx={{ textAlign: 'center' }}> |
|
|
|
<Box sx={{ textAlign: 'center' }}> |
|
|
|
<Typography variant="caption">材料を追加</Typography> |
|
|
|
<Typography variant="caption">材料を追加</Typography> |
|
|
@ -296,11 +294,7 @@ const AddRecipe: React.FC = () => { |
|
|
|
<div style={{ position: "fixed", left: "50%", transform: 'translateX(-50%)', bottom: "64px", whiteSpace: 'nowrap' }}> |
|
|
|
<div style={{ position: "fixed", left: "50%", transform: 'translateX(-50%)', bottom: "64px", whiteSpace: 'nowrap' }}> |
|
|
|
<Button variant='contained' color="primary" onClick={handleSubmit} sx={{ marginRight: "1rem" }}> |
|
|
|
<Button variant='contained' color="primary" onClick={handleSubmit} sx={{ marginRight: "1rem" }}> |
|
|
|
<SaveIcon sx={{ fontSize: "1.5rem", marginRight: "0.5rem" }} /> |
|
|
|
<SaveIcon sx={{ fontSize: "1.5rem", marginRight: "0.5rem" }} /> |
|
|
|
レシピを保存 |
|
|
|
保存 |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button variant='contained' color="primary" onClick={openNumOfPeopleDialog}> |
|
|
|
|
|
|
|
<ListAltIcon sx={{ fontSize: "1.5rem", marginRight: "0.5rem" }} /> |
|
|
|
|
|
|
|
保存して買うものリストへ追加 |
|
|
|
|
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -344,49 +338,6 @@ const AddRecipe: React.FC = () => { |
|
|
|
setOpenAmountDialog(false); |
|
|
|
setOpenAmountDialog(false); |
|
|
|
}} /> |
|
|
|
}} /> |
|
|
|
|
|
|
|
|
|
|
|
{/* 人数入力ダイアログ */} |
|
|
|
|
|
|
|
<Dialog open={openNumOfPeapleDialog} onClose={() => setOpenNumOfPeapleDialog(false)} disableScrollLock={true} |
|
|
|
|
|
|
|
style={{ width : '100%', position : 'fixed', left: '50%', transform: 'translateX(-50%)' }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Box display="flex" alignItems="center" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<DialogTitle sx={{ flexGrow: 1 }}>買うものリストへ追加</DialogTitle> |
|
|
|
|
|
|
|
</Box> |
|
|
|
|
|
|
|
<DialogContent> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
{/* 人数入力フィールド */} |
|
|
|
|
|
|
|
<TextField |
|
|
|
|
|
|
|
margin="dense" |
|
|
|
|
|
|
|
label="何人前" |
|
|
|
|
|
|
|
fullWidth |
|
|
|
|
|
|
|
value={numOfPeaple} |
|
|
|
|
|
|
|
onChange={(e) => { |
|
|
|
|
|
|
|
const value = e.target.value; |
|
|
|
|
|
|
|
const parsedValue = parseInt(value, 10); // 数値に変換
|
|
|
|
|
|
|
|
if (/*!isNaN(parsedValue) && */ isNaN(parsedValue) || parsedValue >= 1) { //負数除外
|
|
|
|
|
|
|
|
setNumOfPeaple(parsedValue); // number型で保存
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
sx={{ minWidth: "8px", width: "100%" }} |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
inputProps={{ inputMode: "numeric", pattern: "[0-9]*" }} // ここで整数のみ許可
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<FormControlLabel |
|
|
|
|
|
|
|
control={<Checkbox checked={checked} onChange={(e) => setChecked(e.target.checked)} />} |
|
|
|
|
|
|
|
label={<Typography sx={{ fontSize: '85%' }}>足りない食材のみ登録</Typography>} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</DialogContent> |
|
|
|
|
|
|
|
<DialogActions> |
|
|
|
|
|
|
|
<Button onClick={() => setOpenNumOfPeapleDialog(false)}>前の画面に戻る</Button> |
|
|
|
|
|
|
|
<Button onClick={() => handleSubmitAndAddToBuy()} variant="contained" |
|
|
|
|
|
|
|
style={{ width: '40%' }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
追加 |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</DialogActions> |
|
|
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
</> |
|
|
|
} |
|
|
|
} |
|
|
|