Skip to content

Commit

Permalink
Merge pull request #1037 from Vizzuality/fix/initial-state
Browse files Browse the repository at this point in the history
wdpa area to tooltip
  • Loading branch information
mluena authored Jan 17, 2024
2 parents 5682ab5 + 82b0fb9 commit 607d705
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/components/select-multi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -23,7 +22,6 @@ export const Select: FC<MultiSelectProps> = (props: MultiSelectProps) => {
disabled = false,
options,
groups,
loading,
size = 'base',
theme = 'default',
state = 'none',
Expand Down
4 changes: 0 additions & 4 deletions src/containers/datasets/blue-carbon/widget.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Tooltip: React.FC = ({ active, settings }: TooltipProps) => {

return (
<div className="space-y-2 rounded-2xl bg-white py-2 px-6 font-sans text-sm shadow-lg">
{settings?.map(({ label, title, valueFormatted, value, unit, color, variant }) => (
{settings?.map(({ label, title, valueFormatted, value, unit, color }) => (
<div key={label} className="flex flex-col items-center">
{title && <p className="flex justify-center">{title}</p>}
<p className="flex items-center space-x-4">
Expand Down
1 change: 0 additions & 1 deletion src/containers/datasets/locations/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/containers/datasets/national-dashboard/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
1 change: 0 additions & 1 deletion src/containers/locations-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/containers/map/location-pop-up/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 0 additions & 2 deletions src/containers/widgets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ const WidgetsContainer: React.FC = () => {
})}
</div>
)}
{/* TO - DO - review this condition after reviewing empty widgets behavior */}
{widgets.length === 0 && <NoData />}
{!!widgets.length && !mapSettings ? (
<div className="flex w-full justify-center py-4 print:hidden">
<Helper
Expand Down

0 comments on commit 607d705

Please sign in to comment.