tootlab-mastodon/app/javascript/glitch/components/settings/container.js
Surinna Curtis 7a77f7b3bb Add sourceRoot/includePaths to loaders
Use the settings modal as an example/testcase
2017-07-18 11:27:48 -07:00

28 lines
723 B
JavaScript

// Package imports //
import { connect } from 'react-redux';
// Mastodon imports //
import { closeModal } from 'mastodon/actions/modal';
// Our imports //
import { changeLocalSetting } from 'glitch/actions/local_settings';
import Settings from 'glitch/components/settings';
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));
},
onClose () {
dispatch(closeModal());
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Settings);