Commit fc2d2436 by Vladislav Lagunov

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

parent e89a1982
...@@ -8,7 +8,7 @@ import { StandardProps } from '@material-ui/core'; ...@@ -8,7 +8,7 @@ import { StandardProps } from '@material-ui/core';
// Props // Props
export type Props = StandardProps<React.HTMLProps<HTMLDivElement>, ClassKey, 'value'> & FieldProps<boolean> & { export type Props = StandardProps<SwitchProps, ClassKey, 'value'|'disabled'> & FieldProps<boolean> & {
alignLeft?: boolean; alignLeft?: boolean;
} }
...@@ -28,16 +28,17 @@ class BooleanField extends React.Component<Props> { ...@@ -28,16 +28,17 @@ class BooleanField extends React.Component<Props> {
[classes.alignLeft]: alignLeft, [classes.alignLeft]: alignLeft,
}); });
return <div {...rest}> return (
<Switch <Switch
{...rest}
className={rootClass} className={rootClass}
checked={value} checked={value}
onChange={this.handleChange} onChange={this.handleChange}
disabled={disabled} disabled={Boolean(disabled)}
data-rh-at="right" data-rh-at="right"
data-rh={typeof(error) === 'string' || typeof(error) === 'function' ? typeof(error) === 'string' ? error : error(ctx) : undefined} 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