Files
grungnet/src/components/LoadingOverlay.js

31 lines
613 B
JavaScript
Raw Normal View History

2020-04-14 17:36:25 +10:00
import React from "react";
import { Box, Progress } from "theme-ui";
2020-04-14 17:36:25 +10:00
import Spinner from "./Spinner";
function LoadingOverlay({ progress }) {
2020-04-14 17:36:25 +10:00
return (
<Box
sx={{
position: "absolute",
width: "100%",
height: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center",
top: 0,
left: 0,
flexDirection: "column",
2020-04-14 17:36:25 +10:00
}}
bg="muted"
>
<Spinner />
{progress && (
<Progress max={1} value={progress} m={2} sx={{ width: "24px" }} />
)}
2020-04-14 17:36:25 +10:00
</Box>
);
}
export default LoadingOverlay;