Files
lunch/lib/dedication.ts
T
Kai BöhmandClaude Opus 5.5 917536bd75
ci / olares chart · sanity (pull_request) Successful in 3s
ci / app · types + tests + build (pull_request) Successful in 3m3s
markt / eintrag (pull_request) Successful in 28s
ci / oberfläche · Browser am iPhone (pull_request) Successful in 7m32s
Rename to foodplanhero and dedicate the app to Maike (26.11.35)
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
2026-11-07 12:21:37 +00:00

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", "") ?? "";