MyCrypto/common/containers/Tabs/GenerateWallet/index.js

64 lines
2.1 KiB
JavaScript
Raw Normal View History

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