diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 10:45:26 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 10:45:26 +0200 |
| commit | 38a07e3dfbda798010cc7f219abec911f747eaf7 (patch) | |
| tree | e29b069da1ae242fb8b529c6585167888513b107 /apps/kit/src/routes/(main)/+layout.svelte | |
| parent | 91ecf0296bfcae7b2233a199bd2e5ae13e89927d (diff) | |
| download | greatoffice-38a07e3dfbda798010cc7f219abec911f747eaf7.tar.xz greatoffice-38a07e3dfbda798010cc7f219abec911f747eaf7.zip | |
feat: Fully functioning i18n
Diffstat (limited to 'apps/kit/src/routes/(main)/+layout.svelte')
| -rw-r--r-- | apps/kit/src/routes/(main)/+layout.svelte | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/apps/kit/src/routes/(main)/+layout.svelte b/apps/kit/src/routes/(main)/+layout.svelte index 5354f02..236cd75 100644 --- a/apps/kit/src/routes/(main)/+layout.svelte +++ b/apps/kit/src/routes/(main)/+layout.svelte @@ -1,32 +1,23 @@ <script lang="ts"> import "../../app.pcss"; import { setLocale } from "$lib/i18n/i18n-svelte"; + import LocaleSwitcher from "$lib/components/locale-switcher.svelte"; + import { ExclamationTriangleIcon } from "$lib/components/icons"; import type { LayoutData } from "./$types"; let online = true; export let data: LayoutData; - + // at the very top, set the locale before you access the store and before the actual rendering takes place setLocale(data.locale); </script> <svelte:window bind:online /> + {#if !online} - <div class="bg-yellow-50 relative z-50 border-yellow-400 p-4"> + <div class="bg-yellow-50 relative z-50 p-4"> <div class="flex"> <div class="flex-shrink-0"> - <svg - class="h-5 w-5 text-yellow-400" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 20 20" - fill="currentColor" - aria-hidden="true" - > - <path - fill-rule="evenodd" - d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" - clip-rule="evenodd" - /> - </svg> + <ExclamationTriangleIcon class="bg-yellow-400" /> </div> <div class="ml-3"> <p class="text-sm text-yellow-700">You seem to be offline, please check your internet connection.</p> @@ -34,4 +25,6 @@ </div> </div> {/if} + +<LocaleSwitcher /> <slot /> |
