2020-04-14 17:36:25 +10:00
|
|
|
import React from "react";
|
2020-06-28 13:37:04 +10:00
|
|
|
import { Box } from "theme-ui";
|
2020-04-14 17:36:25 +10:00
|
|
|
|
|
|
|
|
import Spinner from "./Spinner";
|
|
|
|
|
|
2021-02-08 17:06:54 +11:00
|
|
|
function LoadingOverlay({ bg }) {
|
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,
|
2020-06-28 12:28:58 +10:00
|
|
|
flexDirection: "column",
|
2020-10-27 18:26:09 +11:00
|
|
|
zIndex: 2,
|
2020-04-14 17:36:25 +10:00
|
|
|
}}
|
2020-07-17 16:19:59 +10:00
|
|
|
bg={bg}
|
2020-04-14 17:36:25 +10:00
|
|
|
>
|
|
|
|
|
<Spinner />
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 16:19:59 +10:00
|
|
|
LoadingOverlay.defaultProps = {
|
|
|
|
|
bg: "muted",
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-14 17:36:25 +10:00
|
|
|
export default LoadingOverlay;
|