import React from 'react'; import Toggle from 'react-toggle'; import classNames from 'classnames'; export default class Switch extends Toggle { render() { const { className, icons: _icons, ariaLabelledBy, ariaDescribedBy, ariaLabel, ariaDesc, ...inputProps, } = this.props; const classes = classNames('react-toggle', { 'react-toggle--checked': this.state.checked, 'react-toggle--focus': this.state.hasFocus, 'react-toggle--disabled': this.props.disabled, }, className); return (
ON
OFF
{ this.input = ref }} onFocus={this.handleFocus} onBlur={this.handleBlur} className='react-toggle-screenreader-only' type='checkbox' tabIndex='0' aria-labelledby={ariaLabelledBy} aria-describedby={ariaDescribedBy}/>
); } };