From 45040b78804f6a43055c7e12b880bdc46a219faf Mon Sep 17 00:00:00 2001 From: "Haru.Kusano" Date: Tue, 3 Jun 2025 16:09:31 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=83=89=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 25 +++++++++++++++++++++++++ frontend/src/components/Layout.tsx | 29 +++++++++++++++++++---------- frontend/src/pages/StockPage.tsx | 16 ++++++++++++++++ 3 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 frontend/src/pages/StockPage.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 7141e87..d4d6caf 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,6 +9,7 @@ import Layout from './components/Layout'; import LoginPage from './pages/LoginPage'; import RegisterPage from './pages/RegisterPage'; import TaskListPage from './pages/TaskListPage'; +import StockPage from './pages/StockPage'; import './App.css'; /** @@ -93,6 +94,30 @@ const App: React.FC = () => { } /> + }> + {/* ルートパスへのアクセスはタスク一覧にリダイレクト */} + } /> + + {/* タスク一覧は認証が必要なため、PrivateRouteでラップ */} + + + + } + /> + + {/* テストページへのルートを追加 */} + + + + } + /> + diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index e8696a9..eb3612f 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -3,13 +3,13 @@ * ヘッダー(AppBar)とメインコンテンツ領域を含む基本的なページ構造を定義 */ import React, { useState } from 'react'; -import { - AppBar, - Toolbar, - Typography, - Container, - Box, - Button, +import { + AppBar, + Toolbar, + Typography, + Container, + Box, + Button, Drawer, List, ListItemText, @@ -18,9 +18,10 @@ import { Divider, IconButton } from '@mui/material'; -import { +import { Menu as MenuIcon, ListAlt as ListAltIcon, + Inventory as InventoryIcon, // テストページ用のアイコン } from '@mui/icons-material'; import { useNavigate, Outlet, useLocation } from 'react-router-dom'; @@ -91,13 +92,21 @@ const Layout: React.FC = () => { role="presentation" > - handleNavigate('/tasks')} + handleNavigate('/tasks')} selected={isSelected('/tasks')} > + {/* テストページへのリンクを追加 */} + handleNavigate('/stock')} + selected={isSelected('/stock')} + > + + + diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx new file mode 100644 index 0000000..8de8bd9 --- /dev/null +++ b/frontend/src/pages/StockPage.tsx @@ -0,0 +1,16 @@ +/** + * テストページコンポーネント + * 白紙の状態で表示されるテスト用のページ + */ +import React from 'react'; +import { Box } from '@mui/material'; + +const StockPage: React.FC = () => { + return ( + + {/* 白紙のページ - 何も表示しない */} + + ); +}; + +export default StockPage; \ No newline at end of file