react-toolbox/spec/components/switch.jsx

23 lines
632 B
React
Raw Normal View History

import React from 'react';
2015-09-21 11:01:52 +03:00
import Switch from '../../components/switch';
2015-10-22 02:31:17 +03:00
class SwitchTest extends React.Component {
handleChange = (event, instance) => {
2015-10-07 23:24:02 +03:00
console.log('[Switch] Changed', instance.getValue());
2015-10-22 02:31:17 +03:00
};
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-22 02:31:17 +03:00
<Switch checked label="Mail notifications" onChange={this.handleChange} />
2015-10-07 23:24:02 +03:00
<Switch disabled label="Nothing, thanks"/>
2015-09-21 11:01:52 +03:00
</section>
);
}
2015-10-21 13:25:07 +03:00
}
2015-10-22 02:31:17 +03:00
export default SwitchTest;