From 07af619a60b7ed698d500472c17946c150e2fee7 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Thu, 16 Jul 2020 23:22:30 +0200 Subject: [PATCH] change wizard a bit --- components/wizard.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/components/wizard.js b/components/wizard.js index e0d831b..7fef7b3 100644 --- a/components/wizard.js +++ b/components/wizard.js @@ -22,7 +22,26 @@ function WizardInternal() { const isLastStep = currentStep === STEPS.length - 1 return ( -
+ { + event.preventDefault() + + const fd = new FormData(event.currentTarget) + for (const [key, value] of fd.entries()) { + console.log(key, value) + } + + console.log(state) + + return + + if (!isLastStep) { + dispatch({ type: ACTIONS.NEXT_STEP }) + return + } + dispatch({ type: ACTIONS.SUBMIT }) + }} + > {STEPS.map(({ id, component: Component }, index) => ( <>{currentStep === index && } ))} @@ -34,14 +53,8 @@ function WizardInternal() { Zurück )} - {!isLastStep && ( - - )} - {isLastStep && ( - - )} + {!isLastStep && } + {isLastStep && } ) }