Update types

[MAILPOET-3303]
This commit is contained in:
Pavel Dohnal
2020-12-01 10:50:19 +01:00
committed by Veljko V
parent 19e2e0a4f7
commit b6f62d91a0
4 changed files with 139 additions and 92 deletions

View File

@@ -40,19 +40,23 @@ const CheckboxGroup = ({
return (
<div>
{options.map(({ label, value, ...attributes }: CheckboxProps) => (
<Checkbox
checked={values.includes(value)}
key={label}
name={name}
value={value}
onCheck={(isChecked) => handleChange(value, isChecked)}
isFullWidth={isFullWidth}
{...attributes} // eslint-disable-line react/jsx-props-no-spreading
>
{label}
</Checkbox>
))}
{options.map((props: CheckboxProps) => {
const { label, ...attributes } = props;
const value = (props.value as CheckboxValueType);
return (
<Checkbox
checked={values.includes(value)}
key={label}
name={name}
value={value}
onCheck={(isChecked) => handleChange(value, isChecked)}
isFullWidth={isFullWidth}
{...attributes} // eslint-disable-line react/jsx-props-no-spreading
>
{label}
</Checkbox>
);
})}
</div>
);
};