@@ -7,11 +7,14 @@
|
||||
import { currentUser } from "$lib/stores/user_store";
|
||||
import { isRouteProtected } from "$lib/util/authorization_util";
|
||||
import "@fortawesome/fontawesome-free/css/all.min.css";
|
||||
import { fade, slide } from "svelte/transition";
|
||||
import { slide } from "svelte/transition";
|
||||
import "../css/app.css";
|
||||
import "../css/components.css";
|
||||
import "../css/theme.css";
|
||||
import { page } from "$app/stores";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
|
||||
beforeNavigate((n) => {
|
||||
if (!$currentUser && isRouteProtected(n.to?.url?.pathname ?? "")) {
|
||||
n.cancel();
|
||||
@@ -20,6 +23,7 @@
|
||||
});
|
||||
|
||||
let hideDemoHint = false;
|
||||
let hideWarning = false;
|
||||
</script>
|
||||
|
||||
{#if env.PUBLIC_IS_DEMO === "true" && !hideDemoHint}
|
||||
@@ -38,6 +42,19 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if $page.data.warnings?.length && !hideWarning}
|
||||
<div
|
||||
class="flex items-center justify-between bg-red-200 text-center p-4 text-sm"
|
||||
out:slide
|
||||
>
|
||||
<div></div>
|
||||
<span>{@html $page.data.warnings[0]} </span>
|
||||
<button class="btn-icon self-end" on:click={() => (hideWarning = true)}
|
||||
><i class="fa fa-close"></i></button
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<NavBar></NavBar>
|
||||
<Toast></Toast>
|
||||
<slot />
|
||||
|
||||
Reference in New Issue
Block a user