From 7f4e5928492a71135f6817874461c80a0ecc155c Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Tue, 16 Jul 2024 19:37:18 -0400 Subject: Add SkipChore function to Fetcher utility module, Update Loading Comp --- src/views/components/Loading.jsx | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/views/components/Loading.jsx (limited to 'src/views/components/Loading.jsx') diff --git a/src/views/components/Loading.jsx b/src/views/components/Loading.jsx new file mode 100644 index 0000000..a31cf20 --- /dev/null +++ b/src/views/components/Loading.jsx @@ -0,0 +1,51 @@ +import { Box, CircularProgress, Container } from '@mui/joy' +import { Typography } from '@mui/material' +import { useEffect, useState } from 'react' +import Logo from '../../Logo' + +const LoadingComponent = () => { + const [message, setMessage] = useState('Loading...') + const [subMessage, setSubMessage] = useState('') + useEffect(() => { + // if loading took more than 5 seconds update submessage to mention there might be an error: + const timeout = setTimeout(() => { + setSubMessage( + 'This is taking longer than usual. There might be an issue.', + ) + }, 5000) + return () => clearTimeout(timeout) + }, []) + + return ( + + + + + + + {message} + + + {subMessage} + + + + ) +} + +export default LoadingComponent -- cgit