Skip to content

Commit

Permalink
fix spacing of body3 (#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
agalin920 authored Apr 19, 2024
1 parent ab74308 commit ca4c427
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
57 changes: 34 additions & 23 deletions src/apps/schema/src/app/components/AddFieldModal/DefaultValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
FormHelperText,
Checkbox,
Typography,
FormControlLabel,
} from "@mui/material";
import { FormValue } from "./views/FieldForm";
import { MaxLengths } from "../../../../../content-editor/src/app/components/Editor/Editor";
Expand Down Expand Up @@ -40,32 +41,42 @@ export const DefaultValue = ({
options,
}: DefaultValueProps) => {
return (
<Box display="flex" gap={1}>
<Checkbox
data-cy="DefaultValueCheckbox"
checked={isDefaultValueEnabled}
size="small"
sx={{ width: "24px", height: "24px" }}
onChange={(event) => {
setIsDefaultValueEnabled(event.target.checked);
if (!event.target.checked) {
onChange(null);
setIsDefaultValueEnabled(false);
}
<Box>
<FormControlLabel
sx={{
alignItems: "flex-start",
}}
control={
<Checkbox
data-cy="DefaultValueCheckbox"
checked={isDefaultValueEnabled}
size="small"
onChange={(event) => {
setIsDefaultValueEnabled(event.target.checked);
if (!event.target.checked) {
onChange(null);
setIsDefaultValueEnabled(false);
}
}}
/>
}
label={
<Box>
<Typography variant="body2" fontWeight="600">
Default Value
</Typography>
<Typography
variant="body3"
color="text.secondary"
fontWeight="600"
sx={{ mb: 1, display: "block" }}
>
Set a predefined value for this field
</Typography>
</Box>
}
/>
<Box flex={1}>
<Typography variant="body2" fontWeight="600">
Default Value
</Typography>
<Typography
variant="body3"
color="text.secondary"
fontWeight="600"
sx={{ mb: 1 }}
>
Set a predefined value for this field
</Typography>
{isDefaultValueEnabled && (
<FormControl error={!!error} fullWidth>
<DefaultValueInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ export const FieldFormInput = ({
});
}}
checked={Boolean(prefillData)}
sx={{
color: "grey.200",
pl: 1,
pt: 0,
}}
size="small"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ export const MediaRules = ({
control={
<Checkbox
data-cy={`MediaCheckbox_${rule.name}`}
sx={{
color: "grey.200",
pl: 1,
pt: 0,
}}
size="small"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
const { checked } = e.target;
Expand Down

0 comments on commit ca4c427

Please sign in to comment.