71 lines
1.9 KiB
React
Raw Normal View History

import React, {Component} from "react";
import {connect} from "react-redux";
import GenerateWallet from "./GenerateWallet/components";
import {GET_STATISTICS} from "actions/dashboard";
import {SHOW_GENERATE_WALLET_PASSWORD_ACTION, GENERATE_WALLET_FILE_ACTION} from "actions/generateWallet";
import PropTypes from "prop-types";
2017-04-12 00:04:27 -05:00
class Tabs extends Component {
2017-04-12 00:04:27 -05:00
constructor(props) {
super(props)
}
static propTypes = {
statistics: PropTypes.array,
generateWalletPassword: PropTypes.object,
showPassword: PropTypes.bool,
showGenerateWalletPasswordAction: PropTypes.func,
generateWalletFileAction: PropTypes.func,
generateWalletFile: PropTypes.bool
2017-04-12 00:04:27 -05:00
}
componentDidMount() {
// this.props.getStatistics()
2017-04-12 00:04:27 -05:00
}
render() {
let {
generateWalletPassword,
showPassword,
showGenerateWalletPasswordAction,
generateWalletFileAction,
generateWalletFile
} = this.props;
let props = {
generateWalletPassword,
showPassword,
showGenerateWalletPasswordAction,
generateWalletFileAction,
generateWalletFile
}
2017-04-12 00:04:27 -05:00
return (
<GenerateWallet {...props}/>
2017-04-12 00:04:27 -05:00
)
}
}
function mapStateToProps(state) {
return {
statistics: state.dashboard.statistics,
generateWalletPassword: state.form.generateWalletPassword,
generateWalletFile: state.generateWallet.generateWalletFile,
showPassword: state.generateWallet.showPassword
}
2017-04-12 00:04:27 -05:00
}
function mapDispatchToProps(dispatch) {
return {
showGenerateWalletPasswordAction: () => {
dispatch(SHOW_GENERATE_WALLET_PASSWORD_ACTION())
},
generateWalletFileAction: () => {
dispatch(GENERATE_WALLET_FILE_ACTION())
2017-04-12 00:04:27 -05:00
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Tabs)