-
-
Notifications
You must be signed in to change notification settings - Fork 967
Expand file tree
/
Copy pathErrorFallback.jsx
More file actions
37 lines (32 loc) · 1002 Bytes
/
ErrorFallback.jsx
File metadata and controls
37 lines (32 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { ReactComponent as ImageOops } from 'images/img-oops.svg';
import { Button, Typography } from '@mui/material';
import { makeStyles } from '@mui/styles';
const useStyle = makeStyles({
Typography: {
margin: '8px 0px',
fontWeight: 600
},
Button: {
background: 'var(--color-brand-primary)',
color: '#ffffff',
'&:hover': {
background: 'var(--color-brand-primary)',
color: '#ffffff'
}
}
});
const ErrorFallback = ({ error, resetErrorBoundary }) => {
const classes = useStyle();
return (
<div className="error-boundary-fallback">
<ImageOops className="error-boundary-image" />
<Typography className={classes.Typography}>Something went wrong!</Typography>
<Typography className={classes.Typography}>{error.message}</Typography>
<Button className={classes.Button} variant="contained" onClick={resetErrorBoundary}>
Go back
</Button>
</div>
);
};
export default ErrorFallback;