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 { import {
getFinalValues, getFinalValues,
getInitialValues, getInitialValues,
tabs,
validationSchema validationSchema
} from "./form-utils"; } from "./form-utils";
import Build from "./Build"; import Build from "./Build";
@ -17,27 +18,6 @@ interface IModalServiceProps {
onAddEndpoint: CallbackFunction; 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")` const FormContainer = styled("div")`
width: 640px; width: 640px;
height: 800px; height: 800px;

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

@ -9,6 +9,27 @@ import {
pruneString pruneString
} from "../../../utils/forms"; } 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 = { const initialValues: IEditServiceForm = {
build: { build: {
context: "", context: "",

Loading…
Cancel
Save