2017-06-29 08:00:54 +03:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { changeLocalSetting } from '../../../actions/local_settings';
|
|
|
|
import { closeModal } from '../../../actions/modal';
|
|
|
|
import SettingsModal from '../components/settings_modal';
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
settings: state.get('local_settings'),
|
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
toggleSetting (setting, e) {
|
|
|
|
dispatch(changeLocalSetting(setting, e.target.checked));
|
|
|
|
},
|
2017-07-04 05:51:00 +03:00
|
|
|
changeSetting (setting, e) {
|
|
|
|
dispatch(changeLocalSetting(setting, e.target.value));
|
|
|
|
},
|
2017-06-29 08:00:54 +03:00
|
|
|
onClose () {
|
|
|
|
dispatch(closeModal());
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SettingsModal);
|