Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
26 changes: 26 additions & 0 deletions src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts">
import AppShell from '$lib/components/app-shell.svelte';
import posthog from 'posthog-js';
import { browser } from '$app/environment';

let { children, data } = $props();

let previousUserId: string | null | undefined;

$effect(() => {
if (!browser) return;
if (data.userId) {
posthog.identify(data.userId);
} else if (previousUserId) {
posthog.reset();
}
previousUserId = data.userId;
});
</script>

{#if data.userId}
<span class="sr-only">Signed in</span>
{/if}
<AppShell userId={data.userId}>
{@render children()}
</AppShell>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
<a href="https://github.com/x0ba/flightlog">GitHub</a>
</nav>

<a href={resolve('/runs')} class="nav-cta">
<a href={resolve('/runs')} rel="external" class="nav-cta">
Dashboard
<ArrowUpRight class="size-3.5" />
</a>
Expand All @@ -112,7 +112,7 @@ jobs:
requests on regression suites — surfaced directly as GitHub Check Runs.
</p>
<div class="cta-row">
<a href={resolve('/runs')} class="btn-primary">
<a href={resolve('/runs')} rel="external" class="btn-primary">
Open dashboard
<ArrowUpRight class="size-4" />
</a>
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
<div>
<a href="https://github.com/x0ba/flightlog">GitHub</a>
<a href="https://github.com/x0ba/flightlog/blob/main/README.md">Docs</a>
<a href={resolve('/runs')}>Dashboard</a>
<a href={resolve('/runs')} rel="external">Dashboard</a>
</div>
</footer>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/routes/(marketing)/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
35 changes: 2 additions & 33 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
<script lang="ts">
import './layout.css';
import favicon from '$lib/assets/favicon.svg';
import AppShell from '$lib/components/app-shell.svelte';
import { page } from '$app/state';
import posthog from 'posthog-js';
import { browser } from '$app/environment';

let { children, data } = $props();

let useShell = $derived(
page.url.pathname !== '/' &&
!page.url.pathname.startsWith('/sign-in') &&
!page.url.pathname.startsWith('/sign-up')
);

let previousUserId: string | null | undefined;

$effect(() => {
if (!browser) return;
if (data.userId) {
posthog.identify(data.userId);
} else if (previousUserId) {
posthog.reset();
}
previousUserId = data.userId;
});
let { children } = $props();
</script>

<svelte:head><link rel="icon" href={favicon} /></svelte:head>
{#if data.userId}
<span class="sr-only">Signed in</span>
{/if}
{#if useShell}
<AppShell userId={data.userId}>
{@render children()}
</AppShell>
{:else}
{@render children()}
{/if}
{@render children()}
Loading