OSDN Git Service

pages restyle.
[bytom/bytom-electron.git] / src / Root.jsx
1 import React from 'react'
2 import { Provider } from 'react-redux'
3 import { applyRouterMiddleware, Router } from 'react-router'
4 import { history } from 'utility/environment'
5 import { syncHistoryWithStore } from 'react-router-redux'
6 import useScroll from 'react-router-scroll/lib/useScroll'
7
8 import makeRoutes from './routes'
9
10 export default class Root extends React.Component {
11   componentWillMount() {
12     document.title = 'Bytom Dashboard'
13   }
14
15   render() {
16     const store = this.props.store
17     const syncedHistory = syncHistoryWithStore(history, store)
18     return (
19       <Provider store={store}>
20         <Router
21           history={syncedHistory}
22           routes={makeRoutes(store)}
23           render={applyRouterMiddleware(useScroll())}
24         />
25       </Provider>
26     )
27   }
28 }