From da073c2ecc12e5e6b34b46f32c84452f296063b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Gonz=C3=A1lez=20Mu=C3=B1oz?= Date: Mon, 27 Nov 2023 08:25:06 +0100 Subject: [PATCH] establishment legend --- .../legend/establishment/index.tsx | 32 +++++++ frontend/src/lib/json-converter/index.ts | 2 + frontend/src/styles/icons/designated.svg | 46 ++++++++++ frontend/src/styles/icons/implemented.svg | 79 ++++++++++++++++++ frontend/src/styles/icons/managed.svg | 46 ++++++++++ frontend/src/styles/icons/proposed.svg | 83 +++++++++++++++++++ 6 files changed, 288 insertions(+) create mode 100644 frontend/src/containers/data-tool/content/map/layers-toolbox/legend/establishment/index.tsx create mode 100644 frontend/src/styles/icons/designated.svg create mode 100644 frontend/src/styles/icons/implemented.svg create mode 100644 frontend/src/styles/icons/managed.svg create mode 100644 frontend/src/styles/icons/proposed.svg diff --git a/frontend/src/containers/data-tool/content/map/layers-toolbox/legend/establishment/index.tsx b/frontend/src/containers/data-tool/content/map/layers-toolbox/legend/establishment/index.tsx new file mode 100644 index 00000000..ea9d1819 --- /dev/null +++ b/frontend/src/containers/data-tool/content/map/layers-toolbox/legend/establishment/index.tsx @@ -0,0 +1,32 @@ +import Icon from '@/components/ui/icon'; +import DesignatedIcon from '@/styles/icons/designated.svg?sprite'; +import ImplementedIcon from '@/styles/icons/implemented.svg?sprite'; +import ManagedIcon from '@/styles/icons/managed.svg?sprite'; +import ProposedIcon from '@/styles/icons/proposed.svg?sprite'; + +const ITEM_LIST_CLASSES = 'flex items-center space-x-2'; +const ICON_CLASSES = 'h-7 w-7 border border-black rounded-full'; + +const PATTERNS = { + proposed: ProposedIcon, + managed: ManagedIcon, + designated: DesignatedIcon, + implemented: ImplementedIcon, +}; + +const EEZLayerLegend = (config: { items: { label: string; pattern: string }[] }) => { + const { items } = config; + + return ( + + ); +}; + +export default EEZLayerLegend; diff --git a/frontend/src/lib/json-converter/index.ts b/frontend/src/lib/json-converter/index.ts index af97ac18..3fffe4a4 100644 --- a/frontend/src/lib/json-converter/index.ts +++ b/frontend/src/lib/json-converter/index.ts @@ -9,6 +9,7 @@ import { JSONConfiguration, JSONConverter } from '@deck.gl/json/typed'; // LegendTypeGradient, // } from '@/components/map/legend/item-types'; import EEZLayerLegend from '@/containers/data-tool/content/map/layers-toolbox/legend/eez'; +import EstablishmentLayerLegend from '@/containers/data-tool/content/map/layers-toolbox/legend/establishment'; import EEZLayerPopup from '@/containers/data-tool/content/map/popup/eez'; import GenericPopup from '@/containers/data-tool/content/map/popup/generic'; import ProtectedAreaPopup from '@/containers/data-tool/content/map/popup/protected-area'; @@ -30,6 +31,7 @@ export const JSON_CONFIGURATION = new JSONConfiguration({ EEZLayerLegend, GenericPopup, ProtectedAreaPopup, + EstablishmentLayerLegend, // LegendTypeBasic, // LegendTypeChoropleth, // LegendTypeGradient, diff --git a/frontend/src/styles/icons/designated.svg b/frontend/src/styles/icons/designated.svg new file mode 100644 index 00000000..04f0c7d4 --- /dev/null +++ b/frontend/src/styles/icons/designated.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/styles/icons/implemented.svg b/frontend/src/styles/icons/implemented.svg new file mode 100644 index 00000000..837b68de --- /dev/null +++ b/frontend/src/styles/icons/implemented.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/styles/icons/managed.svg b/frontend/src/styles/icons/managed.svg new file mode 100644 index 00000000..305e9390 --- /dev/null +++ b/frontend/src/styles/icons/managed.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/styles/icons/proposed.svg b/frontend/src/styles/icons/proposed.svg new file mode 100644 index 00000000..3b44d92c --- /dev/null +++ b/frontend/src/styles/icons/proposed.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +