The UI is now called foodplanhero with the slogan "Plan. Cook. Smile." (technical id stays lunch). Wordmark, slogan and a portrait with green ring and "by Maike" follow Kai's Figma draft; Poppins and Caveat are bundled locally under the OFL. An admin uploads Maike's photo and a few words under More (households.dedication_*, migration 0021); the photo stays under /app/data. It shows on sign-in, on invitations, under "For Maike" and on iOS start images generated per screen size while the web app loads. The slogan highlights plan, cook and smile where they happen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUc2nv7rJVU2gp3Bgtha3q
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import "server-only";
|
|
import type { PoolClient } from "pg";
|
|
import { withAuth } from "./db";
|
|
|
|
// Widmung (26.11.35): „foodplanhero by Maike“. Name, Foto und Text je Haushalt;
|
|
// das Foto liegt wie die Gerichtsfotos unter /app/data/fotos/<haushalt>/.
|
|
|
|
export type Dedication = { name: string | null; text: string | null; photo: string | null };
|
|
|
|
export async function getDedication(client: PoolClient): Promise<Dedication> {
|
|
const { rows } = await client.query(
|
|
`select dedication_name as name, dedication_text as text, dedication_photo as photo from households limit 1`,
|
|
);
|
|
return rows[0] ?? { name: null, text: null, photo: null };
|
|
}
|
|
|
|
/**
|
|
* Vor der Anmeldung (Anmelden, Startbild) kennt die App keinen Haushalt. Auf einer
|
|
* Box gibt es in aller Regel genau einen; gezeigt wird der älteste.
|
|
*/
|
|
export async function publicDedication(): Promise<(Dedication & { householdId: string }) | null> {
|
|
return withAuth(async (c) => {
|
|
const { rows } = await c.query(
|
|
`select id as "householdId", dedication_name as name, dedication_text as text, dedication_photo as photo
|
|
from households order by created_at limit 1`,
|
|
);
|
|
return rows[0] ?? null;
|
|
});
|
|
}
|
|
|
|
/** Version des Fotos für die Adresse (?v=…), aus der Prüfsumme im Dateinamen. */
|
|
export const photoVersion = (photo: string | null) => photo?.split("-").at(-1)?.replace(".webp", "") ?? "";
|