cleanup
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import NavbarMenu from "./NavbarMenu.svelte";
|
||||
import { getContext } from "svelte";
|
||||
|
||||
export let schema;
|
||||
@@ -9,13 +8,14 @@
|
||||
|
||||
<div class="sidebar-top">
|
||||
<a class="logo" href={channel.lucentUrl}>{channel.name}</a>
|
||||
<a class="nav-item" href="{channel.lucentUrl}/profile"> </a>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<NavbarMenu
|
||||
title="Content"
|
||||
schemas={readableSchemas.filter((sc) => sc.isEntry)}
|
||||
{schema}
|
||||
expanded={true}
|
||||
/>
|
||||
{#each readableSchemas as aschema}
|
||||
<a
|
||||
class="sidebar-item"
|
||||
class:active={aschema.name === schema?.name}
|
||||
aria-current="page"
|
||||
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a
|
||||
>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<script>
|
||||
import {getContext} from "svelte";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
export let schemas;
|
||||
export let title;
|
||||
export let schema;
|
||||
export let expanded = false;
|
||||
|
||||
if(schemas.find(s => s.name === schema?.name)){
|
||||
expanded = true;
|
||||
}
|
||||
|
||||
function toggleExpand(){
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="sidebar-header" tabindex="0" on:click={toggleExpand}>
|
||||
{title}
|
||||
{#if expanded}
|
||||
<Icon icon="circle-chevron-up"></Icon>
|
||||
{:else}
|
||||
<Icon icon="circle-chevron-down"></Icon>
|
||||
{/if}
|
||||
</button>
|
||||
{#if expanded}
|
||||
{#each schemas as aschema}
|
||||
<a class="sidebar-item" class:active={aschema.name === schema?.name}
|
||||
aria-current="page"
|
||||
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a>
|
||||
{/each}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user