-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathApp.tsx
More file actions
71 lines (67 loc) · 2.39 KB
/
App.tsx
File metadata and controls
71 lines (67 loc) · 2.39 KB
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
import { HashRouter, Route, Routes } from 'react-router-dom';
import './App.scss';
import { HomePage } from './modules/HomePage';
import { NotFoundPage } from './modules/NotFoundPage';
import { Layout } from './components/Layout';
import { ThemeProvider } from './context/ThemeContext';
import { CartPage } from './modules/CartPage';
import { CartProvider } from './context/CartContext';
import { FavouritesProvider } from './context/FavoritesContext';
import { FavouritesPage } from './modules/FavouritesPage';
import { CategoryPage } from './modules/CategoryPage';
import { CategoriesType, PathType } from './types/Types';
import { ProductDetailsPage } from './modules/ProductDetailsPage';
export const App = () => (
<div className="App">
<ThemeProvider>
<CartProvider>
<FavouritesProvider>
<HashRouter>
<Routes>
<Route path={PathType.HOME} element={<Layout />}>
<Route index element={<HomePage />} />
<Route
path={PathType.PHONES}
element={
<CategoryPage
title={'Mobile phones'}
category={CategoriesType.PHONES}
/>
}
></Route>
<Route
path={PathType.TABLETS}
element={
<CategoryPage
title={'Tablets'}
category={CategoriesType.TABLETS}
/>
}
></Route>
<Route
path={PathType.ACCESSORIES}
element={
<CategoryPage
title={'Accessories'}
category={CategoriesType.ACCESSORIES}
/>
}
></Route>
<Route
path={PathType.FAVOURITES}
element={<FavouritesPage />}
></Route>
<Route path={PathType.CART} element={<CartPage />}></Route>
<Route
path="/product/:productId"
element={<ProductDetailsPage />}
/>
<Route path="*" element={<NotFoundPage />}></Route>
</Route>
</Routes>
</HashRouter>
</FavouritesProvider>
</CartProvider>
</ThemeProvider>
</div>
);