-
Notifications
You must be signed in to change notification settings - Fork 503
/
index.js
40 lines (31 loc) · 1.06 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
38
39
40
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, shiftTrades } = this.props
return <Content empty={empty} search={search} pages={pages} onRefresh={this.handleRefresh} shiftTrades={shiftTrades} />
}
}
const mapStateToProps = state => ({
...getData(state)
})
const mapDispatchToProps = (dispatch) => ({
dataActions: bindActionCreators(actions.core.data.bitcoin, dispatch),
txActions: bindActionCreators(actions.components.btcTransactions, dispatch)
})
export default connect(mapStateToProps, mapDispatchToProps)(ContentContainer)