MapComplete/src/UI/Popup/DisabledQuestions.svelte

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

32 lines
964 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"
import type { SpecialVisualizationState } from "../SpecialVisualization"
import ThemeViewState from "../../Models/ThemeViewState"
/**
* Shows _all_ disabled questions
*/
export let state: ThemeViewState
let layers = state.theme.layers.filter((l) => l.isNormal())
2024-11-28 12:00:23 +01:00
let allDisabled = Stores.concat<string>(
layers.map((l) => state.userRelatedState.getThemeDisabled(state.theme.id, l.id))
2024-11-28 12:00:23 +01:00
).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}