gab-social/app/javascript/gabsocial/features/community_timeline/containers/column_settings_container.js

18 lines
492 B
JavaScript
Raw Normal View History

2019-07-02 08:10:25 +01:00
import { connect } from 'react-redux';
import ColumnSettings from '../components/column_settings';
import { changeSetting } from '../../../actions/settings';
2019-07-10 19:20:31 +01:00
const mapStateToProps = state => ({
settings: state.getIn(['settings', 'community']),
});
2019-07-02 08:10:25 +01:00
2019-07-10 19:20:31 +01:00
const mapDispatchToProps = (dispatch) => {
2019-07-02 08:10:25 +01:00
return {
onChange (key, checked) {
2019-07-10 19:20:31 +01:00
dispatch(changeSetting(['community', ...key], checked));
2019-07-02 08:10:25 +01:00
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);