Change report modal to include category selection in web UI (#17565)

* Change report modal to include category selection in web UI

* Various fixes and improvements

- Change thank you text to be different based on category
- Change starting headline to be different for account and status reports
- Change toggle components to have a checkmark when checked
- Fix report dialog being cut off on small screens
- Fix thank you screen offering mute or block if already muted or blocked
- Refactor toggle components in report dialog into one component

* Change wording on final screen

* Change checkboxes to be square when multiple options are possible
This commit is contained in:
Eugen Rochko 2022-02-23 20:03:46 +01:00 committed by GitHub
commit a9a43de6d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 954 additions and 232 deletions

View file

@ -1,19 +1,15 @@
import { connect } from 'react-redux';
import StatusCheckBox from '../components/status_check_box';
import { toggleStatusReport } from '../../../actions/reports';
import { Set as ImmutableSet } from 'immutable';
import { makeGetStatus } from 'mastodon/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);