]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/report/containers/status_check_box_container.js
Improve eslint rules (#3147)
[mastodon.git] / app / javascript / mastodon / features / report / containers / status_check_box_container.js
1 import { connect } from 'react-redux';
2 import StatusCheckBox from '../components/status_check_box';
3 import { toggleStatusReport } from '../../../actions/reports';
4 import Immutable from 'immutable';
5
6 const mapStateToProps = (state, { id }) => ({
7 status: state.getIn(['statuses', id]),
8 checked: state.getIn(['reports', 'new', 'status_ids'], Immutable.Set()).includes(id),
9 });
10
11 const mapDispatchToProps = (dispatch, { id }) => ({
12
13 onToggle (e) {
14 dispatch(toggleStatusReport(id, e.target.checked));
15 },
16
17 });
18
19 export default connect(mapStateToProps, mapDispatchToProps)(StatusCheckBox);
This page took 0.077184 seconds and 4 git commands to generate.