impress-2020/src/app/PageLayout.js
Matchu 7f777ed5b3 Add page-reload recovery to *all* code splitting
Still getting some chunk load errors in my Sentry reporting! My hunch is these are the culprit. I hooope that after this the errors are pretty much gone! If not, then I'm missing something about what causes these failures…
2021-01-21 14:34:55 -08:00

35 lines
797 B
JavaScript

import React from "react";
import { Box } from "@chakra-ui/react";
import { loadable } from "./util";
const GlobalHeader = loadable(() => import("./GlobalHeader"));
const GlobalFooter = loadable(() => import("./GlobalFooter"));
function PageLayout({ children }) {
return (
<Box
paddingX="6"
paddingY="3"
maxWidth="1024px"
margin="0 auto"
minHeight="100vh"
display="flex"
flexDirection="column"
>
<Box
width="100%"
marginBottom="6"
// Leave space while content is still loading
minHeight="2rem"
>
<GlobalHeader />
</Box>
<Box flex="1 0 0">{children}</Box>
<Box width="100%" marginTop="12">
<GlobalFooter />
</Box>
</Box>
);
}
export default PageLayout;