react-toolbox/spec/components/switch.jsx

23 lines
658 B
React
Raw Normal View History

import React from 'react';
2015-10-21 09:13:24 +03:00
import autobind from 'autobind-decorator'
2015-09-21 11:01:52 +03:00
import Switch from '../../components/switch';
2015-10-21 09:13:24 +03:00
@autobind
export default class SwitchTest extends React.Component {
2015-09-21 11:01:52 +03:00
onChange (event, instance) {
2015-10-07 23:24:02 +03:00
console.log('[Switch] Changed', instance.getValue());
}
2015-09-21 11:01:52 +03:00
render () {
return (
<section>
2015-10-07 23:24:02 +03:00
<h5>Switches</h5>
<p style={{marginBottom: '10px'}}>This is more beautiful than the old fashion checkboxes...</p>
<Switch label="Push notifications" />
2015-10-21 09:42:06 +03:00
<Switch checked label="Mail notifications" onChange={this.onChange} />
2015-10-07 23:24:02 +03:00
<Switch disabled label="Nothing, thanks"/>
2015-09-21 11:01:52 +03:00
</section>
);
}
};