From 470c0a80025f5d52bd66c16d1bfbccb1bfcaf6b0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 23 Feb 2022 20:03:46 +0100 Subject: [Glitch] Change report modal to include category selection in web UI Port a9a43de6d1502a6cbb388a5dbcd0e8532c236e64 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/report/rules.js | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 app/javascript/flavours/glitch/features/report/rules.js (limited to 'app/javascript/flavours/glitch/features/report/rules.js') diff --git a/app/javascript/flavours/glitch/features/report/rules.js b/app/javascript/flavours/glitch/features/report/rules.js new file mode 100644 index 000000000..4772e04a2 --- /dev/null +++ b/app/javascript/flavours/glitch/features/report/rules.js @@ -0,0 +1,64 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import { connect } from 'react-redux'; +import { FormattedMessage } from 'react-intl'; +import Button from 'flavours/glitch/components/button'; +import Option from './components/option'; + +const mapStateToProps = state => ({ + rules: state.get('rules'), +}); + +export default @connect(mapStateToProps) +class Rules extends React.PureComponent { + + static propTypes = { + onNextStep: PropTypes.func.isRequired, + rules: ImmutablePropTypes.list, + selectedRuleIds: ImmutablePropTypes.set.isRequired, + onToggle: PropTypes.func.isRequired, + }; + + handleNextClick = () => { + const { onNextStep } = this.props; + onNextStep('statuses'); + }; + + handleRulesToggle = (value, checked) => { + const { onToggle } = this.props; + onToggle(value, checked); + }; + + render () { + const { rules, selectedRuleIds } = this.props; + + return ( + +

+

+ +
+ {rules.map(item => ( +
+ +
+ +
+ +
+ + ); + } + +} -- cgit