Skip to content

Commit

Permalink
ver. 0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
光弘 committed Sep 13, 2018
1 parent 207cc48 commit cff8768
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.12

* `CHANGED` fix `rc-switch` version to `~1.7.0` to avoid style breaking change
* `FIXED` some eslint error

## 0.1.8

* `CHANGED` support new prop `loading`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxcore-switch",
"version": "0.1.11",
"version": "0.1.12",
"description": "uxcore-switch component for uxcore.",
"repository": "https://github.com/uxcore/uxcore-switch.git",
"author": "eternalsky",
Expand Down Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"classnames": "^2.1.2",
"object-assign": "^4.0.0",
"rc-switch": "^1.6.0"
"rc-switch": "~1.7.0"
},
"contributors": [],
"license": "MIT"
Expand Down
11 changes: 8 additions & 3 deletions src/Switch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ import PropTypes from 'prop-types';

class Switch extends React.Component {
render() {
const { loading, className, disabled, ...otherProps } = this.props;
const {
loading, className, disabled, prefixCls, checkedChildren, unCheckedChildren, ...otherProps
} = this.props;
return (
<RcSwitch
{...otherProps}
prefixCls={prefixCls}
checkedChildren={checkedChildren}
unCheckedChildren={unCheckedChildren}
className={classnames({
[`${this.props.prefixCls}-loading`]: !!loading,
[`${this.props.prefixCls}-no-text`]: !this.props.checkedChildren && !this.props.unCheckedChildren,
[`${prefixCls}-loading`]: !!loading,
[`${prefixCls}-no-text`]: !checkedChildren && !unCheckedChildren,
[className]: !!className,
})}
disabled={disabled || loading}
Expand Down

0 comments on commit cff8768

Please sign in to comment.