add link to docs in help boxes

This commit is contained in:
vcoppe
2024-08-07 16:54:48 +02:00
parent d7c756e471
commit 8dee6db813
10 changed files with 28 additions and 13 deletions

View File

@@ -1,8 +1,22 @@
<script>
<script lang="ts">
import { CircleHelp } from 'lucide-svelte';
import { _ } from 'svelte-i18n';
export let link: string | undefined = undefined;
</script>
<div class="{$$props.class || ''} text-sm bg-muted rounded border flex flex-row items-center p-2">
<div class="text-sm bg-muted rounded border flex flex-row items-center p-2 {$$props.class || ''}">
<CircleHelp size="16" class="w-4 mr-2 shrink-0 grow-0" />
<slot />
<div>
<slot />
{#if link}
<a
href={link}
target="_blank"
class="text-sm text-blue-500 dark:text-blue-300 hover:underline"
>
{$_('menu.more')}
</a>
{/if}
</div>
</div>

View File

@@ -178,7 +178,7 @@
<Trash2 size="16" class="mr-1" />
{$_('toolbar.clean.button')}
</Button>
<Help>
<Help link="./help/toolbar/clean">
{#if validSelection}
{$_('toolbar.clean.help')}
{:else}

View File

@@ -42,7 +42,7 @@
<Ungroup size="16" class="mr-1" />
{$_('toolbar.extract.button')}
</Button>
<Help>
<Help link="./help/toolbar/extract">
{#if validSelection}
{$_('toolbar.extract.help')}
{:else}

View File

@@ -74,7 +74,7 @@
<Group size="16" class="mr-1" />
{$_('toolbar.merge.merge_selection')}
</Button>
<Help>
<Help link="./help/toolbar/merge">
{#if mergeType === MergeType.TRACES && canMergeTraces}
{$_('toolbar.merge.help_merge_traces')}
{:else if mergeType === MergeType.TRACES && !canMergeTraces}

View File

@@ -164,7 +164,7 @@
{$_('toolbar.reduce.button')}
</Button>
<Help>
<Help link="./help/toolbar/minify">
{#if validSelection}
{$_('toolbar.reduce.help')}
{:else}

View File

@@ -332,7 +332,7 @@
<CircleX size="16" />
</Button>
</div>
<Help>
<Help link="./help/toolbar/time">
{#if canUpdate}
{$_('toolbar.time.help')}
{:else}

View File

@@ -204,7 +204,7 @@
<CircleX size="16" />
</Button>
</div>
<Help>
<Help link="./help/toolbar/poi">
{#if $selectedWaypoint || canCreate}
{$_('toolbar.waypoint.help')}
{:else}

View File

@@ -236,11 +236,11 @@
</Tooltip>
</div>
<div class="w-full flex flex-row gap-2 items-end justify-between">
<Help>
<Help link="./help/toolbar/routing">
{#if !validSelection}
<div>{$_('toolbar.routing.help_no_file')}</div>
{$_('toolbar.routing.help_no_file')}
{:else}
<div>{$_('toolbar.routing.help')}</div>
{$_('toolbar.routing.help')}
{/if}
</Help>
<Button

View File

@@ -135,7 +135,7 @@
</Select.Content>
</Select.Root>
</Label>
<Help>
<Help link="./help/toolbar/scissors">
{#if validSelection}
{$_('toolbar.scissors.help')}
{:else}

View File

@@ -55,6 +55,7 @@
"distance_markers": "Distance markers",
"direction_markers": "Direction arrows",
"help": "Help",
"more": "More...",
"donate": "Donate",
"ctrl": "Ctrl",
"click": "Click",