Skip to content

Commit

Permalink
feat(ui-commons): update style of Fieldset
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Sep 18, 2024
1 parent 11392cb commit c339870
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions webapp/src/components/common/Fieldset.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, BoxProps, Divider, Typography } from "@mui/material";
import { Box, BoxProps, Divider } from "@mui/material";
import * as RA from "ramda-adjunct";
import { mergeSxProp } from "../../utils/muiUtils";

Expand Down Expand Up @@ -30,7 +30,7 @@ function Fieldset(props: FieldsetProps) {
border: "none",
m: 0,
p: 0,
pb: 5,
pb: 4,
"> .MuiBox-root": {
display: "flex",
flexWrap: "wrap",
Expand All @@ -40,6 +40,10 @@ function Fieldset(props: FieldsetProps) {
m: 0,
},
},
// Increase padding from the last child
".Form__Content > &:last-child": {
pb: 2,
},
// Remove padding from the last child of the dialog content
".MuiDialogContent-root .Form__Content > &:last-child": {
pb: 0,
Expand All @@ -51,19 +55,14 @@ function Fieldset(props: FieldsetProps) {
{legend && (
<>
{RA.isString(legend) ? (
<Typography
variant="h5"
sx={{ fontSize: "1.25rem", fontWeight: 400, lineHeight: 1.334 }}
>
{legend}
</Typography>
<Box component="legend">{legend}</Box>
) : (
legend
)}
<Divider sx={{ mt: 1 }} />
</>
)}
<Box {...contentProps} sx={mergeSxProp({ pt: 1 }, contentProps?.sx)}>
<Box {...contentProps} sx={mergeSxProp({ pt: 3 }, contentProps?.sx)}>
{children}
</Box>
</Box>
Expand Down

0 comments on commit c339870

Please sign in to comment.