From 9d50de79859e8dd8181d5cd5ebb76b783b313a71 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Fri, 8 Nov 2024 10:55:37 +0300 Subject: [PATCH] Updated hero component styles --- .../src/components/Hero/Hero.js | 2 +- .../src/components/Hero/Hero.snap.js | 16 +---------- .../src/components/Hero/Legend.js | 28 ++++++++----------- .../src/components/Hero/Map.js | 10 ++----- 4 files changed, 16 insertions(+), 40 deletions(-) diff --git a/apps/climatemappedafrica/src/components/Hero/Hero.js b/apps/climatemappedafrica/src/components/Hero/Hero.js index 9af0e3106..91239fb64 100644 --- a/apps/climatemappedafrica/src/components/Hero/Hero.js +++ b/apps/climatemappedafrica/src/components/Hero/Hero.js @@ -104,7 +104,7 @@ function Hero({ {/* Since map is dynamic-ally loaded, no need for implementation="css" */} - + {center ? ( renders unchanged 1`] = `
renders unchanged 1`] = ` class="MuiBox-root css-70qvj9" >
diff --git a/apps/climatemappedafrica/src/components/Hero/Legend.js b/apps/climatemappedafrica/src/components/Hero/Legend.js index f1a3f8139..77877f2a5 100644 --- a/apps/climatemappedafrica/src/components/Hero/Legend.js +++ b/apps/climatemappedafrica/src/components/Hero/Legend.js @@ -1,5 +1,5 @@ import { RichTypography } from "@commons-ui/legacy"; -import { Box, Tooltip } from "@mui/material"; +import { Box } from "@mui/material"; import PropTypes from "prop-types"; import React, { useState, forwardRef } from "react"; @@ -21,23 +21,17 @@ const Legend = forwardRef(function Legend({ data, title }, ref) { {data.map((item) => ( - - handleMouseEnter(`${item.min} - ${item.max}`)} - onMouseLeave={handleMouseLeave} - sx={{ - backgroundColor: item.color, - height: 24, - minWidth: 24, - cursor: "pointer", - }} - /> - + onMouseEnter={() => handleMouseEnter(`${item.min} - ${item.max}`)} + onMouseLeave={handleMouseLeave} + sx={{ + backgroundColor: item.color, + height: 24, + minWidth: 24, + cursor: "pointer", + }} + /> ))} {hoveredValue && ( { onLayerMouseOver(feature.properties.name.toLowerCase()); if (explorePageSlug) { @@ -55,7 +51,7 @@ function Map({ }); layer.on("mouseout", () => { onLayerMouseOver(null); - layer.setStyle({ ...choroplethColor, fillOpacity: 1 }); + layer.setStyle({ ...choroplethColor, fillOpacity: 1, weight: 1 }); }); layer.on("click", () => { if (explorePageSlug) { @@ -68,7 +64,7 @@ function Map({ }; return ( - +