clean up unused js parts
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
Paper,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { IChangeEvent, FormProps } from "@rjsf/core";
|
||||
import { IChangeEvent } from "@rjsf/core";
|
||||
import { Form } from "@rjsf/mui";
|
||||
import validator from "@rjsf/validator-ajv8";
|
||||
import toast from "react-hot-toast";
|
||||
@@ -54,7 +54,7 @@ export function CustomConfig(props: FormStepContentProps) {
|
||||
}
|
||||
return acc;
|
||||
}, {}),
|
||||
[schema],
|
||||
[schema]
|
||||
);
|
||||
|
||||
return isLoading ? (
|
||||
@@ -100,7 +100,7 @@ function ErrorList<
|
||||
}
|
||||
|
||||
function PureCustomConfig(props: PureCustomConfigProps) {
|
||||
const { schema, initialValues, formHooks } = props;
|
||||
const { schema, formHooks } = props;
|
||||
const { setValue, watch } = formHooks;
|
||||
|
||||
console.log({ schema });
|
||||
@@ -124,7 +124,7 @@ function PureCustomConfig(props: PureCustomConfigProps) {
|
||||
message: "invalid config",
|
||||
});
|
||||
toast.error(
|
||||
"Configuration is invalid. Please check the highlighted fields for details.",
|
||||
"Configuration is invalid. Please check the highlighted fields for details."
|
||||
);
|
||||
} else {
|
||||
formHooks.clearErrors("config");
|
||||
|
||||
@@ -5,19 +5,14 @@ import {
|
||||
Step,
|
||||
StepLabel,
|
||||
Stepper,
|
||||
Typography,
|
||||
useMediaQuery,
|
||||
useTheme,
|
||||
} from "@mui/material";
|
||||
import React, { ReactNode, useState } from "react";
|
||||
import { useForm, UseFormReturn } from "react-hook-form";
|
||||
import React, { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { CustomConfig } from "./customConfig";
|
||||
import { CreateMachineForm, FormStep } from "./interfaces";
|
||||
|
||||
const SC = (props: { children: ReactNode }) => {
|
||||
return <>{props.children}</>;
|
||||
};
|
||||
|
||||
export function CreateMachineForm() {
|
||||
const formHooks = useForm<CreateMachineForm>({
|
||||
defaultValues: {
|
||||
@@ -25,7 +20,7 @@ export function CreateMachineForm() {
|
||||
config: {},
|
||||
},
|
||||
});
|
||||
const { handleSubmit, control, watch, reset, formState } = formHooks;
|
||||
const { handleSubmit, reset } = formHooks;
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||
const [activeStep, setActiveStep] = useState<number>(0);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReactElement, ReactNode } from "react";
|
||||
import { ReactElement } from "react";
|
||||
import { UseFormReturn } from "react-hook-form";
|
||||
|
||||
export type StepId = "template" | "modules" | "config" | "save";
|
||||
|
||||
Reference in New Issue
Block a user