Add animation to group open

This commit is contained in:
Mitchell McCaffrey
2021-05-24 17:11:46 +10:00
parent 0917ef05a1
commit 4e5bd8bf02
12 changed files with 170 additions and 76 deletions

View File

@@ -1,14 +1,40 @@
import React from "react";
import { Box, Grid } from "theme-ui";
import SimpleBar from "simplebar-react";
import { useGroup } from "../../contexts/GroupContext";
import useResponsiveLayout from "../../hooks/useResponsiveLayout";
function TilesContainer({ children }) {
const { onGroupSelect } = useGroup();
const layout = useResponsiveLayout();
return (
<SimpleBar style={{ height: layout.tileContainerHeight }}>
{children}
<Box
sx={{
position: "absolute",
width: "100%",
height: "100%",
top: 0,
}}
bg="muted"
onClick={() => onGroupSelect()}
/>
<Grid
p={3}
pb={4}
sx={{
borderRadius: "4px",
overflow: "hidden",
}}
gap={2}
columns={layout.gridTemplate}
>
{children}
</Grid>
</SimpleBar>
);
}