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