Merge pull request #823 from stianjensen/checkbox-style-prop
Apply Checkbox style property to internal .checkold
commit
82c613a53f
|
@ -2,11 +2,12 @@ import React, { PropTypes } from 'react';
|
|||
import classnames from 'classnames';
|
||||
|
||||
const factory = (ripple) => {
|
||||
const Check = ({checked, children, onMouseDown, theme}) => (
|
||||
const Check = ({checked, children, onMouseDown, theme, style}) => (
|
||||
<div
|
||||
data-react-toolbox='check'
|
||||
className={classnames(theme.check, { [theme.checked]: checked })}
|
||||
onMouseDown={onMouseDown}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
@ -19,7 +20,8 @@ const factory = (ripple) => {
|
|||
theme: PropTypes.shape({
|
||||
check: PropTypes.string,
|
||||
checked: PropTypes.string
|
||||
})
|
||||
}),
|
||||
style: PropTypes.object
|
||||
};
|
||||
|
||||
return ripple(Check);
|
||||
|
|
|
@ -47,7 +47,7 @@ const factory = (Check) => {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { onChange, theme, ...others } = this.props; //eslint-disable-line no-unused-vars
|
||||
const { onChange, theme, style, ...others } = this.props; //eslint-disable-line no-unused-vars
|
||||
const className = classnames(theme.field, {
|
||||
[theme.disabled]: this.props.disabled
|
||||
}, this.props.className);
|
||||
|
@ -66,6 +66,7 @@ const factory = (Check) => {
|
|||
checked={this.props.checked}
|
||||
disabled={this.props.disabled}
|
||||
rippleClassName={theme.ripple}
|
||||
style={style}
|
||||
theme={this.props.theme}
|
||||
/>
|
||||
{this.props.label ? <span data-react-toolbox='label' className={theme.text}>{this.props.label}</span> : null}
|
||||
|
|
Loading…
Reference in New Issue