2018-11-06 23:19:17 +07:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import './App.css';
|
|
|
|
|
2019-01-11 03:43:21 +07:00
|
|
|
import { Router, Route, Switch } from "react-router-dom";
|
|
|
|
import { routes } from './routes/index';
|
|
|
|
import { createBrowserHistory } from 'history';
|
|
|
|
|
|
|
|
const history = createBrowserHistory();
|
2018-11-06 23:19:17 +07:00
|
|
|
|
|
|
|
class App extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2019-01-11 03:43:21 +07:00
|
|
|
<Router history={history}>
|
2018-11-06 23:19:17 +07:00
|
|
|
<div className="App">
|
2019-01-11 03:43:21 +07:00
|
|
|
<Switch>
|
|
|
|
{routes.map((r, key) => {
|
|
|
|
return <Route path={r.path} component={r.component} key={key}/>
|
|
|
|
})}
|
|
|
|
</Switch>
|
2018-11-06 23:19:17 +07:00
|
|
|
</div>
|
|
|
|
</Router>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|