From 924486984efae70afdb67a835cf30fef266b1c2d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 22 Apr 2020 22:08:12 -0500 Subject: [PATCH] Refactor SettingsCheckbox --- .../preferences/components/settings_checkbox.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/gabsocial/features/preferences/components/settings_checkbox.js b/app/gabsocial/features/preferences/components/settings_checkbox.js index 1cf2f9c0c..ec43537bb 100644 --- a/app/gabsocial/features/preferences/components/settings_checkbox.js +++ b/app/gabsocial/features/preferences/components/settings_checkbox.js @@ -14,26 +14,23 @@ export default @connect(mapStateToProps) class SettingsCheckbox extends ImmutablePureComponent { static propTypes = { - label: PropTypes.string, path: PropTypes.array.isRequired, settings: ImmutablePropTypes.map.isRequired, } - handleCheckboxSetting = path => { - const { dispatch } = this.props; - return (e) => { - dispatch(changeSetting(path, e.target.checked)); + onChange = path => { + return e => { + this.props.dispatch(changeSetting(path, e.target.checked)); }; } render() { - const { label, path, settings, ...props } = this.props; + const { settings, path, ...props } = this.props; return ( );