From befcac20874d0a7368eaa94b4e35f907358f775d Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 10 Jan 2019 20:58:37 -0500 Subject: [PATCH] Converting SentryError to a functional component --- src/components/SentryError/index.js | 30 +++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/components/SentryError/index.js b/src/components/SentryError/index.js index fe05ad8..798ee23 100644 --- a/src/components/SentryError/index.js +++ b/src/components/SentryError/index.js @@ -5,26 +5,22 @@ import { withNamespaces, Trans } from 'react-i18next'; import Message from 'components/Message'; -export class SentryError extends React.Component { - reportError = event => { - event.preventDefault(); +const reportError = event => { + event.preventDefault(); - if (Sentry.lastEventId()) { - Sentry.showReportDialog(); - } + if (Sentry.lastEventId()) { + Sentry.showReportDialog(); } +}; - render() { - const { t } = this.props; - - return -

- This error has been logged. You may also fill out a report. -

-
; - } -} +export const SentryError = ({ t }) => ( + +

+ This error has been logged. You may also fill out a report. +

+
+); SentryError.propTypes = { t: PropTypes.func.isRequired