diff --git a/src/App.tsx b/src/App.tsx index 8294a28..eca19e9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import React from 'react'; import './App.css'; -import { Routes, Route, useLocation } from 'react-router-dom'; +import { Routes, Route, useLocation, useMatch } from 'react-router-dom'; import Header from '@components/Header'; import Home from '@pages/Home/Home'; import Login from '@pages/Login/Login'; @@ -27,9 +27,13 @@ import 'react-toastify/dist/ReactToastify.css'; import { ToastContainer } from 'react-toastify'; function App() { + // const location = useLocation(); const isInHome = location.pathname === '/'; + // + const isInAttendanceList = useMatch('/attendance/list/generation/:generationId'); + // // // @@ -41,8 +45,6 @@ function App() { } }, [isInHome]); - const isAttendance = useLocation().pathname.includes('/attendance'); - // // // @@ -72,7 +74,7 @@ function App() { } /> } /> - {isAttendance ? : } + {isInAttendanceList ? : } );