1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

Improve route safety

This commit is contained in:
Andrew Kingston 2023-08-23 11:18:14 +01:00
parent 38e8ff879a
commit f1121a11a3
3 changed files with 16 additions and 19 deletions

View file

@ -42,13 +42,11 @@
onDestroy(stopSyncing)
</script>
{#if $selectedScreen}
{#if routeComponentId === "screen"}
<ScreenSettingsPanel />
{:else if routeComponentId === "navigation"}
<NavigationPanel />
{:else}
<ComponentSettingsPanel />
{/if}
{#if routeComponentId === "screen"}
<ScreenSettingsPanel />
{:else if routeComponentId === "navigation"}
<NavigationPanel />
{:else}
<ComponentSettingsPanel />
{/if}
<slot />

View file

@ -1,14 +1,11 @@
<script>
import ScreenList from "./ScreenList/index.svelte"
import ComponentList from "./ComponentList/index.svelte"
import { selectedScreen } from "builderStore"
</script>
<div class="panel">
<ScreenList />
{#if $selectedScreen}
<ComponentList />
{/if}
<ComponentList />
</div>
<style>

View file

@ -2,7 +2,7 @@
import AppPanel from "./_components/AppPanel.svelte"
import * as routify from "@roxi/routify"
import { syncURLToState } from "helpers/urlStateSync"
import { store } from "builderStore"
import { store, selectedScreen } from "builderStore"
import { onDestroy } from "svelte"
import LeftPanel from "./_components/LeftPanel.svelte"
@ -22,13 +22,15 @@
onDestroy(stopSyncing)
</script>
<div class="design">
<div class="content">
<LeftPanel />
<AppPanel />
<slot />
{#if $selectedScreen}
<div class="design">
<div class="content">
<LeftPanel />
<AppPanel />
<slot />
</div>
</div>
</div>
{/if}
<style>
.design {