-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.jsx
88 lines (74 loc) · 1.75 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
import { useContext, useReducer } from "react";
import Store from "./Store/Store";
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Reducer from "./Store/Reducer";
import {Home} from './Pages/Home';
import {About} from './Pages/About';
import {Contact} from './Pages/Contact';
import {Devs} from './Pages/Devs';
import {EventDescription} from './Pages/EventDescription';
import {HomeComponent} from './Components/HomeComponent';
import {Events} from './Pages/Events';
import {Queries} from './Pages/Queries';
import {Category} from './Pages/Category';
import { ErrorPage } from "./Pages/Errorpage";
function App() {
const initialState = useContext(Store);
const [state, dispatch] = useReducer(Reducer, initialState);
let routes = (
<Switch>
<Route path='/' exact component={HomeComponent}/>
<Route
path="/home"
exact
component={Home}
/>
<Route
path="/about"
exact
component={About}
/>
<Route
path="/contact"
exact
component={Contact}
/>
<Route
path="/query"
exact
component={Queries}
/>
<Route
path="/devs"
exact
component={Devs}
/>
<Route
path="/categories"
exact
component={Category}
/>
<Route
path="/events"
exact
component={Events}
/>
<Route
path="/eventdetails"
exact
component={EventDescription}
/>
<Route path="*" component={ErrorPage}/>
</Switch>
);
return (
<Store.Provider value={[state, dispatch]}>
<div className="App">
<Router>
{routes}
</Router>
</div>
</Store.Provider>
);
}
export default App;