Skip to content

Commit

Permalink
fix: List component input spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s committed Sep 3, 2024
1 parent 6a87ee2 commit 55c1979
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Box from "@mui/material/Box";
import { SxProps, Theme } from "@mui/material/styles";
import { styled } from "@mui/material/styles";
import { FormikProps } from "formik";
import React from "react";
import InputRow from "ui/shared/InputRow";
Expand All @@ -20,6 +21,13 @@ interface SchemaFieldsProps {
sx?: SxProps<Theme>;
}

const ListRows = styled(Box)(({ theme }) => ({
padding: theme.spacing(1, 0),
display: "flex",
flexDirection: "column",
gap: theme.spacing(1.5),
}));

/**
* Display a set of fields for the provided schema
*/
Expand All @@ -29,11 +37,11 @@ export const SchemaFields: React.FC<SchemaFieldsProps> = ({
sx,
activeIndex = 0,
}) => (
<Box sx={sx}>
<ListRows sx={sx}>
{schema.fields.map((field, i) => (
<InputRow key={i}>
<InputFields {...field} activeIndex={activeIndex} formik={formik} />
</InputRow>
))}
</Box>
</ListRows>
);

0 comments on commit 55c1979

Please sign in to comment.