import React from 'react' import PropTypes from 'prop-types' import LoadingBolt from 'components/LoadingBolt' import FormContainer from './FormContainer' import Alias from './Alias' import Autopilot from './Autopilot' import InitWallet from './InitWallet' import NewWalletSeed from './NewWalletSeed' import NewWalletPassword from './NewWalletPassword' import styles from './Onboarding.scss' const Onboarding = ({ onboarding: { step, alias, autopilot, startingLnd, createWalletPassword, seed }, changeStep, startLnd, submitNewWallet, aliasProps, initWalletProps, autopilotProps, newWalletSeedProps, newWalletPasswordProps }) => { const renderStep = () => { switch (step) { case 1: return ( changeStep(2)} > ) case 2: return ( changeStep(1)} next={() => startLnd(alias, autopilot)} > ) case 3: return ( changeStep(2)} next={null} > ) case 4: return ( changeStep(3)} next={() => changeStep(5)} > ) case 5: return ( changeStep(4)} next={() => submitNewWallet(createWalletPassword, seed)} > ) default: return } } if (startingLnd) { return } return (
{renderStep()}
) } Onboarding.propTypes = { onboarding: PropTypes.object.isRequired, aliasProps: PropTypes.object.isRequired, autopilotProps: PropTypes.object.isRequired, changeStep: PropTypes.func.isRequired, startLnd: PropTypes.func.isRequired } export default Onboarding