From eeaa250ca2df9a52eae178566acacec485d30fa6 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Mon, 20 Apr 2020 15:47:52 +1000 Subject: [PATCH] Added background color to menu to make it easier to see on a light background --- src/components/MapControls.js | 9 +++++++-- src/components/MapMenu.js | 7 ++++++- src/theme.js | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/MapControls.js b/src/components/MapControls.js index c980384..3e8716a 100644 --- a/src/components/MapControls.js +++ b/src/components/MapControls.js @@ -138,7 +138,7 @@ function MapControls({ setCurrentSubmenu(tool); setCurrentSubmenuOptions({ // Align the right of the submenu to the left of the tool and center vertically - left: `${toolRect.left - 4}px`, + left: `${toolRect.left - 16}px`, top: `${toolRect.bottom - toolRect.height / 2}px`, style: { transform: "translate(-100%, -50%)" }, }); @@ -162,7 +162,6 @@ function MapControls({ return ( <> @@ -187,7 +189,10 @@ function MapControls({ flexDirection: "column", alignItems: "center", display: isExpanded ? "flex" : "none", + backgroundColor: "overlay", + borderRadius: "4px", }} + p={2} > {divider} diff --git a/src/components/MapMenu.js b/src/components/MapMenu.js index 5f63b49..3be5c31 100644 --- a/src/components/MapMenu.js +++ b/src/components/MapMenu.js @@ -1,6 +1,8 @@ import React from "react"; import Modal from "react-modal"; +import { useThemeUI } from "theme-ui"; + function MapMenu({ isOpen, onRequestClose, @@ -35,6 +37,9 @@ function MapMenu({ } onModalContent(node); } + + const { theme } = useThemeUI(); + return (