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