[Glitch] Change report modal to include category selection in web UI
Port a9a43de6d1 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import StatusCheckBox from '../components/status_check_box';
|
||||
import { toggleStatusReport } from 'flavours/glitch/actions/reports';
|
||||
import { Set as ImmutableSet } from 'immutable';
|
||||
import { makeGetStatus } from 'flavours/glitch/selectors';
|
||||
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
status: state.getIn(['statuses', id]),
|
||||
checked: state.getIn(['reports', 'new', 'status_ids'], ImmutableSet()).includes(id),
|
||||
});
|
||||
const makeMapStateToProps = () => {
|
||||
const getStatus = makeGetStatus();
|
||||
|
||||
const mapDispatchToProps = (dispatch, { id }) => ({
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
status: getStatus(state, { id }),
|
||||
});
|
||||
|
||||
onToggle (e) {
|
||||
dispatch(toggleStatusReport(id, e.target.checked));
|
||||
},
|
||||
return mapStateToProps;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(StatusCheckBox);
|
||||
export default connect(makeMapStateToProps)(StatusCheckBox);
|
||||
|
||||
Reference in New Issue
Block a user