-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
89 lines (87 loc) · 2.22 KB
/
App.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import React, { Suspense, lazy } from "react"
import { BrowserRouter, Routes, Route } from "react-router-dom"
import Error from "./pages/Error"
import HomeSkeleton from "./components/Loader/HomeSkeleton"
import Skeleton from "./components/Loader/Skeleton"
const Home = lazy(() => import("./pages/Home"))
const Airing = lazy(() => import("./pages/Airing"))
const Genre = lazy(() => import("./pages/Genre"))
const Main = lazy(() => import("./pages/Main"))
const Movies = lazy(() => import("./pages/Movies"))
const Popular = lazy(() => import("./pages/Popular"))
const Series = lazy(() => import("./pages/Series"))
const Watch = lazy(() => import("./pages/Watch"))
const App = () => {
return (
<BrowserRouter>
<Routes>
<Route
path="/"
element={
<Suspense>
<Main />
</Suspense>
}
/>
<Route
path="/home"
element={
<Suspense fallback={<HomeSkeleton />}>
<Home />
</Suspense>
}
/>
<Route
path="/movies"
element={
<Suspense fallback={<Skeleton />}>
<Movies />
</Suspense>
}
/>
<Route
path="/tv-series"
element={
<Suspense fallback={<Skeleton />}>
<Series />
</Suspense>
}
/>
<Route
path="/most-popular"
element={
<Suspense fallback={<Skeleton />}>
<Popular />
</Suspense>
}
/>
<Route
path="/top-airing"
element={
<Suspense fallback={<Skeleton />}>
<Airing />
</Suspense>
}
/>
<Route
path="/watch/:animeName"
element={
<Suspense fallback={<Skeleton />}>
<Watch />
</Suspense>
}
/>
<Route
path="/genre/:genreName"
element={
<Suspense fallback={<Skeleton />}>
<Genre />
</Suspense>
}
/>
<Route path="/*" element={<Error />} />
</Routes>
</BrowserRouter>
)
}
export default App