-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
125 additions
and
236 deletions.
There are no files selected for viewing
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
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
50 changes: 0 additions & 50 deletions
50
client/src/containers/datasets/layers/net-forest-carbon-flux/legend.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
client/src/containers/datasets/layers/soil-carbon-density/legend.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
client/src/containers/datasets/layers/tree-cover-loss/legend.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
client/src/containers/datasets/layers/tree-cover/legend.tsx
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
'use-client'; | ||
|
||
import type { LayerSettings } from '@/types/layers'; | ||
import type { Legend } from '@/types/map'; | ||
|
||
import LegendSettings from '@/containers/legend-settings'; | ||
|
||
const BasicLegendItem = ({ | ||
name, | ||
settings, | ||
items, | ||
notes, | ||
}: { | ||
name: Legend['name']; | ||
settings: LayerSettings; | ||
items: Legend['items']; | ||
notes?: Legend['notes']; | ||
}) => ( | ||
<div className="flex w-full"> | ||
{items.length === 1 ? ( | ||
<div className="flex w-full flex-col space-y-2"> | ||
<div className="flex w-full justify-between"> | ||
<div className="flex w-full items-center space-x-2"> | ||
<div className="h-3 w-3 rounded-sm" style={{ backgroundColor: items[0]?.color }} /> | ||
<p className="text-xs capitalize">{name}</p> | ||
</div> | ||
<LegendSettings settings={settings} /> | ||
</div> | ||
{items[0]?.notes && <p className="text-xs text-gray-500">{items[0]?.notes}</p>} | ||
</div> | ||
) : ( | ||
<div className="flex w-full justify-between"> | ||
<div> | ||
<div className="flex w-full justify-between"> | ||
<p className="text-xs capitalize">{name}</p> | ||
<LegendSettings settings={settings} /> | ||
</div> | ||
</div> | ||
{items.map((item) => ( | ||
<div key={item?.color} className="flex w-full items-center space-x-2"> | ||
<div className="h-3 w-3 rounded-sm" style={{ backgroundColor: item.color }} /> | ||
<p className="text-xs capitalize">{item.value}</p> | ||
</div> | ||
))} | ||
{notes && <p className="text-xs text-gray-500">{notes}</p>} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
|
||
export default BasicLegendItem; |
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
Oops, something went wrong.