Changed NetworkErrorFallback to a generic callback
This commit is contained in:
1 parent
9c04ecd725
commit
2eeb8b6e4e
2 files changed
+25
-12
No files matched your search
@@ -0,0 +1,20 @@
|
|||||||
|
import { Typography } from "@mui/material";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
|
const NetworkError = () => {
|
||||||
|
const theme = useTheme();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Typography
|
||||||
|
variant="h1"
|
||||||
|
marginY={theme.spacing(4)}
|
||||||
|
color={theme.palette.primary.contrastTextTertiary}
|
||||||
|
>
|
||||||
|
Network error
|
||||||
|
</Typography>
|
||||||
|
<Typography>Please check your connection</Typography>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NetworkError;
|
||||||
+5
-12
@@ -1,5 +1,5 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack } from "@mui/material";
|
||||||
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
||||||
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
||||||
import Background from "../../assets/Images/background-grid.svg?react";
|
import Background from "../../assets/Images/background-grid.svg?react";
|
||||||
@@ -11,13 +11,13 @@ import { useSelector } from "react-redux";
|
|||||||
* @returns {JSX.Element} The rendered fallback UI.
|
* @returns {JSX.Element} The rendered fallback UI.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NetworkErrorFallback = () => {
|
const GenericFallback = ({ children }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
className="page-speed"
|
padding={theme.spacing(16)}
|
||||||
position="relative"
|
position="relative"
|
||||||
border={1}
|
border={1}
|
||||||
borderColor={theme.palette.primary.lowContrast}
|
borderColor={theme.palette.primary.lowContrast}
|
||||||
@@ -68,18 +68,11 @@ const NetworkErrorFallback = () => {
|
|||||||
maxWidth={"300px"}
|
maxWidth={"300px"}
|
||||||
zIndex={1}
|
zIndex={1}
|
||||||
>
|
>
|
||||||
<Typography
|
{children}
|
||||||
variant="h1"
|
|
||||||
marginY={theme.spacing(4)}
|
|
||||||
color={theme.palette.primary.contrastTextTertiary}
|
|
||||||
>
|
|
||||||
Network error
|
|
||||||
</Typography>
|
|
||||||
<Typography>Please check your connection</Typography>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default NetworkErrorFallback;
|
export default GenericFallback;
|
||||||
Reference in new issue
Block a user