equal
deleted
inserted
replaced
4 import { Provider } from 'react-redux'; |
4 import { Provider } from 'react-redux'; |
5 import { createLogger } from 'redux-logger'; |
5 import { createLogger } from 'redux-logger'; |
6 import { createStore, applyMiddleware, compose } from 'redux'; |
6 import { createStore, applyMiddleware, compose } from 'redux'; |
7 |
7 |
8 import { rootReducer, actions } from 'dashboard-components'; |
8 import { rootReducer, actions } from 'dashboard-components'; |
|
9 |
|
10 import { dashboardId } from './config.json'; |
9 |
11 |
10 const { fetchAnnotations } = actions; |
12 const { fetchAnnotations } = actions; |
11 |
13 |
12 let middlewares = [thunkMiddleware]; |
14 let middlewares = [thunkMiddleware]; |
13 |
15 |
27 |
29 |
28 export default WrappedComponent => class extends Component { |
30 export default WrappedComponent => class extends Component { |
29 componentWillMount() { |
31 componentWillMount() { |
30 const apiUrl = process.env.REACT_APP_API_URL; |
32 const apiUrl = process.env.REACT_APP_API_URL; |
31 const discussionUrl = process.env.REACT_APP_DISCUSSION_URL; |
33 const discussionUrl = process.env.REACT_APP_DISCUSSION_URL; |
32 store.dispatch(fetchAnnotations(apiUrl, discussionUrl)); |
34 store.dispatch(fetchAnnotations(apiUrl, discussionUrl, dashboardId)); |
33 } |
35 } |
34 |
36 |
35 render() { |
37 render() { |
36 return <Provider store={store}><WrappedComponent {...this.props} /></Provider>; |
38 return <Provider store={store}><WrappedComponent {...this.props} /></Provider>; |
37 } |
39 } |