forked from MapComplete/MapComplete
Fix unit tests (no doctests yet)
This commit is contained in:
parent
325b8831f2
commit
7cc184fdd8
9 changed files with 154 additions and 81 deletions
|
@ -52,12 +52,14 @@
|
|||
|
||||
<svelte:element
|
||||
this={options?.url == undefined ? "span" : "a"}
|
||||
class={options.extraClasses}
|
||||
class={(options.extraClasses??"") + ' hover:shadow-xl transition-[color,background-color,box-shadow] hover:bg-unsubtle'}
|
||||
target={options?.newTab ? "_blank" : ""}
|
||||
{href}
|
||||
>
|
||||
<slot name="image">
|
||||
<template bind:this={imgElem} />
|
||||
{#if imgElem}
|
||||
<template bind:this={imgElem} />
|
||||
{/if}
|
||||
</slot>
|
||||
<slot name="message">
|
||||
<template bind:this={msgElem} />
|
||||
|
@ -67,9 +69,9 @@
|
|||
<style lang="scss">
|
||||
span,
|
||||
a {
|
||||
@apply flex p-3 my-2 rounded-lg hover:shadow-xl transition-[color,background-color,box-shadow];
|
||||
@apply flex p-3 my-2 rounded-lg ;
|
||||
@apply items-center w-full no-underline;
|
||||
@apply bg-subtle text-black hover:bg-unsubtle;
|
||||
@apply bg-subtle text-black;
|
||||
|
||||
:global(img) {
|
||||
@apply block justify-center flex-none mr-4 h-11 w-11;
|
||||
|
|
|
@ -54,18 +54,34 @@
|
|||
|
||||
<section>
|
||||
<slot name="title" />
|
||||
<div class:gridview={onMainScreen}>
|
||||
{#if ($search === undefined || $search === "") && !isCustom}
|
||||
<CustomGeneratorButton userDetails={state.osmConnection.userDetails} />
|
||||
<ProfessionalServicesButton />
|
||||
{/if}
|
||||
|
||||
{#each filteredThemes as theme}
|
||||
{#if theme !== undefined && !(hideThemes && theme?.hideFromOverview)}
|
||||
<ThemeButton {theme} {isCustom} userDetails={state.osmConnection.userDetails} {state} />
|
||||
{#if onMainScreen}
|
||||
<div class="md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{#if ($search === undefined || $search === "") && !isCustom}
|
||||
<CustomGeneratorButton userDetails={state.osmConnection.userDetails} />
|
||||
<ProfessionalServicesButton />
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
{#each filteredThemes as theme}
|
||||
{#if theme !== undefined && !(hideThemes && theme?.hideFromOverview)}
|
||||
<ThemeButton {theme} {isCustom} userDetails={state.osmConnection.userDetails} {state} />
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
{:else }
|
||||
<div>
|
||||
{#if ($search === undefined || $search === "") && !isCustom}
|
||||
<CustomGeneratorButton userDetails={state.osmConnection.userDetails} />
|
||||
<ProfessionalServicesButton />
|
||||
{/if}
|
||||
|
||||
{#each filteredThemes as theme}
|
||||
{#if theme !== undefined && !(hideThemes && theme?.hideFromOverview)}
|
||||
<ThemeButton {theme} {isCustom} userDetails={state.osmConnection.userDetails} {state} />
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if filteredThemes.length == 0}
|
||||
<NoThemeResultButton {search} />
|
||||
|
@ -75,9 +91,5 @@
|
|||
<style lang="scss">
|
||||
section {
|
||||
@apply flex flex-col;
|
||||
|
||||
div.gridview {
|
||||
@apply md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3 gap-4;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue