1 | import React, { Component } from "react";
|
2 | import { hot } from "react-hot-loader";
|
3 | import { Router, Route, Switch } from "react-router-dom";
|
4 |
|
5 | import history from "./history";
|
6 | import ProtectedRoute from "./containers/protect";
|
7 |
|
8 | import Home from "./containers/home";
|
9 | import PetStore from "./containers/pet-store";
|
10 | import Github from "./containers/github";
|
11 | import Login from "./containers/login";
|
12 |
|
13 | class App extends Component {
|
14 | render() {
|
15 | return (
|
16 | <Router history={history}>
|
17 | <Switch>
|
18 | <ProtectedRoute path="/" exact component={Home} />
|
19 | <ProtectedRoute path="/pet-store" component={PetStore} />
|
20 | <Route path="/github" component={Github} />
|
21 | <Route path="/login" component={Login} />
|
22 | </Switch>
|
23 | </Router>
|
24 | );
|
25 | }
|
26 | }
|
27 |
|
28 | export default hot(module)(App);
|