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 styles from './Onboarding.scss' const Onboarding = ({ onboarding: { step, alias, autopilot }, changeStep, submit, aliasProps, autopilotProps }) => { const renderStep = () => { switch (step) { case 1: return ( changeStep(2)} > ) case 2: return ( changeStep(1)} next={() => submit(alias, autopilot)} > ) default: return } } return (
{renderStep()}
) } Onboarding.propTypes = { onboarding: PropTypes.object.isRequired, aliasProps: PropTypes.object.isRequired, autopilotProps: PropTypes.object.isRequired, changeStep: PropTypes.func.isRequired, submit: PropTypes.func.isRequired } export default Onboarding