forked from MapComplete/MapComplete
Refactoring: port element to Svelte
This commit is contained in:
parent
7ff3b6e912
commit
a6719da011
2 changed files with 28 additions and 16 deletions
20
src/UI/BigComponents/ClearGPSHistory.svelte
Normal file
20
src/UI/BigComponents/ClearGPSHistory.svelte
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<script lang="ts">
|
||||
import Trash from "@babeard/svelte-heroicons/mini/Trash"
|
||||
import { WithSelectedElementState } from "../../Models/ThemeViewState/WithSelectedElementState"
|
||||
import Translations from "../i18n/Translations"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
|
||||
export let state: WithSelectedElementState
|
||||
|
||||
function clear() {
|
||||
console.log("Clearing history")
|
||||
state.historicalUserLocations.features.setData([])
|
||||
state.selectedElement.setData(undefined)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<button on:click={() => clear()}>
|
||||
<Trash class="w-6 h-6" />
|
||||
<Tr t={Translations.t.general.removeLocationHistory} />
|
||||
</button>
|
||||
Loading…
Add table
Add a link
Reference in a new issue