change topnav back for now
This commit is contained in:
parent
f41110ec74
commit
eb0298420e
|
@ -2,7 +2,7 @@
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
|
|
||||||
import { fade } from "svelte/transition"
|
import { fade } from "svelte/transition"
|
||||||
import { isActive, goto, url, layout } from "@sveltech/routify"
|
import { isActive, goto, context } from "@sveltech/routify"
|
||||||
|
|
||||||
import { SettingsIcon, PreviewIcon } from "components/common/Icons/"
|
import { SettingsIcon, PreviewIcon } from "components/common/Icons/"
|
||||||
import IconButton from "components/common/IconButton.svelte"
|
import IconButton from "components/common/IconButton.svelte"
|
||||||
|
@ -23,6 +23,8 @@
|
||||||
throw new Error(pkg)
|
throw new Error(pkg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$: ({ component } = $context)
|
||||||
|
$: list = component.parent.children.filter(child => child.isIndexable)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="root">
|
<div class="root">
|
||||||
|
@ -35,12 +37,12 @@
|
||||||
alt="budibase icon" />
|
alt="budibase icon" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- List is an array of subfolders in the application folder. -->
|
<!-- This gets all indexable subroutes and sticks them in the top nav. -->
|
||||||
{#each $layout.children as { path, prettyName, children, meta }}
|
{#each list as { path, prettyName, children, meta }}
|
||||||
<span
|
<span
|
||||||
class:active={$isActive(path)}
|
class:active={$isActive(path)}
|
||||||
class="topnavitem"
|
class="topnavitem"
|
||||||
on:click={() => $goto($url(path))}>
|
on:click={() => $goto(path)}>
|
||||||
{prettyName}
|
{prettyName}
|
||||||
</span>
|
</span>
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -50,9 +52,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="toprightnav">
|
<div class="toprightnav">
|
||||||
<span
|
<span
|
||||||
class:active={$isActive(`${component.parent.path}/settings`)}
|
class:active={$isActive(`/settings`)}
|
||||||
class="topnavitemright"
|
class="topnavitemright"
|
||||||
on:click={() => $goto(`${component.parent.path}/settings`)}>
|
on:click={() => $goto(`/settings`)}>
|
||||||
<SettingsIcon />
|
<SettingsIcon />
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
|
|
Loading…
Reference in New Issue