-
Notifications
You must be signed in to change notification settings - Fork 503
/
index.js
37 lines (29 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { getData } from './selectors'
import { actions } from 'data'
import Content from './template'
class ContentContainer extends React.PureComponent {
constructor (props) {
super(props)
this.handleRefresh = this.handleRefresh.bind(this)
}
componentDidMount () {
this.props.txActions.initialized()
}
handleRefresh () {
this.props.dataActions.fetchData()
this.props.txActions.initialized()
}
render () {
const { empty, pages, search } = this.props
return <Content empty={empty} search={search} pages={pages} onRefresh={this.handleRefresh} />
}
}
const mapStateToProps = state => getData(state)
const mapDispatchToProps = (dispatch) => ({
dataActions: bindActionCreators(actions.core.data.ethereum, dispatch),
txActions: bindActionCreators(actions.components.ethTransactions, dispatch)
})
export default connect(mapStateToProps, mapDispatchToProps)(ContentContainer)