feat: new error boundary component

This commit is contained in:
MTG2000
2022-09-13 14:05:38 +03:00
parent dcf6aa53e6
commit 0af7ddb194
14 changed files with 127 additions and 10 deletions

View File

@@ -13,8 +13,9 @@ import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import 'react-loading-skeleton/dist/skeleton.css'
import THEME from './theme';
import ErrorBoundary from 'src/Components/ErrorBoundary/ErrorBoundary';
import { NotificationsService } from 'src/services';
import ErrorPage from 'src/Components/Errors/ErrorPage/ErrorPage';
import { ErrorBoundary } from 'react-error-boundary';
THEME.injectStyles();
let basename = '/';
@@ -45,7 +46,9 @@ export default function Wrapper(props: any) {
return (
<>
<ErrorBoundary place='app'>
<ErrorBoundary
FallbackComponent={ErrorPage}
>
<ApolloProvider client={apolloClient}>
<Provider store={store}>
<BrowserRouter basename={basename}>

View File

@@ -1,9 +1,15 @@
import { ErrorBoundary } from 'react-error-boundary';
import { Outlet, } from 'react-router-dom';
import ErrorPage from 'src/Components/Errors/ErrorPage/ErrorPage';
import Navbar from "src/Components/Navbar/Navbar";
export const NavbarLayout = () => {
return <>
<Navbar />
<Outlet />
<ErrorBoundary
FallbackComponent={ErrorPage}
>
<Outlet />
</ErrorBoundary>
</>
};