mapcomplete/UI/BigComponents/OpenBackgroundSelectorButton.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
847 B
Svelte
Raw Normal View History

2023-06-07 22:45:42 +02:00
<script lang="ts">
/**
* A mapcontrol button which allows the user to select a different background.
* Even though the componenet is very small, it gets it's own class as it is often reused
*/
2023-06-15 16:12:46 +02:00
import { Square3Stack3dIcon } from "@babeard/svelte-heroicons/solid"
import type { SpecialVisualizationState } from "../SpecialVisualization"
import Translations from "../i18n/Translations"
import MapControlButton from "../Base/MapControlButton.svelte"
import Tr from "../Base/Tr.svelte"
2023-06-07 22:45:42 +02:00
export let state: SpecialVisualizationState
export let hideTooltip = false
2023-06-07 22:45:42 +02:00
</script>
2023-06-15 16:12:46 +02:00
<MapControlButton on:click={() => state.guistate.backgroundLayerSelectionIsOpened.setData(true)}>
<Square3Stack3dIcon class="h-6 w-6" />
{#if !hideTooltip}
2023-06-15 16:12:46 +02:00
<Tr cls="mx-2" t={Translations.t.general.backgroundSwitch} />
{/if}
2023-06-07 22:45:42 +02:00
</MapControlButton>