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/notifications/components/report.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/notifications/components/report.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/notifications/components/report.js | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/app/javascript/flavours/glitch/features/notifications/components/report.js b/app/javascript/flavours/glitch/features/notifications/components/report.js deleted file mode 100644 index 46a307250..000000000 --- a/app/javascript/flavours/glitch/features/notifications/components/report.js +++ /dev/null @@ -1,62 +0,0 @@ -import React, { Fragment } from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import AvatarOverlay from 'flavours/glitch/components/avatar_overlay'; -import RelativeTimestamp from 'flavours/glitch/components/relative_timestamp'; - -const messages = defineMessages({ - openReport: { id: 'report_notification.open', defaultMessage: 'Open report' }, - other: { id: 'report_notification.categories.other', defaultMessage: 'Other' }, - spam: { id: 'report_notification.categories.spam', defaultMessage: 'Spam' }, - violation: { id: 'report_notification.categories.violation', defaultMessage: 'Rule violation' }, -}); - -export default @injectIntl -class Report extends ImmutablePureComponent { - - static propTypes = { - account: ImmutablePropTypes.map.isRequired, - report: ImmutablePropTypes.map.isRequired, - hidden: PropTypes.bool, - intl: PropTypes.object.isRequired, - }; - - render () { - const { intl, hidden, report, account } = this.props; - - if (!report) { - return null; - } - - if (hidden) { - return ( - <Fragment> - {report.get('id')} - </Fragment> - ); - } - - return ( - <div className='notification__report'> - <div className='notification__report__avatar'> - <AvatarOverlay account={report.get('target_account')} friend={account} /> - </div> - - <div className='notification__report__details'> - <div> - <RelativeTimestamp timestamp={report.get('created_at')} short={false} /> · <FormattedMessage id='report_notification.attached_statuses' defaultMessage='{count, plural, one {{count} post} other {{count} posts}} attached' values={{ count: report.get('status_ids').size }} /> - <br /> - <strong>{intl.formatMessage(messages[report.get('category')])}</strong> - </div> - - <div className='notification__report__actions'> - <a href={`/admin/reports/${report.get('id')}`} className='button' target='_blank' rel='noopener noreferrer'>{intl.formatMessage(messages.openReport)}</a> - </div> - </div> - </div> - ); - } - -} |