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')} > 新しい料理を追加