MyCrypto/common/containers/Tabs/index.jsx

45 lines
978 B
React
Raw Normal View History

2017-04-12 05:04:27 +00:00
import React, {Component} from 'react'
import {connect} from 'react-redux'
import GenerateWallet from './GenerateWallet/components'
2017-04-12 05:04:27 +00:00
import {GET_STATISTICS} from 'actions/dashboard'
class Tabs extends Component {
2017-04-12 05:04:27 +00:00
constructor(props) {
super(props)
}
static propTypes = {
statistics: React.PropTypes.array,
getStatistics: React.PropTypes.func.isRequired
}
componentDidMount() {
this.props.getStatistics()
}
render() {
let {statistics} = this.props
let props = {statistics}
return (
<GenerateWallet {...props}/>
2017-04-12 05:04:27 +00:00
)
}
}
function mapStateToProps(state) {
return {statistics: state.dashboard.statistics}
}
function mapDispatchToProps(dispatch) {
return {
getStatistics: async () => {
let result = await dispatch(GET_STATISTICS)
dispatch(result)
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Tabs)