aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/+layout.svelte
blob: 2b96527c63ae1a2556769222cf79d58a4e99695a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script lang="ts">
    import "../../app.pcss";
    import {setLocale} from "$i18n/i18n-svelte";
    import {ExclamationTriangleIcon} from "$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}

<slot/>