-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
39 lines (36 loc) · 1.37 KB
/
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
39
import React from 'react';
import Signup from './pages/Signup';
import { AuthProvider } from './context/AuthContext';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Dashboard from './pages/Dashboard';
import Login from './pages/Login';
import PrivateRoute from './pages/PrivateRoute';
import ForgotPassword from './pages/ForgotPassword';
import UpdateProfile from './pages/UpdateProfile';
import NotFound from './pages/NotFound';
import { ProjectsPage } from './pages/ProjectsPage';
import { ROUTES } from './config/constants';
import 'bootstrap/dist/css/bootstrap.css';
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
export const App = () => (
<div>
<Router history={history}>
<AuthProvider>
<Switch>
<PrivateRoute exact path={ROUTES.DASHBOARD} component={Dashboard} />
<PrivateRoute exact path={ROUTES.HOME} component={ProjectsPage} />
<PrivateRoute
exact
path={ROUTES.UPDATE_PROFILE}
component={UpdateProfile}
/>
<Route path={ROUTES.SIGN_UP} component={Signup} />
<Route path={ROUTES.LOGIN} component={Login} />
<Route path={ROUTES.FORGOT_PASSWORD} component={ForgotPassword} />
<Route path="*" component={NotFound} />
</Switch>
</AuthProvider>
</Router>
</div>
);