{content}
// @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
import * as generateWalletActions from 'actions/generateWallet';
import PropTypes from 'prop-types';
import EnterPassword from './components/EnterPassword';
import DownloadWallet from './components/DownloadWallet';
import PaperWallet from './components/PaperWallet';
import type PrivKeyWallet from 'libs/wallet/privkey';
import type { State } from 'reducers';
type Props = {
// FIXME union actual steps
activeStep: string,
password: string,
hasDownloadedWalletFile: boolean,
wallet: ?PrivKeyWallet
} & typeof generateWalletActions;
class GenerateWallet extends Component {
props: Props;
static propTypes = {
// Store state
activeStep: PropTypes.string,
wallet: PropTypes.object,
password: PropTypes.string,
hasDownloadedWalletFile: PropTypes.bool,
// Actions
showPasswordGenerateWallet: PropTypes.func,
generateUTCGenerateWallet: PropTypes.func,
downloadUTCGenerateWallet: PropTypes.func,
confirmContinueToPaperGenerateWallet: PropTypes.func,
resetGenerateWallet: PropTypes.func
};
componentWillUnmount() {
this.props.resetGenerateWallet();
}
render() {
const { activeStep, wallet, password } = this.props;
let content;
switch (activeStep) {
case 'password':
content =