forked from aave/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path500.page.tsx
More file actions
98 lines (94 loc) · 2.96 KB
/
500.page.tsx
File metadata and controls
98 lines (94 loc) · 2.96 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import { DuplicateIcon, RefreshIcon } from '@heroicons/react/outline';
import { Trans } from '@lingui/macro';
import { Box, Button, Link, Paper, SvgIcon, Typography, useTheme } from '@mui/material';
import { useEffect } from 'react';
import { ContentContainer } from 'src/components/ContentContainer';
import { TopInfoPanel } from 'src/components/TopInfoPanel/TopInfoPanel';
import { MainLayout } from 'src/layouts/MainLayout';
import { useRootStore } from 'src/store/root';
export default function Aave500Page() {
const theme = useTheme();
const handleCopyError = () => {
console.log('copying error to clipboard');
};
const trackEvent = useRootStore((store) => store.trackEvent);
useEffect(() => {
trackEvent('Page Viewed', {
'Page Name': '500 Error',
});
}, [trackEvent]);
return (
<>
<TopInfoPanel />
<ContentContainer>
<Paper
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
p: 4,
flex: 1,
backgroundColor: theme.palette.mode === 'dark' ? 'transparent' : '',
}}
>
<Typography variant="display1" sx={{ mt: 8, mb: 3 }}>
<Trans>Something went wrong</Trans>
</Typography>
<Typography sx={{ mt: 2, mb: 5, maxWidth: 480 }}>
<Trans>
Sorry, an unexpected error happened. In the meantime you may try reloading the page,
or come back later.
</Trans>
</Typography>
<Button
variant="outlined"
color="primary"
startIcon={
<SvgIcon>
<RefreshIcon />
</SvgIcon>
}
onClick={() => window.location.reload()}
sx={{ mb: 10 }}
>
<Trans>Reload the page</Trans>
</Button>
<Box
display="flex"
alignItems="center"
justifyContent="center"
flexDirection="column"
mt={10}
>
<Typography sx={{ mb: 4 }}>
<Trans>
If the error continues to happen,
<br /> you may report it to this
</Trans>{' '}
<Link href="https://discord.com/invite/aave" color="inherit" target="_blank">
<Trans>Discord channel</Trans>
</Link>
.
</Typography>
<Button
color="primary"
startIcon={
<SvgIcon>
<DuplicateIcon />
</SvgIcon>
}
onClick={handleCopyError}
>
<Trans>Copy error message</Trans>
</Button>
</Box>
</Paper>
</ContentContainer>
</>
);
}
Aave500Page.getLayout = function getLayout(page: React.ReactElement) {
return <MainLayout>{page}</MainLayout>;
};