Add category selection to collection report modal (#39456)

This commit is contained in:
diondiondion authored and Claire committed 2026-06-17 12:09:12 +02:00
1 parent 291dda95da
commit e85019c17e
2 files changed
+68 -11

No files matched your search

@@ -68,7 +68,7 @@ class Category extends PureComponent {
render () {
const { category, startedFrom, rules, intl } = this.props;
const options = rules.length > 0 ? [
let options = rules.length > 0 ? [
'dislike',
'spam',
'legal',
@@ -81,10 +81,21 @@ class Category extends PureComponent {
'other',
];
if (startedFrom === 'collection') {
options = options.filter(item => item !== 'dislike');
}
return (
<>
<NavigationFocusTarget as='h1' className='report-dialog-modal__title'>
<FormattedMessage id='report.category.title' defaultMessage="Tell us what's going on with this {type}" values={{ type: intl.formatMessage(messages[startedFrom]) }} />
{startedFrom === 'collection' ? (
<FormattedMessage
id='report.collection_comment'
defaultMessage='Why do you want to report this collection?'
/>
) : (
<FormattedMessage id='report.category.title' defaultMessage="Tell us what's going on with this {type}" values={{ type: intl.formatMessage(messages[startedFrom]) }} />
)}
</NavigationFocusTarget>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.category.subtitle' defaultMessage='Choose the best match' /></p>