forked from MapComplete/MapComplete
Tweak styling of search in ThemeINtroPanel
This commit is contained in:
parent
36b2c1bf44
commit
ba47d1bfad
1 changed files with 9 additions and 13 deletions
|
@ -12,11 +12,9 @@
|
||||||
import { GeoLocationState } from "../../Logic/State/GeoLocationState"
|
import { GeoLocationState } from "../../Logic/State/GeoLocationState"
|
||||||
import If from "../Base/If.svelte"
|
import If from "../Base/If.svelte"
|
||||||
import { ExclamationTriangleIcon } from "@babeard/svelte-heroicons/mini"
|
import { ExclamationTriangleIcon } from "@babeard/svelte-heroicons/mini"
|
||||||
import type { Readable } from "svelte/store"
|
|
||||||
import Add from "../../assets/svg/Add.svelte"
|
import Add from "../../assets/svg/Add.svelte"
|
||||||
import Location_refused from "../../assets/svg/Location_refused.svelte"
|
import Location_refused from "../../assets/svg/Location_refused.svelte"
|
||||||
import Crosshair from "../../assets/svg/Crosshair.svelte"
|
import Location from "../../assets/svg/Location.svelte"
|
||||||
import FromHtml from "../Base/FromHtml.svelte"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The theme introduction panel
|
* The theme introduction panel
|
||||||
|
@ -32,8 +30,6 @@
|
||||||
state.geolocation.geolocationState.permission
|
state.geolocation.geolocationState.permission
|
||||||
let currentGPSLocation = state.geolocation.geolocationState.currentGPSLocation
|
let currentGPSLocation = state.geolocation.geolocationState.currentGPSLocation
|
||||||
|
|
||||||
geopermission.addCallback((perm) => console.log(">>>> Permission", perm))
|
|
||||||
|
|
||||||
function jumpToCurrentLocation() {
|
function jumpToCurrentLocation() {
|
||||||
const glstate = state.geolocation.geolocationState
|
const glstate = state.geolocation.geolocationState
|
||||||
if (glstate.currentGPSLocation.data !== undefined) {
|
if (glstate.currentGPSLocation.data !== undefined) {
|
||||||
|
@ -58,8 +54,8 @@
|
||||||
<Tr t={Translations.t.general.welcomeExplanation.addNew} />
|
<Tr t={Translations.t.general.welcomeExplanation.addNew} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Tr t={layout.descriptionTail}/>
|
<Tr t={layout.descriptionTail} />
|
||||||
|
|
||||||
<!-- Buttons: open map, go to location, search -->
|
<!-- Buttons: open map, go to location, search -->
|
||||||
<NextButton clss="primary w-full" on:click={() => state.guistate.themeIsOpened.setData(false)}>
|
<NextButton clss="primary w-full" on:click={() => state.guistate.themeIsOpened.setData(false)}>
|
||||||
<div class="flex w-full justify-center text-2xl">
|
<div class="flex w-full justify-center text-2xl">
|
||||||
|
@ -71,7 +67,7 @@
|
||||||
<If condition={state.featureSwitches.featureSwitchGeolocation}>
|
<If condition={state.featureSwitches.featureSwitchGeolocation}>
|
||||||
{#if $currentGPSLocation !== undefined || $geopermission === "prompt"}
|
{#if $currentGPSLocation !== undefined || $geopermission === "prompt"}
|
||||||
<button class="flex w-full items-center gap-x-2" on:click={jumpToCurrentLocation}>
|
<button class="flex w-full items-center gap-x-2" on:click={jumpToCurrentLocation}>
|
||||||
<Crosshair class="h-8 w-8" />
|
<Location class="h-8 w-8" />
|
||||||
<Tr t={Translations.t.general.openTheMapAtGeolocation} />
|
<Tr t={Translations.t.general.openTheMapAtGeolocation} />
|
||||||
</button>
|
</button>
|
||||||
<!-- No geolocation granted - we don't show the button -->
|
<!-- No geolocation granted - we don't show the button -->
|
||||||
|
@ -81,7 +77,7 @@
|
||||||
on:click={jumpToCurrentLocation}
|
on:click={jumpToCurrentLocation}
|
||||||
>
|
>
|
||||||
<!-- Even though disabled, when clicking we request the location again in case the contributor dismissed the location popup -->
|
<!-- Even though disabled, when clicking we request the location again in case the contributor dismissed the location popup -->
|
||||||
<Crosshair
|
<Location
|
||||||
class="h-8 w-8"
|
class="h-8 w-8"
|
||||||
style="animation: 3s linear 0s infinite normal none running spin;"
|
style="animation: 3s linear 0s infinite normal none running spin;"
|
||||||
/>
|
/>
|
||||||
|
@ -94,7 +90,7 @@
|
||||||
</button>
|
</button>
|
||||||
{:else}
|
{:else}
|
||||||
<button class="disabled flex w-full items-center gap-x-2">
|
<button class="disabled flex w-full items-center gap-x-2">
|
||||||
<Crosshair
|
<Location
|
||||||
class="h-8 w-8"
|
class="h-8 w-8"
|
||||||
style="animation: 3s linear 0s infinite normal none running spin;"
|
style="animation: 3s linear 0s infinite normal none running spin;"
|
||||||
/>
|
/>
|
||||||
|
@ -105,9 +101,9 @@
|
||||||
|
|
||||||
<If condition={state.featureSwitches.featureSwitchSearch}>
|
<If condition={state.featureSwitches.featureSwitchSearch}>
|
||||||
<div
|
<div
|
||||||
class=".button low-interaction m-1 flex h-fit w-full items-center gap-x-2 rounded border p-2"
|
class=".button low-interaction m-1 flex flex-wrap h-fit w-full items-center justify-end gap-x-2 gap-y-2 rounded border p-1"
|
||||||
>
|
>
|
||||||
<div class="w-full">
|
<div style="min-width: 16rem; " class="grow">
|
||||||
<Geosearch
|
<Geosearch
|
||||||
bounds={state.mapProperties.bounds}
|
bounds={state.mapProperties.bounds}
|
||||||
on:searchCompleted={() => state.guistate.themeIsOpened.setData(false)}
|
on:searchCompleted={() => state.guistate.themeIsOpened.setData(false)}
|
||||||
|
@ -121,7 +117,7 @@
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class={twJoin(
|
class={twJoin(
|
||||||
"flex items-center justify-between gap-x-2",
|
"flex shrink-0 w-fit items-center justify-between gap-x-2 small",
|
||||||
!searchEnabled && "disabled"
|
!searchEnabled && "disabled"
|
||||||
)}
|
)}
|
||||||
on:click={() => triggerSearch.ping()}
|
on:click={() => triggerSearch.ping()}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue