1
0
Fork 0
mirror of synced 2024-08-14 09:31:49 +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) onDestroy(stopSyncing)
</script> </script>
{#if $selectedScreen} {#if routeComponentId === "screen"}
{#if routeComponentId === "screen"}
<ScreenSettingsPanel /> <ScreenSettingsPanel />
{:else if routeComponentId === "navigation"} {:else if routeComponentId === "navigation"}
<NavigationPanel /> <NavigationPanel />
{:else} {:else}
<ComponentSettingsPanel /> <ComponentSettingsPanel />
{/if}
{/if} {/if}
<slot /> <slot />

View file

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

View file

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