diff --git a/public/favicon.ico b/public/favicon.ico index c66f7c0..636bcb5 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/App.tsx b/src/App.tsx index 3aa9dfb..ac55bc2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,12 +2,14 @@ import { Pagination } from 'antd'; import axios from 'axios'; import dayjs from 'dayjs'; import { useEffect, useState } from 'react'; -import { NavigateFunction, useNavigate } from "react-router-dom"; +import { NavigateFunction, useNavigate, useParams } from "react-router-dom"; import './App.css'; import A from './Components/CustomA'; export default function App() { const navigate: NavigateFunction = useNavigate(); + const { id } = useParams(); + const dayOfWeek: string = id ?? "1"; const [current, setCurrent] = useState(1); const [totalDataLength, setTotalDataLength] = useState(50) const [data, setData] = useState([[]]) @@ -28,6 +30,7 @@ export default function App() { } const reqData = JSON.stringify({ + "dayOfWeek": dayOfWeek, "page": current }); @@ -55,6 +58,10 @@ export default function App() { } function getListPage(): void { + const reqData = JSON.stringify({ + "dayOfWeek": dayOfWeek + }); + const config = { method: 'post', maxBodyLength: Infinity, @@ -62,6 +69,7 @@ export default function App() { headers: { 'Content-Type': 'application/json' }, + data: reqData }; axios.request(config) diff --git a/src/Play.tsx b/src/Play.tsx index 01826ab..2a1ef82 100644 --- a/src/Play.tsx +++ b/src/Play.tsx @@ -16,7 +16,7 @@ export default function Play() { const [scoreList, setScoreList] = useState([]) function onClickLobby(): void { - navigate(`/`); + navigate(`/home/${data.dayOfWeek}`); } useEffect(() => { diff --git a/src/main.tsx b/src/main.tsx index ad3d225..9aa2ed8 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -14,6 +14,10 @@ const hashRouter: Router = createHashRouter([ path: "/", element: , }, + { + path: "/home/:id", + element: , + }, { path: "/play/:id", element: ,