ant-design/components/switch/index.jsx
2016-03-29 13:01:10 +07:00

19 lines
461 B
JavaScript

import RcSwitch from 'rc-switch';
import React from 'react';
import classNames from 'classnames';
export default class Switch extends React.Component {
static defaultProps = {
prefixCls: 'ant-switch',
}
render() {
const { prefixCls, size, className } = this.props;
const cls = classNames({
[className]: !!className,
[`${prefixCls}-small`]: size === 'small',
});
return <RcSwitch className={cls} {...this.props} />;
}
}