Files
nym/explorer/src/errors/ErrorBoundaryContent.tsx
T
Fouad 2eee5195cc React / React DOM / Types upgrade to version 18 (#2830)
* new react and reactdom packages in wallet

* new react and reactdom packages in root

* new react and reactdom packages in nym connect

* new react and reactdom packages in root

* update react and reactdom for explorer

* react and react-dom upgrade for ts-packages

remove unused import

fix linting error

* use custom FC typing

move typings folder

* fix type error
2023-01-12 17:15:31 +00:00

25 lines
915 B
TypeScript

import * as React from 'react';
import { FallbackProps } from 'react-error-boundary';
import { Alert, AlertTitle, Container } from '@mui/material';
import { NymThemeProvider } from '@nymproject/mui-theme';
import { NymLogo } from '@nymproject/react/logo/NymLogo';
export const ErrorBoundaryContent: FCWithChildren<FallbackProps> = ({ error }) => (
<NymThemeProvider mode="dark">
<Container sx={{ py: 4 }}>
<NymLogo height="75px" width="75px" />
<h1>Oh no! Sorry, something went wrong</h1>
<Alert severity="error" data-testid="error-message">
<AlertTitle>{error.name}</AlertTitle>
{error.message}
</Alert>
{process.env.NODE_ENV === 'development' && (
<Alert severity="info" sx={{ mt: 2 }} data-testid="stack-trace">
<AlertTitle>Stack trace</AlertTitle>
{error.stack}
</Alert>
)}
</Container>
</NymThemeProvider>
);