update backendNav to use routify

This commit is contained in:
kevmodrome 2020-04-02 18:23:05 +02:00
parent 1e0e98ff49
commit 9360226525
2 changed files with 11 additions and 3 deletions

View File

@ -41,7 +41,10 @@
</div>
{/if}
<NavItem name="ACCESS_LEVELS" label="User Access Levels" />
<NavItem
name="ACCESS_LEVELS"
label="User Access Levels"
href="./accesslevels" />
</div>
<style>

View File

@ -1,9 +1,13 @@
<script>
import { isActive, url, goto } from "@sveltech/routify"
import getIcon from "../common/icon"
import { backendUiStore } from "builderStore"
export let name = ""
export let label = ""
export let href
$: console.log("Active: ", $isActive(href))
$: navActive = $backendUiStore.leftNavItem === name
@ -11,14 +15,15 @@
</script>
<div
on:click={() => $goto($url(href))}
class="budibase__nav-item backend-nav-item"
class:selected={navActive}
on:click={setActive}>
class:selected={$isActive(href)}>
{label}
</div>
<style>
.backend-nav-item {
padding-left: 25px;
cursor: pointer;
}
</style>