MyCrypto/common/containers/Tabs/index.jsx

46 lines
1005 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'
import PropTypes from 'prop-types';
2017-04-12 05:04:27 +00:00
class Tabs extends Component {
2017-04-12 05:04:27 +00:00
constructor(props) {
super(props)
}
static propTypes = {
statistics: PropTypes.array,
getStatistics: PropTypes.func.isRequired
2017-04-12 05:04:27 +00:00
}
componentDidMount() {
// this.props.getStatistics()
2017-04-12 05:04:27 +00:00
}
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)