You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
606 B

  1. import { connect } from 'react-redux';
  2. import StatusCheckBox from '../components/status_check_box';
  3. import { toggleStatusReport } from '../../../actions/reports';
  4. import { Set as ImmutableSet } from 'immutable';
  5. const mapStateToProps = (state, { id }) => ({
  6. status: state.getIn(['statuses', id]),
  7. checked: state.getIn(['reports', 'new', 'status_ids'], ImmutableSet()).includes(id),
  8. });
  9. const mapDispatchToProps = (dispatch, { id }) => ({
  10. onToggle (e) {
  11. dispatch(toggleStatusReport(id, e.target.checked));
  12. },
  13. });
  14. export default connect(mapStateToProps, mapDispatchToProps)(StatusCheckBox);