From 777fdc72af7516414f9a5ee4a4889055d7ae93f9 Mon Sep 17 00:00:00 2001 From: "Haru.Kusano" Date: Mon, 16 Jun 2025 13:30:17 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E3=83=9C=E3=83=88=E3=83=A0=E3=83=8A?= =?UTF-8?q?=E3=83=93=E3=82=B2=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E4=BD=9C=E6=88=90=EF=BC=86=E3=82=B5=E3=82=A4=E3=83=89=E3=83=90?= =?UTF-8?q?=E3=83=BC=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Layout.tsx | 102 ++++++++++------------------ frontend/src/pages/TaskListPage.tsx | 8 +-- 2 files changed, 40 insertions(+), 70 deletions(-) diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index fa90b27..10d255d 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -16,7 +16,10 @@ import { ListItemIcon, ListItemButton, Divider, - IconButton + IconButton, + BottomNavigation, + BottomNavigationAction, + Paper } from '@mui/material'; import { Menu as MenuIcon, @@ -24,6 +27,7 @@ import { Inventory as InventoryIcon, // テストページ用のアイコン Science as ScienceIcon, // 鈴木 SoupKitchen as SoupKitchenIcon, + ShoppingCart as ShoppingCartIcon } from '@mui/icons-material'; import { useNavigate, Outlet, useLocation } from 'react-router-dom'; @@ -31,6 +35,7 @@ const Layout: React.FC = () => { const navigate = useNavigate(); const location = useLocation(); const [drawerOpen, setDrawerOpen] = useState(false); + const [bottomNavi, setBottomNavi] = useState(1); /** * ログアウト処理を行うハンドラー関数 @@ -41,19 +46,9 @@ const Layout: React.FC = () => { navigate('/login'); }; - /** - * 画面遷移処理を行うハンドラー関数 - * 指定されたパスに遷移し、サイドメニューを閉じる - */ - const handleNavigate = (path: string) => { - navigate(path); - setDrawerOpen(false); - }; + - // 現在のパスに基づいてメニュー項目が選択状態かどうかを判定 - const isSelected = (path: string): boolean => { - return location.pathname === path; - }; + // メニューを開閉するハンドラー const toggleDrawer = () => { @@ -65,15 +60,6 @@ const Layout: React.FC = () => { {/* ヘッダー部分 - アプリ名とログアウトボタンを表示 */} - - - shopchop @@ -83,52 +69,36 @@ const Layout: React.FC = () => { - {/* サイドメニュー */} - setDrawerOpen(false)} - > - + { + setBottomNavi(newValue); + switch(newValue) { + case 0: + navigate('stock'); + break; + case 1: + navigate('tasks'); + break; + case 2: + navigate('recipeList'); + break; + } + // ここでルーティング処理などを行う + }} > - - handleNavigate('/tasks')} - selected={isSelected('/tasks')} - > - - - - {/* テストページへのリンクを追加 */} + } /> + } /> + } /> + + - {/* 在庫リストへのリンクを追加 */} - handleNavigate('/addRecipe')} - selected={isSelected('/addRecipe')} - > - - - - handleNavigate('/recipeList')} - selected={isSelected('/recipeList')} - > - - - - handleNavigate('/stock')} - selected={isSelected('/stock')} - > - - - - - - - {/* メインコンテンツ領域 - 子ルートのコンポーネントがここに表示される */} diff --git a/frontend/src/pages/TaskListPage.tsx b/frontend/src/pages/TaskListPage.tsx index 29082a3..7d8b59d 100644 --- a/frontend/src/pages/TaskListPage.tsx +++ b/frontend/src/pages/TaskListPage.tsx @@ -294,28 +294,28 @@ const TaskListPage: React.FC = () => { {/* 新規材料作成ボタン - 画面下部に固定表示 */} - + 材料のみ追加 setOpenAddToBuyDialog(true)} > {/*新規料理追加ボタン - 画面下部に固定表示 */} - + 料理から追加 { // setOpenAddToBuyDialog(true); navigate('/RecipeList'); From be711eccea66002fadab4178960cac1f682333d6 Mon Sep 17 00:00:00 2001 From: "Yuna.Suzuki" Date: Mon, 16 Jun 2025 13:41:18 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E3=82=B9=E3=83=9E=E3=83=9B=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=9F=E7=94=BB=E9=9D=A2=E8=A8=AD?= =?UTF-8?q?=E8=A8=88=E3=80=81=E7=B7=A8=E9=9B=86=E7=94=BB=E9=9D=A2=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E8=A9=B3=E7=B4=B0=E8=A1=A8=E7=A4=BA=E3=80=81=E7=B7=A8?= =?UTF-8?q?=E9=9B=86=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E3=82=AB=E3=83=AC=E3=83=B3=E3=83=80=E3=83=BC=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=82=92=E5=AE=9F=E8=A3=85=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/StockPage.tsx | 104 +++++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 25 deletions(-) diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx index 2aa95ba..363230e 100644 --- a/frontend/src/pages/StockPage.tsx +++ b/frontend/src/pages/StockPage.tsx @@ -146,7 +146,7 @@ const StockPage: React.FC = () => { }; /** - * カテゴリー選択?? + * カテゴリー選択 */ const onChangeCategory = async (category: string) => { setNewStock({ ...newStock, category }) @@ -270,8 +270,6 @@ const StockPage: React.FC = () => { 食材名 数量 - 購入価格 - 購入日 消費・賞味期限 @@ -290,8 +288,6 @@ const StockPage: React.FC = () => { > {stock.stuffName} {stock.amount} - {stock.price} - {formatDate(stock.buyDate)} @@ -330,6 +326,54 @@ const StockPage: React.FC = () => { value={editStock.price} onChange={handleChange} /> + {/* 購入日・消費期限を横並びに */} + + {/* 購入日 */} + { + if (editStock) { + setEditStock({ + ...editStock, + buyDate: date ? formatDateLocal(date) : '', + }); + } + }} + dateFormat="yyyy/MM/dd" + customInput={ + + } + isClearable + /> + {/* 消費・賞味期限 */} + { + if (editStock) { + setEditStock({ + ...editStock, + expDate: date ? formatDateLocal(date) : '', + }); + } + }} + dateFormat="yyyy/MM/dd" + customInput={ + + } + isClearable + /> + + {/* 以前の書き方 { name="expDate" value={editStock.expDate} onChange={handleChange} - /> - - - - + /> */} + + + + )} @@ -375,13 +416,26 @@ const StockPage: React.FC = () => { <> 【{selectedRow.stuffName}】を削除します。 ⚠️ 注意: 削除すると復元できません。 - - + + + + + )} @@ -555,7 +609,7 @@ const StockPage: React.FC = () => { {/* 在庫の食材編集ボタン(全テーブル共通) */} {/* 在庫の食材削除ボタン (全テーブル共通) */} From c615c88d2db5955aa12823482bd43ce520e5642b Mon Sep 17 00:00:00 2001 From: "Yuna.Suzuki" Date: Mon, 16 Jun 2025 13:57:18 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E5=BE=AE=E8=AA=BF=E6=95=B4=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/StockPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx index 363230e..07206df 100644 --- a/frontend/src/pages/StockPage.tsx +++ b/frontend/src/pages/StockPage.tsx @@ -608,7 +608,8 @@ const StockPage: React.FC = () => { {/* 在庫の食材編集ボタン(全テーブル共通) */} - From 0fb3e0c21ac2ae25d8db1ad8be9eba67672f762e Mon Sep 17 00:00:00 2001 From: "Yuna.Suzuki" Date: Mon, 16 Jun 2025 14:06:04 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E5=BE=AE=E8=AA=BF=E6=95=B4=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/StockPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx index 07206df..48fffee 100644 --- a/frontend/src/pages/StockPage.tsx +++ b/frontend/src/pages/StockPage.tsx @@ -452,6 +452,7 @@ const StockPage: React.FC = () => { + {/* */} {/* 在庫の食材追加ボタン */}