glitchier-soc/app/javascript/mastodon/features/notifications/containers/column_settings_container.js

22 lines
544 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import ColumnSettings from '../components/column_settings';
2017-01-10 18:25:10 +02:00
import { changeSetting, saveSettings } from '../../../actions/settings';
const mapStateToProps = state => ({
settings: state.getIn(['settings', 'notifications']),
});
const mapDispatchToProps = dispatch => ({
onChange (key, checked) {
dispatch(changeSetting(['notifications', ...key], checked));
2017-01-10 18:25:10 +02:00
},
onSave () {
dispatch(saveSettings());
},
});
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);