From 745cd24562f52d0c7826d8a991aab0659c269a20 Mon Sep 17 00:00:00 2001 From: agent Date: Mon, 26 Oct 2026 13:17:44 +0000 Subject: [PATCH] Admin: the Site design logo is the favicon too Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW --- app-admin/src/routes/+layout.server.ts | 7 ++++++- app-admin/src/routes/+layout.svelte | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app-admin/src/routes/+layout.server.ts b/app-admin/src/routes/+layout.server.ts index 697edf0..bdfa149 100644 --- a/app-admin/src/routes/+layout.server.ts +++ b/app-admin/src/routes/+layout.server.ts @@ -13,10 +13,15 @@ async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) { } export const load: LayoutServerLoad = async ({ locals }) => { - const colors = await getGlobal(locals.pb, 'colors', defaultColors); + const [colors, header] = await Promise.all([ + getGlobal(locals.pb, 'colors', defaultColors), + getGlobal(locals.pb, 'header', {}) as Promise<{ logo?: { url?: string } }> + ]); return { user: locals.user, colors, + // The site's logo is the admin's tab icon too (same as the public site). + logoUrl: header?.logo?.url || '', // Admin dates/times are entered and shown in the site's timezone, and // prices in the shop currency — same settings the booking emails use. timezone: env.SITE_TIMEZONE || 'Europe/Oslo', diff --git a/app-admin/src/routes/+layout.svelte b/app-admin/src/routes/+layout.svelte index 8e68676..35dc3e9 100644 --- a/app-admin/src/routes/+layout.svelte +++ b/app-admin/src/routes/+layout.svelte @@ -13,8 +13,10 @@ import { page } from '$app/state'; import { createBasketStore, setBasketContext } from '$lib/basket.svelte'; import { brandThemeVars, rootStyleTag } from '$shared/theme'; + import { thumbUrl } from '$shared/pb'; let { children, data } = $props(); + let icon = $derived(data.logoUrl ? thumbUrl(data.logoUrl) : favicon); // Routes rendered without the admin shell: the login screen, and the // preview iframe (which must look like the public site, not the admin). @@ -67,7 +69,7 @@ - + {@html rootStyleTag(brandThemeVars(data.colors))}