@@ -31,16 +31,16 @@ exports[`Location renders unchanged 1`] = `
class="MuiGrid-root MuiGrid-item css-1dran7o-MuiGrid-root"
>
County
Isiolo
diff --git a/packages/hurumap-core/src/LocationTag/LocationTag.js b/packages/hurumap-core/src/LocationTag/LocationTag.js
index 248fc81a9..80fa56f31 100644
--- a/packages/hurumap-core/src/LocationTag/LocationTag.js
+++ b/packages/hurumap-core/src/LocationTag/LocationTag.js
@@ -6,7 +6,7 @@ const LocationTagRoot = styled(Box, {
shouldForwardProp: (prop) =>
!["active", "highlight", "variant"].includes(prop),
})(({ active, theme, variant }) => {
- const { palette, typography } = theme;
+ const { palette, spacing, typography } = theme;
let color = palette.text.primary;
let backgroundColor = palette.background.default;
if (variant === "highlight") {
@@ -20,6 +20,7 @@ const LocationTagRoot = styled(Box, {
boxShadow: "0px 3px 6px #00000029",
color,
height: typography.pxToRem(36),
+ padding: `0 ${spacing(1.25)}`,
position: "relative",
minWidth: typography.pxToRem(88),
};
@@ -49,7 +50,7 @@ const LevelTypography = styled("h6", {
borderRadius: typography.pxToRem(4),
color: palette.text.secondary,
fontSize: typography.pxToRem(7),
- fontWeight: "bold",
+ fontWeight: 600,
letterSpacing: "0.56px",
lineHeight: 10 / 7,
margin: 0,
@@ -64,7 +65,7 @@ const LevelTypography = styled("h6", {
const NameTypography = styled("div")(({ theme }) => {
return {
fontSize: theme.typography.pxToRem(9),
- fontWeight: "bold",
+ fontWeight: 600,
lineHeight: 13 / 9,
margin: "auto",
textTransform: "capitalize",
diff --git a/packages/hurumap-core/src/LocationTag/LocationTag.snap.js b/packages/hurumap-core/src/LocationTag/LocationTag.snap.js
index c943f6504..b0d8fcab9 100644
--- a/packages/hurumap-core/src/LocationTag/LocationTag.snap.js
+++ b/packages/hurumap-core/src/LocationTag/LocationTag.snap.js
@@ -3,15 +3,15 @@
exports[`LocationTag renders unchanged 1`] = `
region
Region
diff --git a/packages/hurumap-next/src/Map/Legend.js b/packages/hurumap-next/src/Map/Legend.js
index bb967522a..58e70f308 100644
--- a/packages/hurumap-next/src/Map/Legend.js
+++ b/packages/hurumap-next/src/Map/Legend.js
@@ -1,58 +1,67 @@
-import { Typography, Grid } from "@mui/material";
+import { Box, Typography } from "@mui/material";
+import { alpha } from "@mui/material/styles";
export default function Legend({ legend, title = "Average Temperature", sx }) {
+ if (!legend?.length) {
+ return null;
+ }
return (
-
({
+ ({
+ // match zoom control border color
+ border: "1px solid #ccc",
+ borderRadius: "5px",
+ boxShadow: `0px 3px 6px ${alpha(palette.common.black, 0.16)}`,
position: "absolute",
- zIndex: 1000,
- width: "fit-content",
- bottom: theme.spacing(30),
- right: theme.spacing(20),
- backgroundColor: theme.palette.background.paper,
- padding: theme.spacing(1),
- boxShadow: theme.shadows[3],
+ top: typography.pxToRem(52),
+ // match zoom control position
+ right: 10,
+ background: alpha(palette.background.default, 0.9),
+ pb: 1,
+ zIndex: zIndex.appBar - 1,
...sx,
})}
>
({
- color: theme.palette.text.primary,
- marginBottom: theme.spacing(2),
- })}
+ display="flex"
+ alignItems="center"
+ minHeight={52}
+ variant="caption"
+ fontWeight={600}
+ sx={{
+ borderBottom: `1px solid #ccc`,
+ m: 0,
+ px: 1,
+ }}
>
{title}
- {legend?.map(({ min, max, color }) => (
- (
+ ({
- padding: theme.spacing(1),
- })}
+ justifyContent="flex-start"
+ gap={1}
+ px={1}
+ key={`${min}-${max}`}
>
- ({
+
-
- ({ color: theme.palette.text.primary })}
- >
- {min} - {max}
-
-
-
+
+ {min} - {max}
+
+
))}
-
+
);
}