From 8cb2ef021b5ccfd7a9febe456766a510f7555f32 Mon Sep 17 00:00:00 2001 From: anamontiaga Date: Mon, 15 Jan 2024 15:22:36 +0100 Subject: [PATCH] add close btn to all tooltips --- src/containers/map/index.tsx | 10 +++++++++- src/containers/map/location-pop-up/index.tsx | 12 +++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/containers/map/index.tsx b/src/containers/map/index.tsx index a4e83fdfb..2da2285e0 100644 --- a/src/containers/map/index.tsx +++ b/src/containers/map/index.tsx @@ -36,6 +36,7 @@ import Legend from 'containers/map/legend'; import MobileLegend from 'containers/map/mobile/legend'; import RestorationPopup from 'containers/map/restoration-popup'; +import Icon from 'components/icon'; import Map from 'components/map'; import Controls from 'components/map/controls'; import BasemapSettingsControl from 'components/map/controls/basemap-settings'; @@ -51,6 +52,8 @@ import Popup from 'components/popup'; import { breakpoints } from 'styles/styles.config'; import type { RestorationPopUp, PopUpKey, LocationPopUp } from 'types/map'; +import CLOSE_SVG from 'svgs/ui/close.svg?sprite'; + import LayerManager from './layer-manager'; import LocationPopup from './location-pop-up'; @@ -379,10 +382,15 @@ const MapContainer = ({ mapId }: { mapId: string }) => { latitude={locationPopUp?.popup[0]} onClose={() => removePopup('location')} > + {!isEmpty(locationPopUp?.info) ? ( removePopup('location')} className={cn({ '!w-[360px] rounded-3xl pt-6': isEmpty(iucnEcoregionPopUp?.popupInfo) && diff --git a/src/containers/map/location-pop-up/index.tsx b/src/containers/map/location-pop-up/index.tsx index 95bae0aa6..e48f38172 100644 --- a/src/containers/map/location-pop-up/index.tsx +++ b/src/containers/map/location-pop-up/index.tsx @@ -22,7 +22,7 @@ import CLOSE_SVG from 'svgs/ui/close.svg?sprite'; const LocationPopUP = ({ locationPopUpInfo, nonExpansible, - onClose, + className, }: { locationPopUpInfo: { @@ -30,7 +30,7 @@ const LocationPopUP = ({ feature: MapboxGeoJSONFeature; }; nonExpansible: boolean; - onClose: () => void; + className?: string; }) => { const [open, setOpen] = useState(nonExpansible); @@ -67,18 +67,12 @@ const LocationPopUP = ({ return (
-