1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00

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>