forked from MapComplete/MapComplete
UX: update gps-label indication if GPS is not available physically
This commit is contained in:
parent
0c3cfdc034
commit
d41afe7688
6 changed files with 79 additions and 29 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { createEventDispatcher } from "svelte"
|
||||
import { twJoin } from "tailwind-merge"
|
||||
import { Translation } from "../i18n/Translation"
|
||||
import { ariaLabel } from "../../Utils/ariaLabel"
|
||||
import { ariaLabel, ariaLabelStore } from "../../Utils/ariaLabel"
|
||||
import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
|
||||
/**
|
||||
|
|
@ -12,18 +12,21 @@
|
|||
export let cls = "m-0.5 p-0.5 sm:p-1 md:m-1"
|
||||
export let enabled: Store<boolean> = new ImmutableStore(true)
|
||||
export let arialabel: Translation = undefined
|
||||
export let arialabelDynamic : Store<Translation> = new ImmutableStore(arialabel)
|
||||
let arialabelString = arialabelDynamic.bind(tr => tr?.current)
|
||||
export let htmlElem: UIEventSource<HTMLElement> = undefined
|
||||
let _htmlElem: HTMLElement
|
||||
$: {
|
||||
htmlElem?.setData(_htmlElem)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<button
|
||||
bind:this={_htmlElem}
|
||||
on:click={(e) => dispatch("click", e)}
|
||||
on:keydown
|
||||
use:ariaLabel={arialabel}
|
||||
use:ariaLabelStore={arialabelString}
|
||||
class={twJoin(
|
||||
"pointer-events-auto relative h-fit w-fit rounded-full",
|
||||
cls,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue