2023-08-10 15:56:36 -07:00
|
|
|
import React from "react";
|
|
|
|
import { Box, Grid, useColorModeValue, useToken } from "@chakra-ui/react";
|
|
|
|
import { useCommonStyles } from "../util";
|
|
|
|
|
|
|
|
function WardrobePageLayout({
|
2024-09-09 16:10:45 -07:00
|
|
|
previewAndControls = null,
|
|
|
|
itemsAndMaybeSearchPanel = null,
|
|
|
|
searchFooter = null,
|
2023-08-10 15:56:36 -07:00
|
|
|
}) {
|
2024-09-09 16:10:45 -07:00
|
|
|
const itemsAndSearchBackground = useColorModeValue("white", "gray.900");
|
|
|
|
const searchBackground = useCommonStyles().bodyBackground;
|
|
|
|
const searchShadowColorValue = useToken("colors", "gray.400");
|
2023-08-10 15:56:36 -07:00
|
|
|
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
position="absolute"
|
|
|
|
top="0"
|
|
|
|
bottom="0"
|
|
|
|
left="0"
|
|
|
|
right="0"
|
|
|
|
// Create a stacking context, so that our drawers and modals don't fight
|
|
|
|
// with the z-indexes in here!
|
|
|
|
zIndex="0"
|
|
|
|
>
|
|
|
|
<Grid
|
|
|
|
templateAreas={{
|
|
|
|
base: `"previewAndControls"
|
2023-08-10 15:56:36 -07:00
|
|
|
"itemsAndMaybeSearchPanel"`,
|
2024-09-09 16:10:45 -07:00
|
|
|
md: `"previewAndControls itemsAndMaybeSearchPanel"
|
2023-08-10 15:56:36 -07:00
|
|
|
"searchFooter searchFooter"`,
|
2024-09-09 16:10:45 -07:00
|
|
|
}}
|
|
|
|
templateRows={{
|
|
|
|
base: "minmax(100px, 45%) minmax(300px, 55%)",
|
|
|
|
md: "minmax(300px, 1fr) auto",
|
|
|
|
}}
|
|
|
|
templateColumns={{
|
|
|
|
base: "100%",
|
|
|
|
md: "50% 50%",
|
|
|
|
}}
|
|
|
|
height="100%"
|
|
|
|
width="100%"
|
|
|
|
>
|
|
|
|
<Box
|
|
|
|
gridArea="previewAndControls"
|
|
|
|
bg="gray.900"
|
|
|
|
color="gray.50"
|
|
|
|
position="relative"
|
|
|
|
>
|
|
|
|
{previewAndControls}
|
|
|
|
</Box>
|
|
|
|
<Box gridArea="itemsAndMaybeSearchPanel" bg={itemsAndSearchBackground}>
|
|
|
|
{itemsAndMaybeSearchPanel}
|
|
|
|
</Box>
|
|
|
|
<Box
|
|
|
|
gridArea="searchFooter"
|
|
|
|
bg={searchBackground}
|
|
|
|
boxShadow={`0 0 8px ${searchShadowColorValue}`}
|
|
|
|
display={{ base: "none", md: "block" }}
|
|
|
|
>
|
|
|
|
{searchFooter}
|
|
|
|
</Box>
|
|
|
|
</Grid>
|
|
|
|
</Box>
|
|
|
|
);
|
2023-08-10 15:56:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default WardrobePageLayout;
|