MapComplete/src/UI/Popup/DisabledQuestions.svelte

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

28 lines
802 B
Svelte
Raw Normal View History

<script lang="ts">
import DisabledQuestionsLayer from "./DisabledQuestionsLayer.svelte"
import { Stores } from "../../Logic/UIEventSource"
2024-10-09 00:07:23 +02:00
import Tr from "../Base/Tr.svelte"
import Translations from "../i18n/Translations"
/**
* Shows _all_ disabled questions
*/
export let state
let layers = state.layout.layers.filter(l => l.isNormal())
let allDisabled = Stores.concat<string>(layers.map(l => state.userRelatedState.getThemeDisabled(state.layout.id, l.id))).map(l => [].concat(...l))
2024-10-09 00:07:23 +02:00
const t = Translations.t.general.questions
</script>
2024-10-09 00:07:23 +02:00
<h3>
<Tr t={t.disabledTitle} />
</h3>
{#if $allDisabled.length === 0}
2024-10-09 00:07:23 +02:00
<Tr t={t.noneDisabled} />
{:else}
2024-10-09 00:07:23 +02:00
<Tr t={t.disabledIntro} />
{#each layers as layer (layer.id)}
<DisabledQuestionsLayer {state} {layer} />
{/each}
{/if}