-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adjust desigin of layer header and tabs (#2245)
- Loading branch information
1 parent
ce51272
commit 8308f62
Showing
13 changed files
with
69 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@undp-data/undp-bulma": patch | ||
--- | ||
|
||
fix: fixed customised tab design for bulma. Removed border-radius from boxed/toggled tab. |
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,5 @@ | ||
--- | ||
"geohub": patch | ||
--- | ||
|
||
fix: adjust desigin of layer header and tabs |
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
78 changes: 36 additions & 42 deletions
78
sites/geohub/src/components/maplibre/LegendTypeSwitcher.svelte
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 |
---|---|---|
@@ -1,46 +1,40 @@ | ||
<script lang="ts"> | ||
export let legendType: 'default' | 'classify' = 'default'; | ||
const handleLegendTypeChange = () => { | ||
legendType = legendType === 'default' ? 'classify' : 'default'; | ||
}; | ||
import { handleEnterKey } from '$lib/helper'; | ||
let tabs: { label: 'default' | 'classify'; icon: string }[] = [ | ||
{ | ||
label: 'default', | ||
icon: 'fa-solid fa-minus' | ||
}, | ||
{ | ||
label: 'classify', | ||
icon: 'fa-solid fa-list' | ||
} | ||
]; | ||
export let legendType: 'default' | 'classify' = tabs[0].label; | ||
</script> | ||
|
||
<div class="centered pb-2" data-testid="legend-type-switcher-container"> | ||
<div class="field has-addons"> | ||
<p class="control"> | ||
<button | ||
data-testid="legend-type-switcher-default" | ||
class="button is-normal {`${ | ||
legendType === 'default' ? 'is-primary is-active' : 'is-primary is-light' | ||
}`}" | ||
on:click={handleLegendTypeChange} | ||
> | ||
<span> | ||
<i class="fa-solid fa-minus" /> | ||
Default | ||
</span> | ||
</button> | ||
</p> | ||
<p class="control"> | ||
<button | ||
data-testid="legend-type-switcher-classify" | ||
class="button is-normal {`${ | ||
legendType === 'classify' ? 'is-primary is-active' : 'is-primary is-light' | ||
}`}" | ||
on:click={handleLegendTypeChange} | ||
> | ||
<span> | ||
<i class="fa-solid fa-list" /> | ||
Classify | ||
</span> | ||
</button> | ||
</p> | ||
</div> | ||
<div class="tabs is-centered is-toggle"> | ||
<ul> | ||
{#each tabs as tab} | ||
<li class={legendType === tab.label ? 'is-active' : ''}> | ||
<!-- svelte-ignore a11y-missing-attribute --> | ||
<a | ||
class="has-text-weight-bold" | ||
role="tab" | ||
tabindex="0" | ||
data-sveltekit-preload-code="off" | ||
data-sveltekit-preload-data="off" | ||
on:click={() => { | ||
legendType = tab.label; | ||
}} | ||
on:keydown={handleEnterKey} | ||
> | ||
<span class="icon is-small"><i class={tab.icon} aria-hidden="true"></i></span> | ||
<span class="is-capitalized">{tab.label}</span> | ||
</a> | ||
</li> | ||
{/each} | ||
</ul> | ||
</div> | ||
|
||
<style lang="scss"> | ||
:global(.centered) { | ||
width: max-content; | ||
margin: auto !important; | ||
} | ||
</style> |
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
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 |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
.editor-button { | ||
position: absolute; | ||
top: -0.8em; | ||
top: 0em; | ||
right: 0em; | ||
z-index: 10; | ||
} | ||
|
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
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
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