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