mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-08 17:43:48 +00:00
feat: map steps instead of use components
This commit is contained in:
parent
aedda4a9c5
commit
bc74b0a93a
@ -6,6 +6,15 @@ type FormStepperProps = {
|
|||||||
changeActiveStep: (step: number) => void
|
changeActiveStep: (step: number) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const steps = [
|
||||||
|
{ label: 'Overview', subtitle: 'Get Started' },
|
||||||
|
{ label: 'Advicsories', subtitle: 'Understand your Duties' },
|
||||||
|
{ label: 'Client Setup', subtitle: 'Execution & Consensus' },
|
||||||
|
{ label: 'Validator Setup', subtitle: 'Validators & Withdrawal' },
|
||||||
|
{ label: 'Key Generation', subtitle: 'Secure your Keypairs' },
|
||||||
|
{ label: 'Activation', subtitle: 'Complete Setup' },
|
||||||
|
]
|
||||||
|
|
||||||
const FormStepper = ({ activeStep, changeActiveStep }: FormStepperProps) => {
|
const FormStepper = ({ activeStep, changeActiveStep }: FormStepperProps) => {
|
||||||
return (
|
return (
|
||||||
<Stepper
|
<Stepper
|
||||||
@ -15,54 +24,17 @@ const FormStepper = ({ activeStep, changeActiveStep }: FormStepperProps) => {
|
|||||||
connectorStyleConfig={customConnectorStyle}
|
connectorStyleConfig={customConnectorStyle}
|
||||||
style={{ fontSize: '14px', zIndex: 999, width: '100%', padding: 0, marginBottom: '2rem' }}
|
style={{ fontSize: '14px', zIndex: 999, width: '100%', padding: 0, marginBottom: '2rem' }}
|
||||||
>
|
>
|
||||||
|
{steps.map((step, index) => (
|
||||||
<Step
|
<Step
|
||||||
label={'Overview'}
|
key={index}
|
||||||
|
label={step.label}
|
||||||
className="custom-step"
|
className="custom-step"
|
||||||
onClick={() => changeActiveStep(0)}
|
onClick={() => changeActiveStep(index)}
|
||||||
completed={activeStep >= 0}
|
completed={activeStep > index - 1}
|
||||||
data-subtitle="Get Started"
|
data-subtitle={step.subtitle}
|
||||||
data-step="Overview"
|
data-step={step.label}
|
||||||
/>
|
|
||||||
<Step
|
|
||||||
label="Advicsories"
|
|
||||||
className="custom-step"
|
|
||||||
onClick={() => changeActiveStep(1)}
|
|
||||||
completed={activeStep > 0}
|
|
||||||
data-subtitle="Understand your Duties"
|
|
||||||
data-step="Advicsories"
|
|
||||||
/>
|
|
||||||
<Step
|
|
||||||
label="Client Setup"
|
|
||||||
className="custom-step"
|
|
||||||
onClick={() => changeActiveStep(2)}
|
|
||||||
completed={activeStep > 1}
|
|
||||||
data-subtitle="Execution & Consensus"
|
|
||||||
data-step="Advicsories"
|
|
||||||
/>
|
|
||||||
<Step
|
|
||||||
label="Validator Setup"
|
|
||||||
className="custom-step"
|
|
||||||
onClick={() => changeActiveStep(3)}
|
|
||||||
completed={activeStep > 2}
|
|
||||||
data-subtitle="Validators & Withdrawal"
|
|
||||||
data-step="Validator Setup"
|
|
||||||
/>
|
|
||||||
<Step
|
|
||||||
label="Key Generation"
|
|
||||||
className="custom-step"
|
|
||||||
onClick={() => changeActiveStep(4)}
|
|
||||||
completed={activeStep > 3}
|
|
||||||
data-subtitle="Secure your Keypairs"
|
|
||||||
data-step="Key Generation"
|
|
||||||
/>
|
|
||||||
<Step
|
|
||||||
label="Activation"
|
|
||||||
className="custom-step"
|
|
||||||
onClick={() => changeActiveStep(5)}
|
|
||||||
completed={activeStep > 4}
|
|
||||||
data-subtitle="Complete Setup"
|
|
||||||
data-step="Activation"
|
|
||||||
/>
|
/>
|
||||||
|
))}
|
||||||
</Stepper>
|
</Stepper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user