diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-05 14:45:21 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-05 14:45:21 +0200 |
| commit | b7e39b59fd0fc7b5610ebff29035bf622079e0d8 (patch) | |
| tree | 64be84ebbdac9f7ceced983390c53b10d575af5c /code/app/src/routes/(main)/+layout.svelte | |
| parent | 2001c035fbb417ab0a3d42cfb04d17420bde4086 (diff) | |
| download | greatoffice-b7e39b59fd0fc7b5610ebff29035bf622079e0d8.tar.xz greatoffice-b7e39b59fd0fc7b5610ebff29035bf622079e0d8.zip | |
refactor: Change file structure
Diffstat (limited to 'code/app/src/routes/(main)/+layout.svelte')
| -rw-r--r-- | code/app/src/routes/(main)/+layout.svelte | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/code/app/src/routes/(main)/+layout.svelte b/code/app/src/routes/(main)/+layout.svelte new file mode 100644 index 0000000..1a870bb --- /dev/null +++ b/code/app/src/routes/(main)/+layout.svelte @@ -0,0 +1,29 @@ +<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; + setLocale(data.locale); +</script> + +<svelte:window bind:online /> + +{#if !online} + <div class="bg-yellow-50 relative z-50 p-4"> + <div class="flex"> + <div class="flex-shrink-0"> + <ExclamationTriangleIcon class="bg-yellow-50 text-yellow-500" /> + </div> + <div class="ml-3"> + <p class="text-sm text-yellow-700">You seem to be offline, please check your internet connection.</p> + </div> + </div> + </div> +{/if} + +<LocaleSwitcher /> +<slot /> |
