loading screen circle is now properly centered all the time

This commit is contained in:
Carter 2025-04-16 10:21:43 -06:00
parent a27baa8b4a
commit 9df40db30f
2 changed files with 61 additions and 45 deletions

View file

@ -9,7 +9,20 @@ export default function LoadingScreen(props: Props) {
const theme = useTheme(); const theme = useTheme();
return ( return (
<Box sx={{ width: "100%", height: "100%", justifyContent: "center", alignContent: "center", textAlign: "center" }}> <Box
sx={{
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
textAlign: "center",
}}
>
<CircularProgress <CircularProgress
size={150} size={150}
style={{ marginBottom: theme.spacing(4) }} style={{ marginBottom: theme.spacing(4) }}

View file

@ -8,6 +8,7 @@ import { ErrorBoundary } from "react-error-boundary";
import { getWhitelabel } from "services/whiteLabel"; import { getWhitelabel } from "services/whiteLabel";
import Ventilation from "pages/VentEditor"; import Ventilation from "pages/VentEditor";
import { useGlobalState } from "providers"; import { useGlobalState } from "providers";
import { Box } from "@mui/material";
const DeviceHistory = lazy(() => import("pages/DeviceHistory")); const DeviceHistory = lazy(() => import("pages/DeviceHistory"));
const DevicePage = lazy(() => import("pages/Device")); const DevicePage = lazy(() => import("pages/Device"));
@ -288,7 +289,8 @@ export default function Router() {
return ( return (
<BrowserRouter> <BrowserRouter>
<Header /> <Header />
<Suspense fallback={<LoadingScreen />}> {/* <Box sx={{ height: "100%", minHeight: "200px" }}> */}
<Suspense fallback={<LoadingScreen message="Loading Page"/>}>
<Routes> <Routes>
{/* Redirects */} {/* Redirects */}
@ -334,6 +336,7 @@ export default function Router() {
</Routes> </Routes>
</Suspense> </Suspense>
{/* </Box> */}
</BrowserRouter> </BrowserRouter>
) )
} }