Moved map asset loading progress to use refs to stop re-renders

Moved map loading overlay to use animation frames for a smooth progress bar
This commit is contained in:
Mitchell McCaffrey
2020-06-28 13:37:04 +10:00
parent bf022e2686
commit a81031e84e
4 changed files with 82 additions and 26 deletions

View File

@@ -1,9 +1,9 @@
import React from "react";
import { Box, Progress } from "theme-ui";
import { Box } from "theme-ui";
import Spinner from "./Spinner";
function LoadingOverlay({ progress }) {
function LoadingOverlay() {
return (
<Box
sx={{
@@ -20,9 +20,6 @@ function LoadingOverlay({ progress }) {
bg="muted"
>
<Spinner />
{progress && (
<Progress max={1} value={progress} m={2} sx={{ width: "24px" }} />
)}
</Box>
);
}