- Replace pb with alignSelf for checkbox position

This commit is contained in:
Shemy Gan committed 2024-11-19 11:31:22 -05:00
1 parent 5774d52179
commit b7186aa0ef
1 file changed
+2 -4
@@ -40,8 +40,6 @@ const Checkbox = ({
/* TODO move sizes to theme */ /* TODO move sizes to theme */
const sizes = { small: "14px", medium: "16px", large: "18px" }; const sizes = { small: "14px", medium: "16px", large: "18px" };
const theme = useTheme(); const theme = useTheme();
const checkBoxPosition = typeof label === "string" ? {} : { pb: "65px" };
return ( return (
<FormControlLabel <FormControlLabel
className="checkbox-wrapper" className="checkbox-wrapper"
@@ -56,9 +54,10 @@ const Checkbox = ({
"aria-label": "controlled checkbox", "aria-label": "controlled checkbox",
id: id, id: id,
}} }}
sx={{ sx={{
"&:hover": { backgroundColor: "transparent" }, "&:hover": { backgroundColor: "transparent" },
"& svg": { width: sizes[size], height: sizes[size] }, "& svg": { width: sizes[size], height: sizes[size] },
alignSelf: "flex-start",
}} }}
/> />
} }
@@ -71,7 +70,6 @@ const Checkbox = ({
width: theme.spacing(10), width: theme.spacing(10),
p: 0, p: 0,
mr: theme.spacing(6), mr: theme.spacing(6),
...checkBoxPosition,
}, },
"&:not(:has(.Mui-disabled)):hover": { "&:not(:has(.Mui-disabled)):hover": {
backgroundColor: theme.palette.background.accent, backgroundColor: theme.palette.background.accent,