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 55c1979 commit 3c06f99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 5 additions & 0 deletions editor.planx.uk/src/@planx/components/List/Public/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const ActiveListCard: React.FC<{
{!isPageComponent && ` ${i + 1}`}
</Typography>
<SchemaFields
sx={(theme) => ({
display: "flex",
flexDirection: "column",
gap: theme.spacing(2),
})}
schema={schema}
activeIndex={activeIndex}
formik={formik}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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 @@ -21,13 +20,6 @@ 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 @@ -37,11 +29,11 @@ export const SchemaFields: React.FC<SchemaFieldsProps> = ({
sx,
activeIndex = 0,
}) => (
<ListRows sx={sx}>
<Box sx={sx}>
{schema.fields.map((field, i) => (
<InputRow key={i}>
<InputFields {...field} activeIndex={activeIndex} formik={formik} />
</InputRow>
))}
</ListRows>
</Box>
);

0 comments on commit 3c06f99

Please sign in to comment.