2017-05-31 00:36:52 +04:00
|
|
|
import GenerateWalletPasswordComponent from './components/GenerateWalletPasswordComponent';
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import {connect} from 'react-redux';
|
2017-04-27 01:15:07 -05:00
|
|
|
import {
|
|
|
|
GENERATE_WALLET_FILE_ACTION,
|
|
|
|
GENERATE_WALLET_HAS_DOWNLOADED_FILE_ACTION,
|
|
|
|
SHOW_GENERATE_WALLET_PASSWORD_ACTION,
|
|
|
|
GENERATE_WALLET_CONTINUE_TO_PAPER_ACTION
|
2017-05-31 00:36:52 +04:00
|
|
|
} from 'actions/generateWallet';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-04-12 00:04:27 -05:00
|
|
|
|
2017-04-26 22:58:01 -05:00
|
|
|
class GenerateWallet extends Component {
|
2017-04-12 00:04:27 -05:00
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
}
|
|
|
|
|
|
|
|
static propTypes = {
|
2017-04-18 17:58:19 -05:00
|
|
|
generateWalletPassword: PropTypes.object,
|
|
|
|
showPassword: PropTypes.bool,
|
2017-04-27 01:15:07 -05:00
|
|
|
hasDownloadedWalletFile: PropTypes.bool,
|
2017-04-18 17:58:19 -05:00
|
|
|
showGenerateWalletPasswordAction: PropTypes.func,
|
|
|
|
generateWalletFileAction: PropTypes.func,
|
2017-04-27 01:15:07 -05:00
|
|
|
generateWalletHasDownloadedFileAction: PropTypes.func,
|
|
|
|
generateWalletFile: PropTypes.bool,
|
|
|
|
generateWalletContinueToPaperAction: PropTypes.func,
|
|
|
|
canProceedToPaper: PropTypes.bool
|
2017-04-12 00:04:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2017-04-27 01:15:07 -05:00
|
|
|
<GenerateWalletPasswordComponent {...this.props}/>
|
2017-04-12 00:04:27 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapStateToProps(state) {
|
2017-04-18 17:58:19 -05:00
|
|
|
return {
|
|
|
|
generateWalletPassword: state.form.generateWalletPassword,
|
|
|
|
generateWalletFile: state.generateWallet.generateWalletFile,
|
2017-04-27 01:15:07 -05:00
|
|
|
showPassword: state.generateWallet.showPassword,
|
|
|
|
hasDownloadedWalletFile: state.generateWallet.hasDownloadedWalletFile,
|
|
|
|
canProceedToPaper: state.generateWallet.canProceedToPaper
|
2017-04-18 17:58:19 -05:00
|
|
|
}
|
2017-04-12 00:04:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
return {
|
2017-04-18 17:58:19 -05:00
|
|
|
showGenerateWalletPasswordAction: () => {
|
|
|
|
dispatch(SHOW_GENERATE_WALLET_PASSWORD_ACTION())
|
|
|
|
},
|
|
|
|
generateWalletFileAction: () => {
|
|
|
|
dispatch(GENERATE_WALLET_FILE_ACTION())
|
2017-04-27 01:15:07 -05:00
|
|
|
},
|
|
|
|
generateWalletHasDownloadedFileAction: () => {
|
|
|
|
dispatch(GENERATE_WALLET_HAS_DOWNLOADED_FILE_ACTION())
|
|
|
|
},
|
|
|
|
generateWalletContinueToPaperAction: () => {
|
|
|
|
dispatch(GENERATE_WALLET_CONTINUE_TO_PAPER_ACTION())
|
2017-04-12 00:04:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-26 22:58:01 -05:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(GenerateWallet)
|