[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:
Eugen Rochko
2022-02-23 20:03:46 +01:00
committed by Claire
parent 9dd62c95c5
commit 470c0a8002
17 changed files with 948 additions and 230 deletions

View File

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