Website 1.2.0: starter pages on a new install, and a site icon

A new install had no pages, so the home page and its live preview showed
only the header and footer (found on cross-demo2). The backend now adds the
fixed pages with starter text at startup. Settings -> Site icon sets the
favicon, with a default from the church's colour and initial. The Latest
message's Card layout has its name; the media picker's placeholder has
enough contrast.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 08:18:47 +02:00
co-authored by Claude Opus 5.5
parent 6905a19c8c
commit 79e1450df6
18 changed files with 285 additions and 24 deletions
@@ -8,9 +8,10 @@ import Link from "next/link";
import { useState } from "react";
import { api, canEdit } from "@/admin/api";
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin } from "@/admin/ui";
import { Hourglass, ListOrdered, Search, Settings } from "lucide-react";
import { AppWindow, Hourglass, ListOrdered, Search, Settings } from "lucide-react";
import { ImagePicker } from "@/admin/media";
type Settings = { comingSoonText: string; googleVerification: string | null; bingVerification: string | null };
type Settings = { comingSoonText: string; googleVerification: string | null; bingVerification: string | null; faviconId: string | null };
type PageRow = { id: string; kind: string; title: string; inNav: boolean };
export default function SettingsPage() {
@@ -42,6 +43,18 @@ export default function SettingsPage() {
</div>
<p className="mt-3 text-sm text-gray-600">A Google Business Profile helps people find your church on Google Maps: set one up at business.google.com with the same address as your church details.</p>
</Panel>
<Panel icon={AppWindow} title="Site icon">
<p className="mb-3 text-sm text-gray-600">The little picture in the browser tab and bookmarks. Choose a square picture (512 × 512 pixels is best; a PNG can have a see-through background). Without one, your site uses your church&apos;s icon, or your church&apos;s initial on its colour. This goes live straight away.</p>
<div className="flex flex-wrap items-end gap-6">
<ImagePicker label="Icon" value={s.faviconId} onChange={(faviconId) => setForm({ ...form, faviconId })} />
{/* What the site shows now (the default when none is chosen). */}
<div className="text-sm text-gray-600">
<span className="block font-medium text-gray-800">In use now</span>
<img src={`/site-icon?saved=${encodeURIComponent(settings.data.faviconId ?? "none")}`} alt="" width={32} height={32} className="mt-1 h-8 w-8 rounded" />
</div>
</div>
{fields.faviconId && <p className="mt-2 text-sm text-red-700">{fields.faviconId}</p>}
</Panel>
<Panel icon={Hourglass} title="Coming soon">
<Field label="The line under “Coming soon”" hint="Shown until you first publish your site." error={fields.comingSoonText}>
<input className={inputClass} value={s.comingSoonText} maxLength={300} onChange={(e) => setForm({ ...form, comingSoonText: e.target.value })} />