MapComplete/src/UI/BigComponents/ThemesList.svelte

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

40 lines
1.2 KiB
Svelte
Raw Normal View History

2023-02-03 22:28:11 +01:00
<script lang="ts">
import NoThemeResultButton from "./NoThemeResultButton.svelte"
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
import { UIEventSource } from "../../Logic/UIEventSource"
2023-02-03 22:28:11 +01:00
import ThemeButton from "./ThemeButton.svelte"
import { MinimalThemeInformation } from "../../Models/ThemeConfig/ThemeConfig"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
2023-02-03 22:28:11 +01:00
export let search: UIEventSource<string>
export let themes: MinimalThemeInformation[]
export let state: { osmConnection: OsmConnection }
2023-02-03 22:28:11 +01:00
export let hasSelection : boolean = true
2023-07-05 23:39:40 +02:00
2023-02-03 22:28:11 +01:00
</script>
<section class="w-full">
2023-02-03 22:28:11 +01:00
<slot name="title" />
2024-04-24 21:02:00 +02:00
<div class="theme-list my-2 gap-4 md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3">
{#each themes as theme (theme.id)}
<ThemeButton
{theme}
{state}
>
{#if $search && hasSelection && themes?.[0] === theme}
<span class="thanks hidden-on-mobile" aria-hidden="true">
<Tr t={Translations.t.general.morescreen.enterToOpen} />
</span>
2023-02-09 00:10:59 +01:00
{/if}
</ThemeButton>
{/each}
</div>
{#if themes?.length === 0}
2023-02-03 22:28:11 +01:00
<NoThemeResultButton {search} />
{/if}
</section>