2019-02-01 17:03:43 -05:00
|
|
|
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}
|
2021-05-13 15:43:32 -04:00
|
|
|
disabled={props.disabled}
|
2019-02-01 17:03:43 -05:00
|
|
|
type="checkbox"
|
|
|
|
onChange={props.onChange}
|
|
|
|
/>
|
|
|
|
<span className="slider" />
|
|
|
|
</label>
|
|
|
|
);
|
|
|
|
|
|
|
|
ToggleSlider.propTypes = {
|
|
|
|
checked: PropTypes.bool,
|
2021-05-13 15:43:32 -04:00
|
|
|
disabled: PropTypes.bool,
|
2019-02-01 17:03:43 -05:00
|
|
|
className: PropTypes.string,
|
|
|
|
onChange: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ToggleSlider;
|