Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Mar 14, 2022
1 parent f000be1 commit 15a3e30
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
8 changes: 3 additions & 5 deletions src/docs/src/components/ComponentFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
let arrayOfPagesInOrder = []
pages.map((items) => {
if (items.name != "excluded") {
items.items.forEach((item) => {
arrayOfPagesInOrder.push(item)
})
}
items.items.forEach((item) => {
arrayOfPagesInOrder.push(item)
})
})
$: currentPageIndex = arrayOfPagesInOrder.findIndex((item) => item.href == $page.url.pathname.replace(/\/$/, ""))
</script>
Expand Down
32 changes: 17 additions & 15 deletions src/docs/src/components/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,24 @@
<li class="menu-title"><span>{$t(name)}</span></li>
{/if}
{#if name != "excluded"}
{#each items as { name, href, icon, badge }}
<li>
<a {href} on:click={closeDrawer} id={$page.url.pathname.startsWith(href + "/") ? "active-menu" : ""} class={`flex gap-4 ${$page.url.pathname == href ? "active" : ""} ${$page.url.pathname.startsWith(href + "/") ? "active" : ""}`}>
{#if icon != ""}
<span class="flex-none">
{@html icon}
{#each items as { name, href, icon, badge, hidden, highlightAnotherItem }}
{#if !hidden}
<li>
<a {href} on:click={closeDrawer} id={$page.url.pathname.startsWith(href + "/") ? "active-menu" : ""} class={`flex gap-4 ${$page.url.pathname == href ? "active" : ""} ${$page.url.pathname == highlightAnotherItem + "/" ? "active" : ""} ${$page.url.pathname.startsWith(href + "/") ? "active" : ""}`}>
{#if icon != ""}
<span class="flex-none">
{@html icon}
</span>
{/if}
<span class="flex-1">
{@html $t(name)}
</span>
{/if}
<span class="flex-1">
{@html $t(name)}
</span>
{#if badge != ""}
<span class="badge badge-sm flex-none lowercase">{$t(badge)}</span>
{/if}
</a>
</li>
{#if badge != ""}
<span class="badge badge-sm flex-none lowercase">{$t(badge)}</span>
{/if}
</a>
</li>
{/if}
{/each}
{/if}
</ul>
Expand Down
11 changes: 10 additions & 1 deletion src/docs/src/lib/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,19 @@ export let pages = [
items: [
{
name: "Install",
tags: "how setup install npm cdn",
tags: "how setup install npm",
href: "/docs/install",
icon: '<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-6 h-6 stroke-current"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 4H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-2m-4-1v8m0 0l3-3m-3 3L9 8m-5 5h2.586a1 1 0 01.707.293l2.414 2.414a1 1 0 00.707.293h3.172a1 1 0 00.707-.293l2.414-2.414a1 1 0 01.707-.293H20" /></svg>',
badge: "",
highlightAnotherItem: "/docs/cdn",
},
{
name: "CDN",
tags: "how cdn",
href: "/docs/cdn",
icon: "",
badge: "",
hidden: true,
},
{
name: "Use",
Expand Down

0 comments on commit 15a3e30

Please sign in to comment.