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