diff --git a/frontend/src/pages/TaskListPage.tsx b/frontend/src/pages/TaskListPage.tsx index 76040a1..58be959 100644 --- a/frontend/src/pages/TaskListPage.tsx +++ b/frontend/src/pages/TaskListPage.tsx @@ -35,6 +35,7 @@ import { Task } from '../types/types'; import { TASK_ERRORS } from '../constants/errorMessages'; //import { FaCarrot } from "react-icons/fa6"; //エラー起きる いったん保留 import CategoryDropDown from "../components/CategoryDropDown"; +import { useNavigate, Outlet, useLocation } from 'react-router-dom'; @@ -43,6 +44,7 @@ import CategoryDropDown from "../components/CategoryDropDown"; const EMPTY_TASK = { id: 0, title: '', amount: 0, completed: false }; const TaskListPage: React.FC = () => { + const navigate = useNavigate(); // タスク一覧の状態管理 const [tasks, setTasks] = useState([]); // 新規タスク作成ダイアログの表示状態 @@ -200,7 +202,8 @@ const TaskListPage: React.FC = () => { setOpenDialog(true)} + // onClick={() => setOpenDialog(true)} + onClick={() => navigate('/add1')} >