-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
28 lines (27 loc) · 886 Bytes
/
router.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
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import PrivateRoute from './router/PrivateRoute';
import Header from './components/Header';
import Main from './components/Main';
import Login from './components/Login';
import About from './components/About';
import Contact from './components/Contact';
import Profile from './components/Profile';
export const Router = props => {
const { history } = props;
return (
<ConnectedRouter history={history}>
<div>
<Header />
<Switch>
<Route path="/" component={Main} />
<Route path="/login" component={Login} />
<Route path="/about" component={About} />
<Route path="/contact" component={Contact} />
<PrivateRoute path="/profile" component={Profile}/>
</Switch>
</div>
</ConnectedRouter>
);
}