The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

20 lines
591 B

  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. const mapStateToProps = (state, { id }) => ({
  6. status: state.getIn(['statuses', id]),
  7. checked: state.getIn(['reports', 'new', 'status_ids'], Immutable.Set()).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);