From ca498feb0cc0310271cba365d426438b5b6f1368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Fri, 22 Nov 2024 10:16:41 +0100 Subject: [PATCH] feat(client): Add tooltips to legend buttons --- .../src/components/map/legend/item/index.tsx | 78 +++++++++++-------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/client/src/components/map/legend/item/index.tsx b/client/src/components/map/legend/item/index.tsx index ea93150..33833cb 100644 --- a/client/src/components/map/legend/item/index.tsx +++ b/client/src/components/map/legend/item/index.tsx @@ -1,11 +1,13 @@ import { DraggableAttributes } from "@dnd-kit/core"; import { SyntheticListenerMap } from "@dnd-kit/core/dist/hooks/utilities"; +import * as React from "react"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Popover, PopoverArrow, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Skeleton } from "@/components/ui/skeleton"; import { Slider } from "@/components/ui/slider"; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import useLayerLegend from "@/hooks/use-layer-legend"; import useMapLayers from "@/hooks/use-map-layers"; import EyeSlashedIcon from "@/svgs/eye-slashed.svg"; @@ -64,15 +66,22 @@ const LegendItem = ({ id, settings, sortableAttributes, sortableListeners }: Leg
- - - + + + + + + + + Opacity + + - + + + + + + Toggle visibility + +
)}