-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
38 lines (34 loc) · 996 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 './App.css';
import { Routes, Route } from 'react-router-dom';
import { lazy, Suspense } from 'react';
import DrawerAppBar from './components/AppBar/AppBar';
const CoursesPage = lazy(() =>
import(
'./pages/CoursesPage/CoursesPage' /* webpackChunkName: "courses_page" */
),
);
const NotFoundPage = lazy(() =>
import(
'./pages/NotFoundPage/NotFoundPage' /* webpackChunkName: "not_found__page" */
),
);
const CourseDetailsPage = lazy(() =>
import(
'./pages/CourseDetailsPage/CourseDetailsPage' /* webpackChunkName: "course_details_page" */
),
);
function App() {
return (
<section className="container">
<DrawerAppBar />
<Suspense fallback={<h1>Loading...</h1>}>
<Routes>
<Route path="/" element={<CoursesPage />} />
<Route path="/course/:courseId" element={<CourseDetailsPage />} />
<Route path="*" element={<NotFoundPage />} />
</Routes>
</Suspense>
</section>
);
}
export default App;