-
Overview
+ Projects Overview
diff --git a/client/src/containers/projects/header/parameters/index.tsx b/client/src/containers/projects/header/parameters/index.tsx
index 2ed5dc9f..d5490040 100644
--- a/client/src/containers/projects/header/parameters/index.tsx
+++ b/client/src/containers/projects/header/parameters/index.tsx
@@ -21,6 +21,7 @@ export const PROJECT_PARAMETERS = [
{
key: FILTER_KEYS[1],
label: "Project size",
+ className: "w-[125px]",
options: [
{
label: "Small",
@@ -39,6 +40,7 @@ export const PROJECT_PARAMETERS = [
{
key: FILTER_KEYS[2],
label: "Carbon pricing type",
+ className: "w-[195px]",
options: [
{
label: "Market price",
@@ -53,6 +55,7 @@ export const PROJECT_PARAMETERS = [
{
key: FILTER_KEYS[3],
label: "Cost",
+ className: "w-[85px]",
options: [
{
label: "Total",
@@ -88,7 +91,7 @@ export default function ParametersProjects() {
handleParameters(v, parameter.key);
}}
>
-
+
diff --git a/client/src/containers/projects/map/controls/legend/index.tsx b/client/src/containers/projects/map/controls/legend/index.tsx
deleted file mode 100644
index d613699e..00000000
--- a/client/src/containers/projects/map/controls/legend/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useSetAtom } from "jotai";
-import { Layers } from "lucide-react";
-
-import { cn } from "@/lib/utils";
-
-import { projectsMapState } from "@/app/(projects)/store";
-
-const BUTTON_CLASSES = {
- default:
- "flex h-8 w-8 items-center justify-center rounded-full border border-white bg-white text-black shadow-md transition-colors",
- hover: "hover:border-gray-400 active:border-gray-400",
-};
-
-export default function LegendControl() {
- const setProjectsMapState = useSetAtom(projectsMapState);
- const handleMapLegend = () => {
- setProjectsMapState((prev) => ({
- ...prev,
- legendOpen: !prev.legendOpen,
- }));
- };
-
- return (
-
- );
-}
diff --git a/client/src/containers/projects/map/controls/zoom/index.tsx b/client/src/containers/projects/map/controls/zoom/index.tsx
index daa450ed..30214c4b 100644
--- a/client/src/containers/projects/map/controls/zoom/index.tsx
+++ b/client/src/containers/projects/map/controls/zoom/index.tsx
@@ -1,17 +1,15 @@
-import { useCallback, MouseEvent } from "react";
+import { useCallback, MouseEvent, useEffect, useState } from "react";
import { useMap, MapRef } from "react-map-gl";
-import { Plus, Minus } from "lucide-react";
+import { PlusIcon, MinusIcon } from "lucide-react";
import { cn } from "@/lib/utils";
-const BUTTON_CLASSES = {
- default:
- "flex h-8 w-8 items-center justify-center rounded-full border border-white bg-white text-black shadow-md transition-colors",
- hover: "hover:border-gray-400 active:border-gray-400",
- disabled: "opacity-50 cursor-default",
-};
+import { Button } from "@/components/ui/button";
+
+const BUTTON_CLASSES = "h-8 w-8";
+const ICON_CLASSES = "h-6 w-6 text-big-stone-50";
export default function ZoomControl({
id = "default",
@@ -22,14 +20,33 @@ export default function ZoomControl({
}) {
const { [id]: mapRef } = useMap();
- const zoom = mapRef?.getZoom() as NonNullable>;
- const minZoom = mapRef?.getMinZoom() as NonNullable<
+ const initialZoom = mapRef?.getMap().getZoom() as NonNullable<
+ ReturnType
+ >;
+ const minZoom = mapRef?.getMap().getMinZoom() as NonNullable<
ReturnType
>;
- const maxZoom = mapRef?.getMaxZoom() as NonNullable<
+ const maxZoom = mapRef?.getMap().getMaxZoom() as NonNullable<
ReturnType
>;
+ const [zoomState, setZoomState] =
+ useState>(initialZoom);
+
+ useEffect(() => {
+ if (!mapRef) return;
+
+ const onZoomEnd = () => {
+ setZoomState(mapRef.getMap().getZoom());
+ };
+
+ mapRef?.on("zoomend", onZoomEnd);
+
+ return () => {
+ mapRef.off("zoomend", onZoomEnd);
+ };
+ }, [mapRef]);
+
const increaseZoom = useCallback(
(e: MouseEvent) => {
e.stopPropagation();
@@ -51,32 +68,33 @@ export default function ZoomControl({
);
return (
-
-