From 456887fc80bfd30d3598ddc611feb044bb85d3cc Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 6 Oct 2023 13:54:36 +0300 Subject: [PATCH] improve code --- .../ValidatorOnboarding/ValidatorOnboarding.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx b/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx index a14e6d19..8b23d8b8 100644 --- a/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx +++ b/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx @@ -37,21 +37,12 @@ const ValidatorOnboarding = () => { const [isAdvisoriesComplete, setIsAdvisoriesComplete] = useState(false) const unicodeNumbers = ['➀', '➁', '➂', '➃', '➄', '➅'] - const advisoriesIcon = unicodeNumbers.map((number, index) => { - if (index <= subStepAdvisories) { - return '✓'; - } else { - return number; - } - }) - - + const advisoriesIcon = unicodeNumbers.map((number, index) => index <= subStepAdvisories ? '✓' : number) const changeActiveStep = (step: number) => { if (step < activeStep) { return setActiveStep(step) } - removeCopyPastePhraseInfoBox() removeConfirmPhraseStage() } @@ -61,6 +52,7 @@ const ValidatorOnboarding = () => { if (subStepAdvisories === 5) { setIsAdvisoriesComplete(true) setActiveStep(activeStep + 1) + setSubStepAdvisories(0) } return setSubStepAdvisories(subStepAdvisories + 1) } else if (activeStep === 4 && isConfirmPhraseStage === false) { @@ -120,7 +112,7 @@ const ValidatorOnboarding = () => { {activeStep === 0 && } - {activeStep === 1 && } + {activeStep === 1 && } {activeStep === 2 && } {activeStep === 3 && subStepValidatorSetup === 0 && }