-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRootCmp.jsx
40 lines (36 loc) · 1.58 KB
/
RootCmp.jsx
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
39
40
import { AppHeader } from "./pages/AppHeader.jsx"
import { HomePage } from "./pages/HomePage.jsx"
import { BookIndex } from "./pages/BookIndex.jsx"
import { BookDetails } from "./pages/BookDetails.jsx"
import { BookEdit } from "./pages/BookEdit.jsx"
import { BookAdd } from "./pages/BookAdd.jsx"
import { AboutUs } from "./pages/AboutUs.jsx"
import { AppFooter } from "./pages/AppFooter.jsx"
import { NotFound } from "./pages/NotFound.jsx"
import { UserMassage } from "./cmps/UserMassage.jsx"
const Router = ReactRouterDOM.HashRouter
const { Routes, Route, Navigate } = ReactRouterDOM
export function RootCmp() {
return (
<Router>
<section className="app main-layout">
<AppHeader />
<main>
<Routes>
<Route path="/" element={<Navigate to="/home" />} />
<Route path="/home" element={<HomePage/>}/>
<Route path="/book" element={<BookIndex/>}/>
<Route path="/book/:bookId" element={<BookDetails/>}/>
<Route path="/book/edit" element={<BookEdit/>}/>
<Route path="/book/edit/:bookId" element={<BookEdit/>}/>
<Route path="/book/add" element={<BookAdd/>}/>
<Route path="/about" element={<AboutUs/>}/>
<Route path="*" element={<NotFound />} />
</Routes>
</main>
<AppFooter/>
<UserMassage/>
</section>
</Router>
)
}