diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-04-29 00:04:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 00:04:42 +0200 |
commit | 252deefe3433d0cedafd973becd0d85b5182eb49 (patch) | |
tree | e20d8fdf6a646d024206333e450fad06d5c4b535 /app/javascript/flavours/glitch/features/report | |
parent | 78f7f23ad21359893cb022b7c2f7644d5c22cb43 (diff) | |
parent | 01c2f47b7f397af362504a64d850b0eed0b4575f (diff) |
Merge pull request #1757 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/features/report')
-rw-r--r-- | app/javascript/flavours/glitch/features/report/category.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/report/category.js b/app/javascript/flavours/glitch/features/report/category.js index cf63533d0..4c71ccde7 100644 --- a/app/javascript/flavours/glitch/features/report/category.js +++ b/app/javascript/flavours/glitch/features/report/category.js @@ -1,5 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import Button from 'flavours/glitch/components/button'; import Option from './components/option'; @@ -17,11 +19,17 @@ const messages = defineMessages({ account: { id: 'report.category.title_account', defaultMessage: 'profile' }, }); -export default @injectIntl +const mapStateToProps = state => ({ + rules: state.get('rules'), +}); + +export default @connect(mapStateToProps) +@injectIntl class Category extends React.PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, + rules: ImmutablePropTypes.list, category: PropTypes.string, onChangeCategory: PropTypes.func.isRequired, startedFrom: PropTypes.oneOf(['status', 'account']), @@ -53,13 +61,17 @@ class Category extends React.PureComponent { }; render () { - const { category, startedFrom, intl } = this.props; + const { category, startedFrom, rules, intl } = this.props; - const options = [ + const options = rules.size > 0 ? [ 'dislike', 'spam', 'violation', 'other', + ] : [ + 'dislike', + 'spam', + 'other', ]; return ( |