forked from MapComplete/MapComplete
Feature: add "recently visited themes" on index page
This commit is contained in:
parent
1723f268c0
commit
4db2c86c0f
5 changed files with 47 additions and 21 deletions
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { ImmutableStore, Store } from "../../Logic/UIEventSource"
|
||||
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
|
||||
import type { MinimalThemeInformation } from "../../Models/ThemeConfig/ThemeConfig"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
export let theme: MinimalThemeInformation & { isOfficial?: boolean }
|
||||
let isCustom: boolean = theme.id.startsWith("https://") || theme.id.startsWith("http://")
|
||||
export let state: { layoutToUse?: { id: string }; osmConnection: OsmConnection }
|
||||
|
||||
export let iconOnly: boolean = false
|
||||
$: title = Translations.T(
|
||||
theme.title,
|
||||
!isCustom && !theme.mustHaveLanguage ? "themes:" + theme.id + ".title" : undefined
|
||||
|
|
@ -71,12 +70,17 @@
|
|||
)
|
||||
</script>
|
||||
|
||||
<a class="low-interaction my-1 flex w-full items-center text-ellipsis rounded p-1" href={$href}>
|
||||
<Marker icons={theme.icon} size="block h-8 w-8 sm:h-11 sm:w-11 m-1 sm:mx-2 md:mx-4 shrink-0" />
|
||||
|
||||
<span class="flex flex-col overflow-hidden text-ellipsis text-xl font-bold">
|
||||
<Tr cls="" t={title} />
|
||||
<Tr cls="subtle text-base" t={description} />
|
||||
<slot />
|
||||
</span>
|
||||
</a>
|
||||
{#if iconOnly}
|
||||
<a class="low-interaction my-1 rounded p-1" href={$href}>
|
||||
<Marker icons={theme.icon} size="w-8 h-8 sm:w-11 sm:h-11" />
|
||||
</a>
|
||||
{:else}
|
||||
<a class="low-interaction my-1 flex w-full items-center text-ellipsis rounded p-1" href={$href}>
|
||||
<Marker icons={theme.icon} size="block h-8 w-8 sm:h-11 sm:w-11 m-1 sm:mx-2 md:mx-4 shrink-0" />
|
||||
<span class="flex flex-col overflow-hidden text-ellipsis text-xl font-bold">
|
||||
<Tr cls="" t={title} />
|
||||
<Tr cls="subtle text-base" t={description} />
|
||||
<slot />
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue