From 82b0fb92f427c8ccc23dc1bb437337dde8b82270 Mon Sep 17 00:00:00 2001 From: mluena Date: Wed, 17 Jan 2024 10:18:22 +0100 Subject: [PATCH] wdpa area to tooltip --- src/components/select-multi/index.tsx | 2 -- src/containers/datasets/blue-carbon/widget.tsx | 4 ---- src/containers/datasets/carbon-market-potential/tooltip.tsx | 2 +- src/containers/datasets/locations/hooks.tsx | 1 - src/containers/datasets/national-dashboard/widget.tsx | 2 -- src/containers/datasets/restoration/overview/hooks.tsx | 2 -- src/containers/locations-list/index.tsx | 1 - src/containers/map/index.tsx | 3 --- src/containers/map/location-pop-up/index.tsx | 2 +- src/containers/widgets/index.tsx | 2 -- src/layouts/widgets/index.tsx | 4 ---- 11 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/components/select-multi/index.tsx b/src/components/select-multi/index.tsx index 5e5b427a5..76eb6b5d3 100644 --- a/src/components/select-multi/index.tsx +++ b/src/components/select-multi/index.tsx @@ -6,7 +6,6 @@ import { Listbox } from '@headlessui/react'; import { Float } from '@headlessui-float/react'; import Icon from 'components/icon'; -import Loading from 'components/loading'; import ARROW_SVG from 'svgs/ui/arrow.svg?sprite'; @@ -23,7 +22,6 @@ export const Select: FC = (props: MultiSelectProps) => { disabled = false, options, groups, - loading, size = 'base', theme = 'default', state = 'none', diff --git a/src/containers/datasets/blue-carbon/widget.tsx b/src/containers/datasets/blue-carbon/widget.tsx index 2827e5366..754fed7a6 100644 --- a/src/containers/datasets/blue-carbon/widget.tsx +++ b/src/containers/datasets/blue-carbon/widget.tsx @@ -1,9 +1,5 @@ import { useCallback, useState } from 'react'; -import { useRouter } from 'next/router'; - -import cn from 'lib/classnames'; - import { analysisAtom } from 'store/analysis'; import { useQueryClient } from '@tanstack/react-query'; diff --git a/src/containers/datasets/carbon-market-potential/tooltip.tsx b/src/containers/datasets/carbon-market-potential/tooltip.tsx index bbf0c14ec..deffb8da8 100644 --- a/src/containers/datasets/carbon-market-potential/tooltip.tsx +++ b/src/containers/datasets/carbon-market-potential/tooltip.tsx @@ -16,7 +16,7 @@ const Tooltip: React.FC = ({ active, settings }: TooltipProps) => { return (
- {settings?.map(({ label, title, valueFormatted, value, unit, color, variant }) => ( + {settings?.map(({ label, title, valueFormatted, value, unit, color }) => (
{title &&

{title}

}

diff --git a/src/containers/datasets/locations/hooks.tsx b/src/containers/datasets/locations/hooks.tsx index 88d944a1e..2efdef5da 100644 --- a/src/containers/datasets/locations/hooks.tsx +++ b/src/containers/datasets/locations/hooks.tsx @@ -50,7 +50,6 @@ export function useLocation( return useQuery(['location', locationType, _id], () => fetchLocation(_id), { placeholderData: { data: {} as DataResponse['data'][0] }, - select: ({ data }) => { if (locationType === 'custom-area') { return { diff --git a/src/containers/datasets/national-dashboard/widget.tsx b/src/containers/datasets/national-dashboard/widget.tsx index 7f894adff..58d7b9ec3 100644 --- a/src/containers/datasets/national-dashboard/widget.tsx +++ b/src/containers/datasets/national-dashboard/widget.tsx @@ -6,8 +6,6 @@ import cn from 'lib/classnames'; import chroma from 'chroma-js'; -import { useLocation } from 'containers/datasets/locations/hooks'; - import Loading from 'components/loading'; import { WIDGET_CARD_WRAPPER_STYLE, WIDGET_SUBTITLE_STYLE } from 'styles/widgets'; diff --git a/src/containers/datasets/restoration/overview/hooks.tsx b/src/containers/datasets/restoration/overview/hooks.tsx index 76ed98303..0ce9b79f1 100644 --- a/src/containers/datasets/restoration/overview/hooks.tsx +++ b/src/containers/datasets/restoration/overview/hooks.tsx @@ -1,5 +1,3 @@ -import type { SourceProps, LayerProps } from 'react-map-gl'; - import { useRouter } from 'next/router'; import { numberFormat } from 'lib/format'; diff --git a/src/containers/locations-list/index.tsx b/src/containers/locations-list/index.tsx index ff296ff76..47ff8d579 100644 --- a/src/containers/locations-list/index.tsx +++ b/src/containers/locations-list/index.tsx @@ -7,7 +7,6 @@ import { useRouter } from 'next/router'; import cn from 'lib/classnames'; import { drawingToolAtom, drawingUploadToolAtom } from 'store/drawing-tool'; -import { activeLayersAtom } from 'store/layers'; import { locationBoundsAtom } from 'store/map'; import { mapSettingsAtom } from 'store/map-settings'; diff --git a/src/containers/map/index.tsx b/src/containers/map/index.tsx index 8a614b4c0..9262753e1 100644 --- a/src/containers/map/index.tsx +++ b/src/containers/map/index.tsx @@ -37,7 +37,6 @@ 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'; @@ -53,8 +52,6 @@ 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'; diff --git a/src/containers/map/location-pop-up/index.tsx b/src/containers/map/location-pop-up/index.tsx index cec9232be..aaa5992c6 100644 --- a/src/containers/map/location-pop-up/index.tsx +++ b/src/containers/map/location-pop-up/index.tsx @@ -78,7 +78,7 @@ const LocationPopUP = ({ setLocationBounds(bbox as typeof locationBounds); } - push(`/wdpa/${location.iso}/${queryParams ? `?${queryParams}` : ''}`, null); + push(`/wdpa/${location.location_id}/${queryParams ? `?${queryParams}` : ''}`, null); } }, [setLocationBounds, push, queryParams, locations, info]); diff --git a/src/containers/widgets/index.tsx b/src/containers/widgets/index.tsx index e7e98e2d3..d6e7e9ba3 100644 --- a/src/containers/widgets/index.tsx +++ b/src/containers/widgets/index.tsx @@ -204,8 +204,6 @@ const WidgetsContainer: React.FC = () => { })}

)} - {/* TO - DO - review this condition after reviewing empty widgets behavior */} - {widgets.length === 0 && } {!!widgets.length && !mapSettings ? (
{ const { children } = props; const isFullScreen = useRecoilValue(fullScreenAtom); - const isPrintingMode = useRecoilValue(printModeState); return (