From b708eb0612c09f91aa65d83105fd859ea55430a2 Mon Sep 17 00:00:00 2001 From: "Haru.Kusano" Date: Wed, 18 Jun 2025 13:30:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Layout.tsx | 12 ++++++++---- frontend/src/pages/RecipeList.tsx | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index fe8bff1..7e1c73f 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -41,15 +41,19 @@ const Layout: React.FC = () => { const getTabIndex = (pathname: string) => { + pathname = pathname.split("/")[1]; + console.log(pathname); switch (pathname) { - case '/stock': + case 'stock': return 0; - case '/tasks': + case 'tasks': return 1; - case '/recipeList': + case 'recipeList': + return 2; + case 'addRecipe': return 2; default: - return 0; + return -1; } }; diff --git a/frontend/src/pages/RecipeList.tsx b/frontend/src/pages/RecipeList.tsx index f5f6f11..bcdce5a 100644 --- a/frontend/src/pages/RecipeList.tsx +++ b/frontend/src/pages/RecipeList.tsx @@ -102,7 +102,7 @@ const RecipeList: React.FC = () => { fontSize: "32px", left: "50%", transform: 'translateX(-50%)' }} color="primary" - onClick={() => navigate('/AddRecipe')} + onClick={() => navigate('/addRecipe')} > 新しい料理を追加