Commit fecfe694 authored by Yannis Barlas's avatar Yannis Barlas

feat(ui): give readonly option to radio and checkbox

parent 2a900684
Pipeline #8526 failed with stages
in 12 minutes and 28 seconds
......@@ -23,6 +23,8 @@ const Root = styled.label`
`
const Checkbox = ({
className,
disabled,
inline,
name,
value,
......@@ -34,9 +36,10 @@ const Checkbox = ({
checked = checked || false
return (
<Root checked={checked} inline={inline}>
<Root checked={checked} className={className} inline={inline}>
<Input
checked={checked}
disabled={disabled}
name={name}
onChange={onChange}
required={required}
......
......@@ -21,6 +21,7 @@ const Root = styled.label`
`
const Radio = ({
className,
disabled,
color,
inline,
name,
......@@ -29,12 +30,11 @@ const Radio = ({
checked,
required,
onChange,
readonly,
}) => (
<Root checked={checked} color={color} inline={inline}>
<Root checked={checked} className={className} color={color} inline={inline}>
<Input
checked={checked}
disabled={readonly}
disabled={disabled}
name={name}
onChange={onChange}
required={required}
......
......@@ -18,7 +18,7 @@ class RadioGroup extends React.Component {
}
render() {
const { inline, name, options, required } = this.props
const { className, disabled, inline, name, options, required } = this.props
const { value } = this.state
return (
......@@ -26,7 +26,9 @@ class RadioGroup extends React.Component {
{options.map(option => (
<Radio
checked={option.value === value}
className={className}
color={option.color}
disabled={disabled}
inline={inline}
key={option.value}
label={option.label}
......
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