mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-12 00:31:11 -05:00
26 lines
654 B
JavaScript
26 lines
654 B
JavaScript
const classNames = require('classnames');
|
|
const PropTypes = require('prop-types');
|
|
const React = require('react');
|
|
|
|
require('./toggle-slider.scss');
|
|
|
|
const ToggleSlider = props => (
|
|
<label className={classNames('toggle-switch', props.className)} >
|
|
<input
|
|
checked={props.checked}
|
|
disabled={props.disabled}
|
|
type="checkbox"
|
|
onChange={props.onChange}
|
|
/>
|
|
<span className="slider" />
|
|
</label>
|
|
);
|
|
|
|
ToggleSlider.propTypes = {
|
|
checked: PropTypes.bool,
|
|
disabled: PropTypes.bool,
|
|
className: PropTypes.string,
|
|
onChange: PropTypes.func
|
|
};
|
|
|
|
module.exports = ToggleSlider;
|