2017-04-12 05:04:27 +00:00
|
|
|
import React, {Component} from 'react'
|
|
|
|
import {connect} from 'react-redux'
|
2017-04-14 01:30:11 +00:00
|
|
|
import GenerateWallet from './GenerateWallet/components'
|
2017-04-12 05:04:27 +00:00
|
|
|
import {GET_STATISTICS} from 'actions/dashboard'
|
2017-04-14 06:23:09 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-04-14 01:30:11 +00:00
|
|
|
class Tabs extends Component {
|
2017-04-12 05:04:27 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
}
|
|
|
|
|
|
|
|
static propTypes = {
|
2017-04-14 06:23:09 +00:00
|
|
|
statistics: PropTypes.array,
|
|
|
|
getStatistics: PropTypes.func.isRequired
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
2017-04-14 06:23:09 +00:00
|
|
|
// this.props.getStatistics()
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
let {statistics} = this.props
|
|
|
|
let props = {statistics}
|
|
|
|
|
|
|
|
return (
|
2017-04-14 01:30:11 +00:00
|
|
|
<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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-14 01:30:11 +00:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Tabs)
|