From 456f91c9ae6e9f71394f3fcb71454d1ccb769ade Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 27 May 2021 17:37:59 +1000 Subject: [PATCH] Move tile container background to stay with scrolled content --- src/components/tile/TilesContainer.js | 44 +++++++++++++-------------- src/components/tile/TilesOverlay.js | 21 +++++-------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/src/components/tile/TilesContainer.js b/src/components/tile/TilesContainer.js index 097c565..8703ee5 100644 --- a/src/components/tile/TilesContainer.js +++ b/src/components/tile/TilesContainer.js @@ -1,5 +1,5 @@ import React from "react"; -import { Box, Grid } from "theme-ui"; +import { Grid, useThemeUI } from "theme-ui"; import SimpleBar from "simplebar-react"; import { useGroup } from "../../contexts/GroupContext"; @@ -9,33 +9,33 @@ import useResponsiveLayout from "../../hooks/useResponsiveLayout"; function TilesContainer({ children }) { const { onGroupSelect } = useGroup(); + const { theme } = useThemeUI(); + const layout = useResponsiveLayout(); return ( - - + onGroupSelect()} - /> - - {children} - - + + {children} + + + ); } diff --git a/src/components/tile/TilesOverlay.js b/src/components/tile/TilesOverlay.js index b71ea18..27b072e 100644 --- a/src/components/tile/TilesOverlay.js +++ b/src/components/tile/TilesOverlay.js @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Box, Close, Grid } from "theme-ui"; +import { Box, Close, Grid, useThemeUI } from "theme-ui"; import { useSpring, animated, config } from "react-spring"; import ReactResizeDetector from "react-resize-detector"; import SimpleBar from "simplebar-react"; @@ -11,6 +11,8 @@ import useResponsiveLayout from "../../hooks/useResponsiveLayout"; function TilesOverlay({ children }) { const { openGroupId, onGroupClose, onGroupSelect } = useGroup(); + const { theme } = useThemeUI(); + const layout = useResponsiveLayout(); const openAnimation = useSpring({ @@ -63,28 +65,21 @@ function TilesOverlay({ children }) { borderColor: "border", cursor: "default", display: "flex", - alignItems: "center", + alignItems: "flex-end", justifyContent: "center", position: "relative", }} bg="background" onClick={(e) => e.stopPropagation()} > - onGroupSelect()} - /> onGroupSelect()} > {children}