From 5385655b0236e2614ce96364c64028f13336d10d Mon Sep 17 00:00:00 2001
From: David Ralph
Date: Sun, 24 Apr 2022 11:42:23 +0100
Subject: [PATCH] feat: custom background drag and drop, error reporting,
better ui, new settings, fixes
---
package.json | 1 +
src/components/modals/ErrorBoundary.jsx | 14 ++++++++++
.../modals/main/settings/Header.jsx | 3 ++-
.../modals/main/settings/Switch.jsx | 2 +-
.../modals/main/settings/sections/Quote.jsx | 5 ++++
.../main/settings/sections/Reminder.jsx | 1 +
.../settings/sections/background/Colour.jsx | 4 +--
.../settings/sections/background/Custom.jsx | 26 +++++++++++++++++--
src/components/widgets/quote/Quote.jsx | 9 ++++++-
src/index.jsx | 7 +++++
src/modules/constants.js | 1 +
11 files changed, 66 insertions(+), 7 deletions(-)
diff --git a/package.json b/package.json
index 8b3b08a9..987c7076 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
"@fontsource/lexend-deca": "4.4.5",
"@fontsource/montserrat": "4.4.5",
"@mui/material": "5.6.0",
+ "@sentry/react": "^6.19.6",
"react": "^18.0.0",
"react-clock": "3.1.0",
"react-color-gradient-picker": "0.1.2",
diff --git a/src/components/modals/ErrorBoundary.jsx b/src/components/modals/ErrorBoundary.jsx
index 7ba750d8..a7f4679b 100644
--- a/src/components/modals/ErrorBoundary.jsx
+++ b/src/components/modals/ErrorBoundary.jsx
@@ -1,12 +1,15 @@
import variables from 'modules/variables';
import { PureComponent } from 'react';
import { MdErrorOutline } from 'react-icons/md';
+import { captureException } from '@sentry/react';
export default class ErrorBoundary extends PureComponent {
constructor(props) {
super(props);
this.state = {
error: false,
+ errorData: '',
+ showReport: true
};
}
@@ -15,9 +18,17 @@ export default class ErrorBoundary extends PureComponent {
variables.stats.postEvent('modal', 'Error occurred');
return {
error: true,
+ errorData: error
};
}
+ reportError() {
+ captureException(this.state.errorData);
+ this.setState({
+ showReport: false
+ })
+ }
+
render() {
if (this.state.error) {
return (
@@ -36,6 +47,9 @@ export default class ErrorBoundary extends PureComponent {
'modals.main.error_boundary.message',
)}
+ {this.state.showReport ? : }