From 44519fef35f6906683abc50425b3e7b85c7c7be5 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 15 Jun 2020 21:41:46 -0400 Subject: [PATCH] Fixed issue with ReportModal typing and mobile styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed: - issue with ReportModal typing and mobile styles --- .../components/modal/report_modal.js | 66 ++++++------------- 1 file changed, 20 insertions(+), 46 deletions(-) diff --git a/app/javascript/gabsocial/components/modal/report_modal.js b/app/javascript/gabsocial/components/modal/report_modal.js index fb5e50d5..69b0381d 100644 --- a/app/javascript/gabsocial/components/modal/report_modal.js +++ b/app/javascript/gabsocial/components/modal/report_modal.js @@ -2,13 +2,13 @@ import { defineMessages, injectIntl } from 'react-intl' import { OrderedSet } from 'immutable' import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' -import { changeReportComment, changeReportForward, submitReport } from '../../actions/reports' +import { changeReportComment, submitReport } from '../../actions/reports' import { expandAccountTimeline } from '../../actions/timelines' import { makeGetAccount } from '../../selectors' import ModalLayout from './modal_layout' +import ResponsiveClassesComponent from '../../features/ui/util/responsive_classes_component' import Button from '../button' import StatusCheckBox from '../status_check_box' -import Switch from '../switch' import Text from '../text' import Textarea from '../textarea' @@ -17,8 +17,6 @@ const messages = defineMessages({ placeholder: { id: 'report.placeholder', defaultMessage: 'Additional comments' }, submit: { id: 'report.submit', defaultMessage: 'Submit' }, hint: { id: 'report.hint', defaultMessage: 'The report will be sent to your server moderators. You can provide an explanation of why you are reporting this account below:' }, - forwardHint: { id: 'report.forward_hint', defaultMessage: 'The account is from another server. Send an anonymized copy of the report there as well?' }, - forward: { id: 'report.forward', defaultMessage: 'Forward to {target}' }, target: { id: 'report.target', defaultMessage: 'Report {target}' }, }) @@ -32,7 +30,6 @@ const makeMapStateToProps = () => { isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']), account: getAccount(state, accountId), comment: state.getIn(['reports', 'new', 'comment']), - forward: state.getIn(['reports', 'new', 'forward']), statusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])).union(state.getIn(['reports', 'new', 'status_ids'])), } } @@ -50,20 +47,15 @@ class ReportModal extends ImmutablePureComponent { account: ImmutablePropTypes.map, statusIds: ImmutablePropTypes.orderedSet.isRequired, comment: PropTypes.string.isRequired, - forward: PropTypes.bool, dispatch: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, onClose: PropTypes.func.isRequired, } - handleCommentChange = (e) => { + handleCommentChange = (value) => { this.props.dispatch(changeReportComment(value)) } - handleForwardChange = e => { - this.props.dispatch(changeReportForward(e.target.checked)) - } - handleSubmit = () => { this.props.dispatch(submitReport()) } @@ -91,14 +83,11 @@ class ReportModal extends ImmutablePureComponent { intl, statusIds, isSubmitting, - forward, onClose } = this.props if (!account) return null - const domain = account.get('acct').split('@')[1] - return ( -
-
+ + {intl.formatMessage(messages.hint)} @@ -124,31 +119,6 @@ class ReportModal extends ImmutablePureComponent { autoFocus />
- - { /** : todo : */ - domain && -
- - {intl.formatMessage(messages.forwardHint)} - - -
- -
-
- } -
+ -
-
+ +
{ statusIds.map(statusId => ( )) }
-
-
+ + +
) }