feat: add logic to continue for the last step
This commit is contained in:
parent
0b51bd6535
commit
260f23c714
|
@ -10,14 +10,24 @@ import Activation from './Activation/Activation'
|
||||||
import './layoutGradient.css'
|
import './layoutGradient.css'
|
||||||
import ValidatorBoxWrapper from './ValidatorBoxWrapper/ValidatorBoxWrapper'
|
import ValidatorBoxWrapper from './ValidatorBoxWrapper/ValidatorBoxWrapper'
|
||||||
import { Button } from '@status-im/components'
|
import { Button } from '@status-im/components'
|
||||||
|
import { useNavigate } from 'react-router-dom'
|
||||||
|
|
||||||
const ValidatorOnboarding = () => {
|
const ValidatorOnboarding = () => {
|
||||||
const [activeStep, setActiveStep] = useState(0)
|
const [activeStep, setActiveStep] = useState(0)
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const changeActiveStep = (step: number) => {
|
const changeActiveStep = (step: number) => {
|
||||||
setActiveStep(step)
|
setActiveStep(step)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const continueHandler = () => {
|
||||||
|
if (activeStep < 4) {
|
||||||
|
setActiveStep(activeStep + 1)
|
||||||
|
} else {
|
||||||
|
navigate('/')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="gradient-wrapper">
|
<div className="gradient-wrapper">
|
||||||
<YStack
|
<YStack
|
||||||
|
@ -43,7 +53,9 @@ const ValidatorOnboarding = () => {
|
||||||
{activeStep === 4 && <Activation />}
|
{activeStep === 4 && <Activation />}
|
||||||
</ValidatorBoxWrapper>
|
</ValidatorBoxWrapper>
|
||||||
<Stack style={{ alignItems: 'end', width: '100%', marginTop: '16px', zIndex: 999 }}>
|
<Stack style={{ alignItems: 'end', width: '100%', marginTop: '16px', zIndex: 999 }}>
|
||||||
<Button>Continue</Button>
|
<Button onPress={continueHandler}>
|
||||||
|
{activeStep < 4 ? 'Continue' : 'Continue to Dashboard'}
|
||||||
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</YStack>
|
</YStack>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue