|
@ -1,5 +1,7 @@ |
|
|
import React from 'react'; |
|
|
import React from 'react'; |
|
|
import PropTypes from 'prop-types'; |
|
|
import PropTypes from 'prop-types'; |
|
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'; |
|
|
|
|
|
import { connect } from 'react-redux'; |
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; |
|
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; |
|
|
import Button from 'flavours/glitch/components/button'; |
|
|
import Button from 'flavours/glitch/components/button'; |
|
|
import Option from './components/option'; |
|
|
import Option from './components/option'; |
|
@ -17,11 +19,17 @@ const messages = defineMessages({ |
|
|
account: { id: 'report.category.title_account', defaultMessage: 'profile' }, |
|
|
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 { |
|
|
class Category extends React.PureComponent { |
|
|
|
|
|
|
|
|
static propTypes = { |
|
|
static propTypes = { |
|
|
onNextStep: PropTypes.func.isRequired, |
|
|
onNextStep: PropTypes.func.isRequired, |
|
|
|
|
|
rules: ImmutablePropTypes.list, |
|
|
category: PropTypes.string, |
|
|
category: PropTypes.string, |
|
|
onChangeCategory: PropTypes.func.isRequired, |
|
|
onChangeCategory: PropTypes.func.isRequired, |
|
|
startedFrom: PropTypes.oneOf(['status', 'account']), |
|
|
startedFrom: PropTypes.oneOf(['status', 'account']), |
|
@ -53,13 +61,17 @@ class Category extends React.PureComponent { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
render () { |
|
|
render () { |
|
|
const { category, startedFrom, intl } = this.props; |
|
|
|
|
|
|
|
|
const { category, startedFrom, rules, intl } = this.props; |
|
|
|
|
|
|
|
|
const options = [ |
|
|
|
|
|
|
|
|
const options = rules.size > 0 ? [ |
|
|
'dislike', |
|
|
'dislike', |
|
|
'spam', |
|
|
'spam', |
|
|
'violation', |
|
|
'violation', |
|
|
'other', |
|
|
'other', |
|
|
|
|
|
] : [ |
|
|
|
|
|
'dislike', |
|
|
|
|
|
'spam', |
|
|
|
|
|
'other', |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|