diff --git a/src/components/App.tsx b/src/components/App.tsx index 9314c31..e9946a4 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3,6 +3,7 @@ import { BrowserRouter, Route, Switch } from 'react-router-dom'; import NotificationsProvider from '../state/Notifications/NotificationsProvider'; import AuthenticationContext from './Authentication/AuthenticationContext'; import EasterEgg from './EasterEgg'; +import ErrorReport from './ErrorReport'; import Footer from './Footer'; import Header from './Header/Header'; import { @@ -49,7 +50,7 @@ export default function App() {
+ (null); + const [status, setStatus] = + useState(null); + const submit = useCallback(() => { + const text = ref.current?.value ?? ''; + if (text.length > 0) { + setStatus('pending'); + sendErrorReport(text) + .then(() => setStatus('resolved')) + .catch(() => setStatus('rejected')); + } + }, []); + return ( +
+

Error Report

+