diff --git a/src/components/icons/book-open.svelte b/src/components/icons/book-open.svelte new file mode 100644 index 000000000..cde592c87 --- /dev/null +++ b/src/components/icons/book-open.svelte @@ -0,0 +1,5 @@ + diff --git a/src/components/icons/code.svelte b/src/components/icons/code.svelte new file mode 100644 index 000000000..1a6dfd24a --- /dev/null +++ b/src/components/icons/code.svelte @@ -0,0 +1,5 @@ + diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts index 095e3d146..b11a6d99f 100644 --- a/src/components/icons/index.ts +++ b/src/components/icons/index.ts @@ -17,6 +17,9 @@ export { default as CopySimple } from "./copy-simple.svelte"; export { default as ArrowSquareOut } from "./arrow-square-out.svelte"; export { default as CaretUpDown } from "./caret-up-down.svelte"; export { default as SquareHalf } from "./square-half.svelte"; +export { default as BookOpen } from "./book-open.svelte"; +export { default as Code } from "./code.svelte"; +export { default as RocketLaunch } from "./rocket-launch.svelte"; export type IconProps = Partial> & { class?: string; diff --git a/src/components/icons/rocket-launch.svelte b/src/components/icons/rocket-launch.svelte new file mode 100644 index 000000000..70a775e4e --- /dev/null +++ b/src/components/icons/rocket-launch.svelte @@ -0,0 +1,5 @@ + diff --git a/src/components/navigation/index.ts b/src/components/navigation/index.ts index e43c3bc65..856122fe0 100644 --- a/src/components/navigation/index.ts +++ b/src/components/navigation/index.ts @@ -1,3 +1,4 @@ export { default as SidebarNav } from "./sidebar-nav.svelte"; export { default as SidebarNavItems } from "./sidebar-nav-items.svelte"; export { default as MobileNav } from "./mobile-nav.svelte"; +export { default as SidebarNavMainItems } from "./sidebar-nav-main-items.svelte"; diff --git a/src/components/navigation/sidebar-accordion.svelte b/src/components/navigation/sidebar-accordion.svelte deleted file mode 100644 index 1d07544d3..000000000 --- a/src/components/navigation/sidebar-accordion.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - Getting Started - - - Hello world - - - diff --git a/src/components/navigation/sidebar-nav-items.svelte b/src/components/navigation/sidebar-nav-items.svelte index f41fd9e1b..71720d3b6 100644 --- a/src/components/navigation/sidebar-nav-items.svelte +++ b/src/components/navigation/sidebar-nav-items.svelte @@ -13,11 +13,9 @@ + import type { SidebarNavItem } from "@/config"; + import { RocketLaunch, BookOpen, Code } from "@/components/icons"; + import { page } from "$app/stores"; + import { cn } from "@/utils"; + + export let items: SidebarNavItem[] = []; + + const iconMap = { + Introduction: BookOpen, + "Getting Started": RocketLaunch, + "Render Delegation": Code + } as const; + + const iconMapKeys = Object.keys(iconMap) as (keyof typeof iconMap)[]; + + function isIconMapKey(key: string): key is keyof typeof iconMap { + return iconMapKeys.includes(key as keyof typeof iconMap); + } + + +{#if items.length} +
+ {#each items as item, index (index)} + {#if item.href} + + {#if isIconMapKey(item.title)} + + {/if} + {item.title} + {#if item.label} + + {item.label} + + {/if} + + {/if} + {/each} +
+{/if} diff --git a/src/components/navigation/sidebar-nav.svelte b/src/components/navigation/sidebar-nav.svelte index 3b24b041b..24f0b0edb 100644 --- a/src/components/navigation/sidebar-nav.svelte +++ b/src/components/navigation/sidebar-nav.svelte @@ -1,25 +1,31 @@ {#if items.length}