chore: working some more on the review

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-08-19 13:46:24 +02:00
parent b5986929b7
commit d558c5bf09
@@ -35,6 +35,7 @@ const useStyles = makeStyles(theme => ({
backButton: {
marginRight: theme.spacing(1),
},
footer: {
display: 'flex',
flexDirection: 'row',
@@ -75,7 +76,7 @@ export const Stepper = (props: StepperProps) => {
}, [props.extensions]);
const validation = useMemo(() => {
return createAsyncValidators(steps[activeStep].mergedSchema, validators, {
return createAsyncValidators(steps[activeStep]?.mergedSchema, validators, {
apiHolder,
});
}, [steps, activeStep, validators, apiHolder]);
@@ -104,6 +105,10 @@ export const Stepper = (props: StepperProps) => {
setFormState(current => ({ ...current, ...formData }));
};
const handleCreate = () => {
// TODO(blam): Create the template in a modal with the ability to view the logs etc.
};
return (
<>
<MuiStepper activeStep={activeStep} alternativeLabel variant="elevation">
@@ -141,7 +146,21 @@ export const Stepper = (props: StepperProps) => {
</div>
</Form>
) : (
<ReviewState formState={formState} schemas={steps} />
<>
<ReviewState formState={formState} schemas={steps} />
<div className={styles.footer}>
<Button
onClick={handleBack}
className={styles.backButton}
disabled={activeStep < 1}
>
Back
</Button>
<Button variant="contained" onClick={handleCreate}>
Create
</Button>
</div>
</>
)}
</div>
</>