Merge pull request #823 from stianjensen/checkbox-style-prop

Apply Checkbox style property to internal .check
old
Javi Velasco 2016-10-03 10:03:28 +02:00 committed by GitHub
commit 82c613a53f
2 changed files with 6 additions and 3 deletions

View File

@ -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);

View File

@ -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}