Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
feat(radio-group): add disabled prop (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
teug91 authored and varl committed Oct 7, 2019
1 parent 6350b21 commit e98d348
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/RadioGroup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ const RadioGroup = ({
valid,
value,
warning,
disabled,
}) => {
const statusProps = { error, warning, valid }
const statusProps = { error, warning, valid, disabled }
const radioStyle = inline ? inlineRadio : stackedRadio

return (
Expand Down Expand Up @@ -89,6 +90,9 @@ const RadioGroup = ({
.error {
color: ${theme.error};
}
.disabled {
color: ${theme.disabled};
}
`}</style>
</>
)
Expand All @@ -112,6 +116,7 @@ RadioGroup.propTypes = {
valid: statusPropType,
value: propTypes.any,
warning: statusPropType,
disabled: propTypes.bool,
}

RadioGroup.defaultProps = {
Expand Down
11 changes: 11 additions & 0 deletions stories/RadioGroup.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,16 @@ storiesOf('RadioGroup', module)
]}
error
/>
<br />
<RadioGroup
name="disabled"
label="Disabled"
value="red"
options={[
{ label: 'The red pill', value: 'red' },
{ label: 'The blue pill', value: 'blue' },
]}
disabled
/>
</>
))

0 comments on commit e98d348

Please sign in to comment.