Skip to content
Snippets Groups Projects
Commit 0f5fafc1 authored by Jure's avatar Jure
Browse files

Merge branch 'disable-single-radio' into 'master'

feat(ui): can now disable a single radio in a group

See merge request pubsweet/pubsweet!414
parents f31797f8 026202c1
No related branches found
No related tags found
No related merge requests found
import React from 'react'
import styled from 'styled-components'
import styled, { css } from 'styled-components'
import { th, override } from '@pubsweet/ui-toolkit'
const Label = styled.span`
${props =>
props.disabled &&
css`
cursor: not-allowed;
`};
${override('ui.Label')};
${override('ui.Radio.Label')};
`
......@@ -41,7 +47,7 @@ const Radio = ({
type="radio"
value={value}
/>
<Label checked={checked} color={color}>
<Label checked={checked} color={color} disabled={disabled}>
{label}
</Label>
</Root>
......
......@@ -28,7 +28,7 @@ class RadioGroup extends React.Component {
checked={option.value === value}
className={className}
color={option.color}
disabled={disabled}
disabled={disabled || option.disabled}
inline={inline}
key={option.value}
label={option.label}
......
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