2015-08-21 18:24:09 +08:00
|
|
|
import Radio from 'rc-radio';
|
|
|
|
import React from 'react';
|
2016-01-21 22:45:21 +08:00
|
|
|
import classNames from 'classnames';
|
2015-08-21 18:24:09 +08:00
|
|
|
|
2015-11-06 22:03:09 +08:00
|
|
|
const AntRadio = React.createClass({
|
2015-08-21 18:24:09 +08:00
|
|
|
getDefaultProps() {
|
|
|
|
return {
|
|
|
|
prefixCls: 'ant-radio'
|
|
|
|
};
|
|
|
|
},
|
|
|
|
render() {
|
2016-01-21 22:45:21 +08:00
|
|
|
const { prefixCls, children, checked, disabled, className } = this.props;
|
|
|
|
const classString = classNames({
|
|
|
|
[prefixCls]: true,
|
2016-02-17 18:04:42 +08:00
|
|
|
[`${prefixCls}-checked`]: checked,
|
|
|
|
[`${prefixCls}-disabled`]: disabled,
|
2016-01-21 22:45:21 +08:00
|
|
|
[className]: !!className,
|
|
|
|
});
|
2015-08-21 18:24:09 +08:00
|
|
|
return (
|
2015-08-21 19:16:03 +08:00
|
|
|
<label className={classString}>
|
2015-08-21 18:24:09 +08:00
|
|
|
<Radio {...this.props} children={null} />
|
2016-01-21 22:45:21 +08:00
|
|
|
{children}
|
2015-08-21 18:24:09 +08:00
|
|
|
</label>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default AntRadio;
|