The code powering m.abunchtell.com https://m.abunchtell.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

20 rader
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);