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
613 B
20 lines
613 B
![]()
8 years ago
|
import { connect } from 'react-redux';
|
||
|
import StatusCheckBox from '../components/status_check_box';
|
||
![]()
7 years ago
|
import { toggleStatusReport } from 'flavours/glitch/actions/reports';
|
||
![]()
7 years ago
|
import { Set as ImmutableSet } from 'immutable';
|
||
![]()
8 years ago
|
|
||
|
const mapStateToProps = (state, { id }) => ({
|
||
|
status: state.getIn(['statuses', id]),
|
||
![]()
7 years ago
|
checked: state.getIn(['reports', 'new', 'status_ids'], ImmutableSet()).includes(id),
|
||
![]()
8 years ago
|
});
|
||
|
|
||
|
const mapDispatchToProps = (dispatch, { id }) => ({
|
||
|
|
||
|
onToggle (e) {
|
||
|
dispatch(toggleStatusReport(id, e.target.checked));
|
||
![]()
7 years ago
|
},
|
||
![]()
8 years ago
|
|
||
|
});
|
||
|
|
||
|
export default connect(mapStateToProps, mapDispatchToProps)(StatusCheckBox);
|