refactor(frontend): moved `tabs` constant to form utils

pull/85/head
Samuel Rowe 3 years ago
parent 8cdab9c727
commit e29b4595c2

@ -7,6 +7,7 @@ import { CallbackFunction } from "../../../types";
import {
getFinalValues,
getInitialValues,
tabs,
validationSchema
} from "./form-utils";
import Build from "./Build";
@ -17,27 +18,6 @@ interface IModalServiceProps {
onAddEndpoint: CallbackFunction;
}
const tabs = [
{
name: "General",
href: "#",
current: true,
hidden: false
},
{
name: "Data",
href: "#",
current: false,
hidden: false
},
{
name: "Build",
href: "#",
current: false,
hidden: false
}
];
const FormContainer = styled("div")`
width: 640px;
height: 800px;

@ -8,7 +8,8 @@ import type { CallbackFunction, IServiceNodeItem } from "../../../types";
import {
getInitialValues,
getFinalValues,
validationSchema
validationSchema,
tabs
} from "./form-utils";
export interface IModalServiceProps {
@ -17,21 +18,6 @@ export interface IModalServiceProps {
onUpdateEndpoint: CallbackFunction;
}
const tabs = [
{
name: "General",
href: "#",
current: true,
hidden: false
},
{
name: "Data",
href: "#",
current: false,
hidden: false
}
];
const ModalServiceEdit = (props: IModalServiceProps) => {
const { node, onHide, onUpdateEndpoint } = props;
const [openTab, setOpenTab] = useState("General");

@ -9,6 +9,27 @@ import {
pruneString
} from "../../../utils/forms";
export const tabs = [
{
name: "General",
href: "#",
current: true,
hidden: false
},
{
name: "Data",
href: "#",
current: false,
hidden: false
},
{
name: "Build",
href: "#",
current: false,
hidden: false
}
];
const initialValues: IEditServiceForm = {
build: {
context: "",

Loading…
Cancel
Save