feat(frontend): added scroll view to network modals

pull/87/head
Samuel Rowe 3 years ago
parent 2f694a7f77
commit 22200bd056

@ -7,6 +7,7 @@ import { getInitialValues, tabs, validationSchema } from "./form-utils";
import { classNames } from "../../../utils/styles"; import { classNames } from "../../../utils/styles";
import { Button, styled } from "@mui/joy"; import { Button, styled } from "@mui/joy";
import { reportErrorsAndSubmit } from "../../../utils/forms"; import { reportErrorsAndSubmit } from "../../../utils/forms";
import { ScrollView } from "../../ScrollView";
interface ICreateNetworkModalProps { interface ICreateNetworkModalProps {
onCreateNetwork: CallbackFunction; onCreateNetwork: CallbackFunction;
@ -64,10 +65,10 @@ const CreateNetworkModal: FunctionComponent<ICreateNetworkModalProps> = (
</nav> </nav>
</div> </div>
<div className="relative px-4 py-3 flex-auto"> <ScrollView height="500px" className="relative px-4 py-3 flex-auto">
{openTab === "General" && <General />} {openTab === "General" && <General />}
{openTab === "IPAM" && <IPAM />} {openTab === "IPAM" && <IPAM />}
</div> </ScrollView>
<Actions> <Actions>
<Button <Button

@ -7,6 +7,7 @@ import { getInitialValues, tabs, validationSchema } from "./form-utils";
import { classNames } from "../../../utils/styles"; import { classNames } from "../../../utils/styles";
import { Button, styled } from "@mui/joy"; import { Button, styled } from "@mui/joy";
import { reportErrorsAndSubmit } from "../../../utils/forms"; import { reportErrorsAndSubmit } from "../../../utils/forms";
import { ScrollView } from "../../ScrollView";
interface IEditNetworkModalProps { interface IEditNetworkModalProps {
onUpdateNetwork: CallbackFunction; onUpdateNetwork: CallbackFunction;
@ -63,10 +64,13 @@ const EditNetworkModal = (props: IEditNetworkModalProps) => {
</nav> </nav>
</div> </div>
<div className="relative px-4 py-3 flex-auto max-h-96 overflow-y-auto"> <ScrollView
height="500px"
className="relative px-4 py-3 flex-auto max-h-96 overflow-y-auto"
>
{openTab === "General" && <General />} {openTab === "General" && <General />}
{openTab === "IPAM" && <IPAM />} {openTab === "IPAM" && <IPAM />}
</div> </ScrollView>
<Actions> <Actions>
<Button <Button

Loading…
Cancel
Save