mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-01-21 00:40:09 +00:00
clear code
This commit is contained in:
parent
9ab31b1a57
commit
ce9b1ae391
@ -1,7 +1,7 @@
|
||||
import { Stepper, Step } from 'react-form-stepper'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { setActiveStep } from '../../../redux/ValidatorOnboarding/slice'
|
||||
|
||||
import { FORM_STEPS } from '../../../constants'
|
||||
import { useWindowSize } from '../../../hooks/useWindowSize'
|
||||
import './FormStepper.css'
|
||||
@ -11,7 +11,6 @@ type FormStepperProps = {
|
||||
}
|
||||
|
||||
const FormStepper = ({ activeStep }: FormStepperProps) => {
|
||||
const dispatch = useDispatch()
|
||||
const navigate = useNavigate()
|
||||
const windowSize = useWindowSize()
|
||||
|
||||
@ -64,10 +63,13 @@ const FormStepper = ({ activeStep }: FormStepperProps) => {
|
||||
|
||||
const changeStepOnClickHandler = (index: number) => {
|
||||
const path = stepToUrlMap[index]
|
||||
if (path) {
|
||||
if (path && index < activeStep) {
|
||||
navigate(path)
|
||||
}
|
||||
}
|
||||
if (activeStep > 1) {
|
||||
activeStep = activeStep < 6 ? 2 : activeStep - 3
|
||||
}
|
||||
|
||||
return (
|
||||
<Stepper
|
||||
|
Loading…
x
Reference in New Issue
Block a user