add tool icons in docs welcome page

This commit is contained in:
vcoppe
2024-07-11 10:10:36 +02:00
parent 83eb7cb7d2
commit ca5b7e42ec
2 changed files with 17 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
import { File, FilePen, View, type Icon, Settings, Pencil, MapPin, Scissors, CalendarClock, Group, Ungroup, Filter, SquareDashedMousePointer } from "lucide-svelte";
import type { ComponentType } from "svelte";
export const guides: Record<string, string[]> = { export const guides: Record<string, string[]> = {
'getting-started': [], 'getting-started': [],
menu: ['file', 'edit', 'view', 'settings'], menu: ['file', 'edit', 'view', 'settings'],
@@ -7,11 +10,23 @@ export const guides: Record<string, string[]> = {
'gpx': [], 'gpx': [],
}; };
export const guideIcons: Record<string, string> = { export const guideIcons: Record<string, string | ComponentType<Icon>> = {
"getting-started": "🚀", "getting-started": "🚀",
"menu": "📂 ⚙️", "menu": "📂 ⚙️",
"file": File,
"edit": FilePen,
"view": View,
"settings": Settings,
"files-and-stats": "🗂 📈", "files-and-stats": "🗂 📈",
"toolbar": "🧰", "toolbar": "🧰",
"routing": Pencil,
"poi": MapPin,
"scissors": Scissors,
"time": CalendarClock,
"merge": Group,
"extract": Ungroup,
"minify": Filter,
"clean": SquareDashedMousePointer,
"map-controls": "🗺", "map-controls": "🗺",
"gpx": "💾", "gpx": "💾",
}; };

View File

@@ -27,6 +27,7 @@
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)} href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
class="h-fit px-0 py-1 text-muted-foreground text-base text-center whitespace-normal" class="h-fit px-0 py-1 text-muted-foreground text-base text-center whitespace-normal"
> >
<svelte:component this={guideIcons[subGuide]} size="16" class="mr-1 shrink-0" />
<DocsLoader path={`${guide}/${subGuide}.mdx`} titleOnly={true} /> <DocsLoader path={`${guide}/${subGuide}.mdx`} titleOnly={true} />
</Button> </Button>
{/each} {/each}