@applica-software-guru/react-admin 1.5.345 → 1.5.346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -108,5 +108,5 @@
108
108
  "type": "module",
109
109
  "types": "dist/index.d.ts",
110
110
  "typings": "dist/index.d.ts",
111
- "version": "1.5.345"
111
+ "version": "1.5.346"
112
112
  }
@@ -1,6 +1,6 @@
1
1
  import imgSrc from '@/assets/generic-error.png';
2
2
  import { History } from '@mui/icons-material';
3
- import { Button, Container, Stack, Typography, useTheme } from '@mui/material';
3
+ import { Box, Button, Container, Typography, useTheme } from '@mui/material';
4
4
  import { TitleComponent, useTranslate } from 'ra-core';
5
5
  import { Title, useResetErrorBoundaryOnLocationChange } from 'ra-ui-materialui';
6
6
  import { ComponentType, ErrorInfo, HtmlHTMLAttributes, useCallback } from 'react';
@@ -33,38 +33,32 @@ function Error(props: ErrorBoundaryProps) {
33
33
 
34
34
  return (
35
35
  <Container>
36
- <Stack alignItems="center" px={2} py={{ xs: 4, sm: 8 }} spacing={2} textAlign="center">
37
- {title ? <Title title={title} /> : null}
38
- <img src={imgSrc} style={{ width: '100%', maxWidth: 450, marginTop: theme.spacing(4) }} alt="oops!" />
36
+ <Box
37
+ sx={{
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ justifyContent: 'center',
41
+ alignItems: 'center',
42
+ py: 4,
43
+ gap: 2
44
+ }}
45
+ >
46
+ <Title title={title || 'Error'} />
39
47
  <Typography
40
- variant="h2"
41
- sx={{
42
- whiteSpace: 'pre-wrap',
43
- wordBreak: 'break-word'
44
- }}
45
- >
48
+ component="img"
49
+ src={imgSrc}
50
+ style={{ width: '100%', maxWidth: 350, marginTop: theme.spacing(3), marginBottom: theme.spacing(2) }}
51
+ alt="oops!"
52
+ />
53
+
54
+ <Typography variant="h2" justifyContent={'center'} align="center" sx={{ mb: 2 }}>
46
55
  {translate(isProduction ? 'ra.page.error' : error.message, { _: error.message })}
47
56
  </Typography>
48
- {!isProduction && <Typography variant="caption">{translate('ra.message.error_more_info')}</Typography>}
49
- {errorInfo ? (
50
- <Typography
51
- variant="body1"
52
- component="pre"
53
- textAlign={isProduction ? 'center' : 'start'}
54
- fontFamily={isProduction ? 'inherit' : 'monospace'}
55
- sx={{
56
- whiteSpace: 'pre-wrap',
57
- wordBreak: 'break-word'
58
- }}
59
- >
60
- {isProduction ? translate('ra.message.error') : errorInfo?.componentStack?.substring(0, 250) + '...'}
61
- </Typography>
62
- ) : null}
63
57
 
64
- <Button variant="contained" startIcon={<History />} onClick={handleBack}>
58
+ <Button variant="contained" startIcon={<History sx={{ fontSize: 22 }} />} onClick={handleBack}>
65
59
  {translate('ra.action.back')}
66
60
  </Button>
67
- </Stack>
61
+ </Box>
68
62
  </Container>
69
63
  );
70
64
  }