Merge branch 'master' into stats
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Provider } from 'react-redux'
|
||||
import { ConnectedRouter } from 'react-router-redux'
|
||||
import { ConnectedRouter } from 'connected-react-router'
|
||||
|
||||
export default function Root({ store, history, children }) {
|
||||
return (
|
||||
|
@ -2,14 +2,14 @@
|
||||
import { createBrowserHistory } from 'history'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { routerMiddleware } from 'react-router-redux'
|
||||
import { routerMiddleware } from 'connected-react-router'
|
||||
import { applyMiddleware, createStore, compose } from 'redux'
|
||||
import thunk from 'redux-thunk'
|
||||
|
||||
import App from './components/App'
|
||||
import Root from './components/Root'
|
||||
import registerServiceWorker from './registerServiceWorker'
|
||||
import reducers from './reducers'
|
||||
import createRootReducer from './reducers'
|
||||
import { loadProfile } from './actions/user'
|
||||
|
||||
export const history = createBrowserHistory()
|
||||
@ -17,7 +17,7 @@ export const history = createBrowserHistory()
|
||||
export const rootNode = document.getElementById('root')
|
||||
|
||||
export const store = createStore(
|
||||
reducers,
|
||||
createRootReducer(history),
|
||||
window.__STATE__, // Server state
|
||||
(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(
|
||||
applyMiddleware(routerMiddleware(history), thunk)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { routerReducer } from 'react-router-redux'
|
||||
import { connectRouter } from 'connected-react-router'
|
||||
import { combineReducers } from 'redux'
|
||||
|
||||
import initial from './initial'
|
||||
@ -123,7 +123,7 @@ const user = (state = initial.user, action) => {
|
||||
const statistics = (state = initial.statistics, action) =>
|
||||
handleDataAndError(state, 'statistics', action)
|
||||
|
||||
const reducers = combineReducers({
|
||||
export default (history) => combineReducers({
|
||||
activities,
|
||||
calendarActivities,
|
||||
chartData,
|
||||
@ -132,10 +132,8 @@ const reducers = combineReducers({
|
||||
message,
|
||||
messages,
|
||||
records,
|
||||
router: routerReducer,
|
||||
router: connectRouter(history),
|
||||
sports,
|
||||
statistics,
|
||||
user,
|
||||
})
|
||||
|
||||
export default reducers
|
||||
|
Reference in New Issue
Block a user