mastodon/app/javascript/glitch/containers/settings/index.js

28 lines
730 B
JavaScript
Raw Normal View History

// Package imports //
2017-06-29 05:00:54 +00:00
import { connect } from 'react-redux';
// Mastodon imports //
import { closeModal } from '../../../mastodon/actions/modal';
// Our imports //
import { changeLocalSetting } from '../../actions/local_settings';
import Settings from '../../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));
},
changeSetting (setting, e) {
dispatch(changeLocalSetting(setting, e.target.value));
},
2017-06-29 05:00:54 +00:00
onClose () {
dispatch(closeModal());
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Settings);