MapComplete/src/UI/Image/NearbyImagesCollapsed.svelte

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

47 lines
1.6 KiB
Svelte
Raw Normal View History

<script lang="ts">
2024-01-11 15:22:45 +01:00
import { UIEventSource } from "../../Logic/UIEventSource"
2023-12-19 22:08:00 +01:00
import type { OsmTags } from "../../Models/OsmFeature"
import type { SpecialVisualizationState } from "../SpecialVisualization"
import type { Feature } from "geojson"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
import NearbyImages from "./NearbyImages.svelte"
import { XCircleIcon } from "@babeard/svelte-heroicons/solid"
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
import LoginToggle from "../Base/LoginToggle.svelte"
import { ariaLabel } from "../../Utils/ariaLabel"
import { Accordion, AccordionItem, Modal } from "flowbite-svelte"
2024-06-18 03:33:11 +02:00
import AccordionSingle from "../Flowbite/AccordionSingle.svelte"
import Popup from "../Base/Popup.svelte"
2024-01-11 15:22:45 +01:00
export let tags: UIEventSource<OsmTags>
2023-12-19 22:08:00 +01:00
export let state: SpecialVisualizationState
export let lon: number
export let lat: number
export let feature: Feature
2023-12-19 22:08:00 +01:00
export let linkable: boolean = true
export let layer: LayerConfig
const t = Translations.t.image.nearby
let enableLogin = state.featureSwitches.featureSwitchEnableLogin
export let shown = new UIEventSource(false)
</script>
{#if enableLogin.data}
2024-10-19 14:44:55 +02:00
<button
on:click={() => {
shown.set(!shown.data)
}}
>
<Tr t={t.seeNearby} />
</button>
<Popup {shown} bodyPadding="p-4">
<span slot="header">
2024-06-24 13:11:35 +02:00
<Tr t={t.seeNearby} />
</span>
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable} {layer} />
</Popup>
2024-06-24 13:11:35 +02:00
{/if}