Skip to content

Commit

Permalink
🪟 🔧 Fixed passed props to <CheckBoxControl /> which cause error in …
Browse files Browse the repository at this point in the history
…console (#20711)

* fixed sourceDefinitionId and destinationDefinitionId

* clean up props
  • Loading branch information
dizel852 committed Jan 12, 2023
1 parent 702027e commit f50d6f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,15 @@ export const PasswordField: React.FC<{ label?: React.ReactNode }> = ({ label })
);
};

export const NewsField: React.FC = () => {
const { formatMessage } = useIntl();
return (
<Field name="news">
{({ field, meta }: FieldProps<string>) => (
<MarginBlock>
<CheckBoxControl
{...field}
checked={!!field.value}
checkbox
label={<FormattedMessage id="login.subscribe" />}
message={meta.touched && meta.error && formatMessage({ id: meta.error })}
/>
</MarginBlock>
)}
</Field>
);
};
export const NewsField: React.FC = () => (
<Field name="news">
{({ field }: FieldProps<string>) => (
<MarginBlock>
<CheckBoxControl {...field} checked={!!field.value} label={<FormattedMessage id="login.subscribe" />} />
</MarginBlock>
)}
</Field>
);

export const Disclaimer: React.FC = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import styled from "styled-components";
import { CheckBox } from "components/ui/CheckBox";

type IProps = {
message?: React.ReactNode;
label?: React.ReactNode;
checkbox?: boolean;
} & React.InputHTMLAttributes<HTMLInputElement>;

const ToggleContainer = styled.div`
Expand Down

0 comments on commit f50d6f5

Please sign in to comment.