2017-01-03 00:09:57 +11:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import ColumnSettings from '../components/column_settings';
|
2017-01-11 03:25:10 +11:00
|
|
|
import { changeSetting, saveSettings } from '../../../actions/settings';
|
2017-01-03 00:09:57 +11:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
2017-05-21 01:31:47 +10:00
|
|
|
settings: state.getIn(['settings', 'notifications']),
|
2017-01-03 00:09:57 +11:00
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
|
|
|
|
onChange (key, checked) {
|
2017-01-10 00:00:55 +11:00
|
|
|
dispatch(changeSetting(['notifications', ...key], checked));
|
2017-01-11 03:25:10 +11:00
|
|
|
},
|
|
|
|
|
|
|
|
onSave () {
|
|
|
|
dispatch(saveSettings());
|
2017-05-21 01:31:47 +10:00
|
|
|
},
|
2017-01-03 00:09:57 +11:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
|