summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-07-19 22:15:58 +0100
committerAndrej Mihajlov <and@codeispoetry.ru>2017-07-21 09:53:55 +0100
commit9f107f383afd25def91d4886d22dc8ae0e4ca604 (patch)
tree21214a5abc75300c5eebc9e1d7698e2c09e9f90e
parent11ed5ecb29e2c8a90a442dd4eac31b8297fafd5f (diff)
downloadmullvadvpn-9f107f383afd25def91d4886d22dc8ae0e4ca604.tar.xz
mullvadvpn-9f107f383afd25def91d4886d22dc8ae0e4ca604.zip
Proxy props to underlying INPUT
-rw-r--r--app/components/Switch.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/components/Switch.js b/app/components/Switch.js
index c278cfbd2c..4f97c4d992 100644
--- a/app/components/Switch.js
+++ b/app/components/Switch.js
@@ -120,8 +120,14 @@ export default class Switch extends Component {
}
render(): React.Element<*> {
+ const { isOn, onChange, ...otherProps } = this.props; // eslint-disable-line no-unused-vars
+ let className = ('switch' + ' ' + (otherProps.className || '')).trim();
return (
- <input type="checkbox" ref={ this.onRef } className="switch" checked={ this.props.isOn }
+ <input { ...otherProps }
+ type="checkbox"
+ ref={ this.onRef }
+ className={ className }
+ checked={ isOn }
onMouseDown={ this.handleMouseDown }
onChange={ this.handleChange } />
);