-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from Vizzuality/SKY30-158-add-legend-to-establ…
…ishment [SKY30-158]: establishment legend
- Loading branch information
Showing
6 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
frontend/src/containers/data-tool/content/map/layers-toolbox/legend/establishment/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<ul className="space-y-3 font-mono text-xs"> | ||
{items.map(({ label, pattern }) => ( | ||
<li key={pattern} className={ITEM_LIST_CLASSES}> | ||
<Icon icon={PATTERNS[pattern]} className={ICON_CLASSES} /> | ||
<span>{label}</span> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
}; | ||
|
||
export default EEZLayerLegend; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.