Delete unused SettingsCheckbox component

This commit is contained in:
Alex Gleason 2022-08-08 17:44:12 -05:00
parent d511b673ae
commit 85786bc07d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 0 additions and 40 deletions

View File

@ -1,40 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
import { getSettings, changeSetting } from 'soapbox/actions/settings';
import { Checkbox } from 'soapbox/features/forms';
const mapStateToProps = state => ({
settings: getSettings(state),
});
export default @connect(mapStateToProps)
class SettingsCheckbox extends ImmutablePureComponent {
static propTypes = {
path: PropTypes.array.isRequired,
settings: ImmutablePropTypes.map.isRequired,
}
onChange = path => {
return e => {
this.props.dispatch(changeSetting(path, e.target.checked));
};
}
render() {
const { settings, path, ...props } = this.props;
return (
<Checkbox
checked={settings.getIn(path)}
onChange={this.onChange(path)}
{...props}
/>
);
}
}