2024-08-12 11:00:25 +02:00
|
|
|
<script lang="ts">
|
2025-03-20 19:57:41 +01:00
|
|
|
import { page } from '$app/state';
|
2024-09-09 10:29:41 +02:00
|
|
|
import appConfigStore from '$lib/stores/application-configuration-store';
|
2024-08-12 11:00:25 +02:00
|
|
|
import userStore from '$lib/stores/user-store';
|
|
|
|
|
import Logo from '../logo.svelte';
|
|
|
|
|
import HeaderAvatar from './header-avatar.svelte';
|
|
|
|
|
|
2025-02-19 14:28:45 +01:00
|
|
|
const authUrls = [/^\/authorize$/, /^\/login(?:\/.*)?$/, /^\/logout$/];
|
|
|
|
|
|
|
|
|
|
let isAuthPage = $derived(
|
2025-03-20 19:57:41 +01:00
|
|
|
!page.error && authUrls.some((pattern) => pattern.test(page.url.pathname))
|
2025-02-19 14:28:45 +01:00
|
|
|
);
|
2024-08-12 11:00:25 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class=" w-full {isAuthPage ? 'absolute top-0 z-10 mt-4' : 'border-b'}">
|
2024-10-02 10:02:28 +02:00
|
|
|
<div
|
|
|
|
|
class="{!isAuthPage
|
|
|
|
|
? 'max-w-[1640px]'
|
|
|
|
|
: ''} mx-auto flex w-full items-center justify-between px-4 md:px-10"
|
|
|
|
|
>
|
2024-08-12 11:00:25 +02:00
|
|
|
<div class="flex h-16 items-center">
|
|
|
|
|
{#if !isAuthPage}
|
2025-01-03 16:15:10 +01:00
|
|
|
<Logo class="mr-3 h-8 w-8" />
|
2024-08-12 11:00:25 +02:00
|
|
|
<h1 class="text-lg font-medium" data-testid="application-name">
|
2024-09-09 10:29:41 +02:00
|
|
|
{$appConfigStore.appName}
|
2024-08-12 11:00:25 +02:00
|
|
|
</h1>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2025-03-20 19:57:41 +01:00
|
|
|
<div class="flex items-center justify-between gap-4">
|
|
|
|
|
{#if $userStore?.id}
|
|
|
|
|
<HeaderAvatar />
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2024-08-12 11:00:25 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|