-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
38 lines (35 loc) · 902 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {
CompetitionList,
TeamList,
CalendarLeague,
TeamCalendar,
} from "./Components";
import Header from "./Header/Header";
import { HashRouter, Route, Routes, Navigate, Outlet } from "react-router-dom";
import "./index.css";
const App = () => {
return (
<HashRouter>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<CompetitionList />} />
<Route path="/teams/:id" element={<TeamList />} />
<Route path="/calendar/:id" element={<CalendarLeague />} />
<Route path="/team/:id/calendar" element={<TeamCalendar />} />
</Route>
<Route path="*" element={<Navigate to="/" />} />
</Routes>
</HashRouter>
);
};
const Layout = () => {
return (
<div className="App">
<Header />
<div className="body">
<Outlet />
</div>
</div>
);
};
export default App;