improve code

This commit is contained in:
Hristo Nedelkov 2023-10-06 13:54:36 +03:00
parent 2523319f69
commit 456887fc80
1 changed files with 3 additions and 11 deletions

View File

@ -37,21 +37,12 @@ const ValidatorOnboarding = () => {
const [isAdvisoriesComplete, setIsAdvisoriesComplete] = useState(false) const [isAdvisoriesComplete, setIsAdvisoriesComplete] = useState(false)
const unicodeNumbers = ['➀', '➁', '➂', '➃', '➄', '➅'] const unicodeNumbers = ['➀', '➁', '➂', '➃', '➄', '➅']
const advisoriesIcon = unicodeNumbers.map((number, index) => { const advisoriesIcon = unicodeNumbers.map((number, index) => index <= subStepAdvisories ? '✓' : number)
if (index <= subStepAdvisories) {
return '✓';
} else {
return number;
}
})
const changeActiveStep = (step: number) => { const changeActiveStep = (step: number) => {
if (step < activeStep) { if (step < activeStep) {
return setActiveStep(step) return setActiveStep(step)
} }
removeCopyPastePhraseInfoBox() removeCopyPastePhraseInfoBox()
removeConfirmPhraseStage() removeConfirmPhraseStage()
} }
@ -61,6 +52,7 @@ const ValidatorOnboarding = () => {
if (subStepAdvisories === 5) { if (subStepAdvisories === 5) {
setIsAdvisoriesComplete(true) setIsAdvisoriesComplete(true)
setActiveStep(activeStep + 1) setActiveStep(activeStep + 1)
setSubStepAdvisories(0)
} }
return setSubStepAdvisories(subStepAdvisories + 1) return setSubStepAdvisories(subStepAdvisories + 1)
} else if (activeStep === 4 && isConfirmPhraseStage === false) { } else if (activeStep === 4 && isConfirmPhraseStage === false) {