prettier config + format all, closes #175

This commit is contained in:
vcoppe
2025-02-02 11:17:22 +01:00
parent 01cfd448f0
commit 0b457f9a1e
157 changed files with 17194 additions and 29365 deletions
@@ -1,44 +1,46 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { locale } from 'svelte-i18n';
import { page } from '$app/stores';
import { guides } from '$lib/components/docs/docs';
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { locale } from 'svelte-i18n';
import { page } from '$app/stores';
import { guides } from '$lib/components/docs/docs';
export let data: {
guideTitles: Record<string, string>;
};
export let data: {
guideTitles: Record<string, string>;
};
</script>
<div class="grow px-12 pt-6 pb-12 flex flex-row gap-24">
<div class="hidden md:flex flex-col gap-2 w-40 sticky mt-[27px] top-[108px] self-start shrink-0">
{#each Object.keys(guides) as guide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}`)}
class="min-h-5 h-fit p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start whitespace-normal {$page
.params.guide === guide
? 'font-semibold text-foreground'
: ''}"
>
{data.guideTitles[guide]}
</Button>
{#each guides[guide] as subGuide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
class="min-h-5 h-fit p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start whitespace-normal ml-3 {$page
.params.guide ===
guide + '/' + subGuide
? 'font-semibold text-foreground'
: ''}"
>
{data.guideTitles[`${guide}/${subGuide}`]}
</Button>
{/each}
{/each}
</div>
<div class="grow">
<slot />
</div>
<div
class="hidden md:flex flex-col gap-2 w-40 sticky mt-[27px] top-[108px] self-start shrink-0"
>
{#each Object.keys(guides) as guide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}`)}
class="min-h-5 h-fit p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start whitespace-normal {$page
.params.guide === guide
? 'font-semibold text-foreground'
: ''}"
>
{data.guideTitles[guide]}
</Button>
{#each guides[guide] as subGuide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
class="min-h-5 h-fit p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start whitespace-normal ml-3 {$page
.params.guide ===
guide + '/' + subGuide
? 'font-semibold text-foreground'
: ''}"
>
{data.guideTitles[`${guide}/${subGuide}`]}
</Button>
{/each}
{/each}
</div>
<div class="grow">
<slot />
</div>
</div>
@@ -1,41 +1,45 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { locale } from 'svelte-i18n';
import { guides, guideIcons } from '$lib/components/docs/docs';
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { locale } from 'svelte-i18n';
import { guides, guideIcons } from '$lib/components/docs/docs';
export let data: {
guideTitles: Record<string, string>;
};
export let data: {
guideTitles: Record<string, string>;
};
</script>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
{#each Object.keys(guides) as guide}
<Button
variant="outline"
href={getURLForLanguage($locale, `/help/${guide}`)}
class="min-h-36 h-full pt-6 pb-3 px-0"
>
<div class="flex flex-col w-full">
<div class="h-12 text-center text-5xl">
{guideIcons[guide]}
</div>
<div class="min-h-8 text-2xl text-center my-3 w-full whitespace-normal px-6">
{data.guideTitles[guide]}
</div>
<div class="flex flex-row justify-center flex-wrap gap-x-6 px-6">
{#each guides[guide] as subGuide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
class="min-h-8 h-fit min-w-24 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" />
{data.guideTitles[`${guide}/${subGuide}`]}
</Button>
{/each}
</div>
</div>
</Button>
{/each}
{#each Object.keys(guides) as guide}
<Button
variant="outline"
href={getURLForLanguage($locale, `/help/${guide}`)}
class="min-h-36 h-full pt-6 pb-3 px-0"
>
<div class="flex flex-col w-full">
<div class="h-12 text-center text-5xl">
{guideIcons[guide]}
</div>
<div class="min-h-8 text-2xl text-center my-3 w-full whitespace-normal px-6">
{data.guideTitles[guide]}
</div>
<div class="flex flex-row justify-center flex-wrap gap-x-6 px-6">
{#each guides[guide] as subGuide}
<Button
variant="link"
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
class="min-h-8 h-fit min-w-24 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"
/>
{data.guideTitles[`${guide}/${subGuide}`]}
</Button>
{/each}
</div>
</div>
</Button>
{/each}
</div>
@@ -1,81 +1,81 @@
<script lang="ts">
import { page } from '$app/stores';
import { getNextGuide, getPreviousGuide } from '$lib/components/docs/docs';
import DocsContainer from '$lib/components/docs/DocsContainer.svelte';
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { ChevronLeft, ChevronRight, PenLine, CornerDownRight } from 'lucide-svelte';
import { _, locale } from 'svelte-i18n';
import { page } from '$app/stores';
import { getNextGuide, getPreviousGuide } from '$lib/components/docs/docs';
import DocsContainer from '$lib/components/docs/DocsContainer.svelte';
import { Button } from '$lib/components/ui/button';
import { getURLForLanguage } from '$lib/utils';
import { ChevronLeft, ChevronRight, PenLine, CornerDownRight } from 'lucide-svelte';
import { _, locale } from 'svelte-i18n';
export let data: {
guideModule: any;
guideTitles: Record<string, string>;
};
export let data: {
guideModule: any;
guideTitles: Record<string, string>;
};
$: previousGuide = getPreviousGuide($page.params.guide);
$: nextGuide = getNextGuide($page.params.guide);
$: previousGuide = getPreviousGuide($page.params.guide);
$: nextGuide = getNextGuide($page.params.guide);
</script>
<div class="markdown flex flex-col gap-3">
<DocsContainer module={data.guideModule.default} />
<DocsContainer module={data.guideModule.default} />
</div>
<div class="flex flex-row flex-wrap gap-3 pt-6">
{#if previousGuide}
<Button
variant="outline"
class="mr-auto"
href={getURLForLanguage($locale, `/help/${previousGuide}`)}
>
<ChevronLeft size="14" class="mr-1 mt-0.5" />
{data.guideTitles[previousGuide]}
</Button>
{/if}
{#if nextGuide}
<Button
variant="outline"
class="ml-auto"
href={getURLForLanguage($locale, `/help/${nextGuide}`)}
>
{data.guideTitles[nextGuide]}
<ChevronRight size="14" class="ml-1 mt-0.5" />
</Button>
{/if}
{#if previousGuide}
<Button
variant="outline"
class="mr-auto"
href={getURLForLanguage($locale, `/help/${previousGuide}`)}
>
<ChevronLeft size="14" class="mr-1 mt-0.5" />
{data.guideTitles[previousGuide]}
</Button>
{/if}
{#if nextGuide}
<Button
variant="outline"
class="ml-auto"
href={getURLForLanguage($locale, `/help/${nextGuide}`)}
>
{data.guideTitles[nextGuide]}
<ChevronRight size="14" class="ml-1 mt-0.5" />
</Button>
{/if}
</div>
<div class="flex flex-row flex-wrap justify-between items-start mt-10 gap-3">
<div class="flex flex-col items-start">
<p class="text-sm text-muted-foreground">{$_('docs.answer_not_found')}</p>
<Button
variant="link"
href="https://www.reddit.com/r/gpxstudio/"
target="_blank"
class="p-0 h-6 text-link"
>
<CornerDownRight size="16" class="mr-1" />
{$_('docs.ask_on_reddit')}
</Button>
</div>
{#if $locale === 'en'}
<Button
variant="link"
href="https://github.com/gpxstudio/gpx.studio/edit/dev/website/src/lib/docs/en/{$page.params
.guide}.mdx"
target="_blank"
class="p-0 h-6 ml-auto text-link"
>
<PenLine size="16" class="mr-1" />
Edit this page on GitHub
</Button>
{:else}
<Button
variant="link"
href="https://crowdin.com/project/gpxstudio/{$locale}"
target="_blank"
class="p-0 h-6 ml-auto text-link"
>
<PenLine size="16" class="mr-1" />
{$_('docs.translate')}
</Button>
{/if}
<div class="flex flex-col items-start">
<p class="text-sm text-muted-foreground">{$_('docs.answer_not_found')}</p>
<Button
variant="link"
href="https://www.reddit.com/r/gpxstudio/"
target="_blank"
class="p-0 h-6 text-link"
>
<CornerDownRight size="16" class="mr-1" />
{$_('docs.ask_on_reddit')}
</Button>
</div>
{#if $locale === 'en'}
<Button
variant="link"
href="https://github.com/gpxstudio/gpx.studio/edit/dev/website/src/lib/docs/en/{$page
.params.guide}.mdx"
target="_blank"
class="p-0 h-6 ml-auto text-link"
>
<PenLine size="16" class="mr-1" />
Edit this page on GitHub
</Button>
{:else}
<Button
variant="link"
href="https://crowdin.com/project/gpxstudio/{$locale}"
target="_blank"
class="p-0 h-6 ml-auto text-link"
>
<PenLine size="16" class="mr-1" />
{$_('docs.translate')}
</Button>
{/if}
</div>
@@ -17,4 +17,4 @@ export async function load({ params }) {
return {
guideModule,
};
}
}