logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

status_check_box_container.js (606B)


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