Commit fc2d2436 by Vladislav Lagunov

Удалена обертка из BooleanField

parent e89a1982
......@@ -8,7 +8,7 @@ import { StandardProps } from '@material-ui/core';
// Props
export type Props = StandardProps<React.HTMLProps<HTMLDivElement>, ClassKey, 'value'> & FieldProps<boolean> & {
export type Props = StandardProps<SwitchProps, ClassKey, 'value'|'disabled'> & FieldProps<boolean> & {
alignLeft?: boolean;
}
......@@ -28,16 +28,17 @@ class BooleanField extends React.Component<Props> {
[classes.alignLeft]: alignLeft,
});
return <div {...rest}>
return (
<Switch
{...rest}
className={rootClass}
checked={value}
onChange={this.handleChange}
disabled={disabled}
disabled={Boolean(disabled)}
data-rh-at="right"
data-rh={typeof(error) === 'string' || typeof(error) === 'function' ? typeof(error) === 'string' ? error : error(ctx) : undefined}
/>
</div>;
);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment