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:
@@ -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's icon, or your church'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 })} />
|
||||
|
||||
@@ -26,7 +26,7 @@ const SECTIONS: Record<string, string> = { hero: "Top of the page", serviceTimes
|
||||
const VARIANT_NAMES: Record<string, string> = {
|
||||
photo: "Photo", video: "Video", collage: "Collage", split: "Split", text: "Text only", panel: "Panel", strip: "Inline strip", map: "With map",
|
||||
"image-text": "Image and text", pastor: "With pastor", cards: "Cards", list: "List", bands: "Alternating bands", faces: "Faces", featured: "Featured",
|
||||
calendar: "Calendar strip", compact: "Compact", banner: "Banner", centred: "Centred", image: "Image background",
|
||||
calendar: "Calendar strip", card: "Card", compact: "Compact", banner: "Banner", centred: "Centred", image: "Image background",
|
||||
};
|
||||
const ALL_VARIANTS: Record<string, string[]> = {
|
||||
hero: ["photo", "video", "collage", "split", "text"], serviceTimes: ["panel", "strip", "map"], welcome: ["text", "image-text", "pastor"], ministries: ["cards", "list", "bands"],
|
||||
|
||||
Reference in New Issue
Block a user