chore: some more progress on the forms
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -17,10 +17,11 @@ import {
|
||||
Stepper as MuiStepper,
|
||||
Step as MuiStep,
|
||||
StepLabel as MuiStepLabel,
|
||||
Box,
|
||||
Button,
|
||||
makeStyles,
|
||||
} from '@material-ui/core';
|
||||
import { withTheme } from '@rjsf/core';
|
||||
import { Theme as MuiTheme } from '@rjsf/material-ui';
|
||||
import React, { useState } from 'react';
|
||||
import { TemplateParameterSchema } from '../../../types';
|
||||
|
||||
@@ -34,12 +35,17 @@ const useStyles = makeStyles(theme => ({
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'right',
|
||||
},
|
||||
formWrapper: {
|
||||
padding: theme.spacing(2),
|
||||
},
|
||||
}));
|
||||
|
||||
export interface StepperProps {
|
||||
manifest: TemplateParameterSchema;
|
||||
}
|
||||
|
||||
const Form = withTheme(MuiTheme);
|
||||
|
||||
export const Stepper = (props: StepperProps) => {
|
||||
const { steps } = props.manifest;
|
||||
const [activeStep, setActiveStep] = useState(0);
|
||||
@@ -56,7 +62,9 @@ export const Stepper = (props: StepperProps) => {
|
||||
</MuiStep>
|
||||
))}
|
||||
</MuiStepper>
|
||||
|
||||
<div className={styles.formWrapper}>
|
||||
<Form schema={steps[activeStep].schema} />
|
||||
</div>
|
||||
<div className={styles.footer}>
|
||||
<Button onClick={handleBack} className={styles.backButton}>
|
||||
Back
|
||||
|
||||
Reference in New Issue
Block a user