Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide or Inactivate Steps #161

Open
apurvsamant opened this issue May 25, 2020 · 2 comments
Open

Hide or Inactivate Steps #161

apurvsamant opened this issue May 25, 2020 · 2 comments

Comments

@apurvsamant
Copy link

Hi, Firstly thanks a lot for creating the Stepzilla package as it's very useful and helpful. I had a question with regards to controlling the steps:

Can you please let me know if there's a way to control steps? For eg: On selection of a specific value from a dropdown list in Step 1 can make Stpe 2 inactive or hide it

@Naghal
Copy link

Naghal commented Feb 22, 2021

Hi, here is how I managed to achieve it.

const getSteps = () => {
    return [
      { name: <><FaList /> {t('prp.agreement_details')}</>, component: <AgreementDetails inputProps={inputProps} file={getFile()} paymentIntervals={paymentIntervals} /> },
      ... inputProps('numberOfPayments').value > 1 ? [{ name: <><FaMoneyBillAlt/> {t('prp.employment_info')}</>, component: <EmploymentInfo inputProps={inputProps} cities={cities} states={states} /> }] : [],
      { name: <><FaSearch /> {t('prp.review')}</>, component: <Review inputProps={inputProps} valid={valid} isSubmitting={isSubmitting} file={getFile()} /> },
    ];
  }

 return (
  <div>
    <Stepper steps={getSteps()} dontValidate />
  </div>
  );

@apurvsamant
Copy link
Author

Thanks a lot for the reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants