Skip to content

Commit

Permalink
chore:modified checkbox widget to have alignmemt option
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshmcg committed Oct 1, 2024
1 parent b6194b7 commit 528d26a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bciers/libs/components/src/form/widgets/CheckboxWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const CheckboxWidget: React.FC<WidgetProps> = ({
label,
value,
required,
uiSchema,
}) => {
const alignment = uiSchema?.["ui:options"]?.alignment || "center";

return (
<FormControlLabel
control={
Expand All @@ -23,9 +26,15 @@ const CheckboxWidget: React.FC<WidgetProps> = ({
onChange={(event: { target: { checked: any } }) =>
onChange(event.target.checked)
}
sx={{
...(alignment === "top" && { paddingTop: "2px" }),
}}
/>
}
label={label}
style={{
alignItems: alignment === "top" ? "flex-start" : "center",
}}
/>
);
};
Expand Down

0 comments on commit 528d26a

Please sign in to comment.