impress-2020/src/app/PageLayout.js

36 lines
805 B
JavaScript
Raw Normal View History

2020-09-06 18:12:34 -07:00
import React from "react";
2020-09-10 02:32:14 -07:00
import { Box } from "@chakra-ui/core";
import loadable from "@loadable/component";
2020-09-06 18:12:34 -07:00
2020-09-10 02:32:14 -07:00
const GlobalNavBar = loadable(() => import("./GlobalNavBar"));
const GlobalFooter = loadable(() => import("./GlobalFooter"));
2020-09-06 18:42:39 -07:00
function PageLayout({ children }) {
2020-09-06 18:12:34 -07:00
return (
<Box
paddingX="6"
paddingY="3"
maxWidth="1024px"
margin="0 auto"
minHeight="100vh"
display="flex"
flexDirection="column"
>
2020-09-06 18:42:39 -07:00
<Box
width="100%"
marginBottom="6"
// Leave space while content is still loading
minHeight="2rem"
2020-09-06 18:42:39 -07:00
>
2020-09-10 02:32:14 -07:00
<GlobalNavBar />
2020-09-06 18:12:34 -07:00
</Box>
<Box flex="1 0 0">{children}</Box>
<Box width="100%" marginTop="12">
<GlobalFooter />
</Box>
2020-09-06 18:12:34 -07:00
</Box>
);
}
export default PageLayout;