diff options
author | Renaud Chaput <renchap@gmail.com> | 2023-02-25 14:34:32 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-02-25 14:35:31 +0100 |
commit | 81ef21a0c802f1d905f37a2a818544a8b400793c (patch) | |
tree | 33043286868ca9efb627ed38accab03c756adbcb /app/javascript/flavours/glitch/features/report/comment.js | |
parent | 859eb01aacc27fa01a8d4063f26a5a1f81e5d3a9 (diff) |
[Glitch] Rename JSX files with proper `.jsx` extension
Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/report/comment.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/report/comment.js | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/app/javascript/flavours/glitch/features/report/comment.js b/app/javascript/flavours/glitch/features/report/comment.js deleted file mode 100644 index ec261afcb..000000000 --- a/app/javascript/flavours/glitch/features/report/comment.js +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'; -import Button from 'flavours/glitch/components/button'; -import Toggle from 'react-toggle'; - -const messages = defineMessages({ - placeholder: { id: 'report.placeholder', defaultMessage: 'Type or paste additional comments' }, -}); - -export default @injectIntl -class Comment extends React.PureComponent { - - static propTypes = { - onSubmit: PropTypes.func.isRequired, - comment: PropTypes.string.isRequired, - onChangeComment: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - isSubmitting: PropTypes.bool, - forward: PropTypes.bool, - isRemote: PropTypes.bool, - domain: PropTypes.string, - onChangeForward: PropTypes.func.isRequired, - }; - - handleClick = () => { - const { onSubmit } = this.props; - onSubmit(); - }; - - handleChange = e => { - const { onChangeComment } = this.props; - onChangeComment(e.target.value); - }; - - handleKeyDown = e => { - if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { - this.handleClick(); - } - }; - - handleForwardChange = e => { - const { onChangeForward } = this.props; - onChangeForward(e.target.checked); - }; - - render () { - const { comment, isRemote, forward, domain, isSubmitting, intl } = this.props; - - return ( - <React.Fragment> - <h3 className='report-dialog-modal__title'><FormattedMessage id='report.comment.title' defaultMessage='Is there anything else you think we should know?' /></h3> - - <textarea - className='report-dialog-modal__textarea' - placeholder={intl.formatMessage(messages.placeholder)} - value={comment} - onChange={this.handleChange} - onKeyDown={this.handleKeyDown} - disabled={isSubmitting} - /> - - {isRemote && ( - <React.Fragment> - <p className='report-dialog-modal__lead'><FormattedMessage id='report.forward_hint' defaultMessage='The account is from another server. Send an anonymized copy of the report there as well?' /></p> - - <label className='report-dialog-modal__toggle'> - <Toggle checked={forward} disabled={isSubmitting} onChange={this.handleForwardChange} /> - <FormattedMessage id='report.forward' defaultMessage='Forward to {target}' values={{ target: domain }} /> - </label> - </React.Fragment> - )} - - <div className='flex-spacer' /> - - <div className='report-dialog-modal__actions'> - <Button onClick={this.handleClick} disabled={isSubmitting}><FormattedMessage id='report.submit' defaultMessage='Submit report' /></Button> - </div> - </React.Fragment> - ); - } - -} |