diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte
index 932a3d360a..03a0aad9ba 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte
@@ -22,8 +22,8 @@
}
const validate = id => {
- if (id === "screen") return true
- if (id === "navigation") return true
+ if (id === `${$store.selectedScreenId}-screen`) return true
+ if (id === `${$store.selectedScreenId}-navigation`) return true
return !!findComponent($selectedScreen.props, id)
}
@@ -42,9 +42,9 @@
onDestroy(stopSyncing)
-{#if routeComponentId === "screen"}
+{#if routeComponentId === `${$store.selectedScreenId}-screen`}
-{:else if routeComponentId === "navigation"}
+{:else if routeComponentId === `${$store.selectedScreenId}-navigation`}
{:else}
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte
index eb186dfed5..a1735fc6f4 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte
@@ -49,23 +49,27 @@
{
- $store.selectedComponentId = "screen"
+ $store.selectedComponentId = `${$store.selectedScreenId}-screen`
}}
id={`component-screen`}
- selectedBy={$userSelectedResourceMap["screen"]}
+ selectedBy={$userSelectedResourceMap[
+ `${$store.selectedScreenId}-screen`
+ ]}
>
{
- $store.selectedComponentId = "navigation"
+ $store.selectedComponentId = `${$store.selectedScreenId}-navigation`
}}
id={`component-nav`}
- selectedBy={$userSelectedResourceMap["navigation"]}
+ selectedBy={$userSelectedResourceMap[
+ `${$store.selectedScreenId}-navigation`
+ ]}
/>
import { redirect } from "@roxi/routify"
+ import { store } from "builderStore"
- $redirect("./screen")
+ $redirect(`./${$store.selectedScreenId}-screen`)
diff --git a/packages/builder/src/pages/builder/app/[application]/design/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/index.svelte
index 79d264d120..e9c72a6e1f 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/index.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/index.svelte
@@ -4,7 +4,7 @@
$: {
if ($frontendStore.screens.length > 0) {
- $redirect(`./${$frontendStore.screens[0]._id}/screen`)
+ $redirect(`./${$frontendStore.screens[0]._id}`)
} else {
$redirect("./new")
}
diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte
index 5207892e42..089ce8e7de 100644
--- a/packages/client/src/components/app/Layout.svelte
+++ b/packages/client/src/components/app/Layout.svelte
@@ -78,7 +78,7 @@
// changes.
$: selected =
$builderStore.inBuilder &&
- $builderStore.selectedComponentId === "navigation"
+ $builderStore.selectedComponentId?.endsWith("-navigation")
$: {
if (selected) {
const node = document.getElementsByClassName("nav-wrapper")?.[0]
@@ -152,7 +152,7 @@
use:styleable={$component.styles}
class:desktop={!mobile}
class:mobile={!!mobile}
- data-id="screen"
+ data-id={`${$builderStore.screen?._id}-screen`}
data-name="Screen"
data-icon="WebPage"
>