events 3.9.0, website 1.9.0, accounts 1.10.0: the church's details from Accounts everywhere
- Events: the Accounts profile's name, logo, icon, colours and contact details win over Events' own settings while Accounts is connected (pages, emails, WhatsApp, PDFs); Settings shows them read-only with a link to Accounts. The Accounts logo is copied for PDFs (PNG and JPEG). Fixes Events keeping its old church after a demo scenario load. - Website: a background per homepage section in the church's colours; "More info" instead of "Register" for events without registration; the shared colour field. - Accounts: the shared colour field in Church profile. - @crosscode/ui 0.4.0: ColourField and isHexColour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@crosscode/website-frontend",
|
||||
"version": "1.8.0",
|
||||
"version": "1.9.0",
|
||||
"private": true,
|
||||
"description": "Church Website: the church's public site in its template, and the admin",
|
||||
"scripts": {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
import { useState } from "react";
|
||||
import type { Church } from "@crosscode/contracts";
|
||||
import { ColourField } from "@crosscode/ui";
|
||||
import { api, canEdit } from "@/admin/api";
|
||||
import { ImagePicker } from "@/admin/media";
|
||||
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin } from "@/admin/ui";
|
||||
@@ -55,8 +56,10 @@ export default function ChurchDetails() {
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="Church name" error={err("name")}><input className={inputClass} value={c.name} maxLength={200} onChange={(e) => set({ name: e.target.value })} /></Field>
|
||||
<Field label="Short name" hint="For tight spaces." error={err("shortName")}><input className={inputClass} value={c.shortName ?? ""} maxLength={30} onChange={(e) => set({ shortName: e.target.value || null })} /></Field>
|
||||
<Field label="Main colour" error={err("branding.colours.primary")}><input type="color" className="h-10 w-20" value={c.branding.colours.primary} onChange={(e) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, primary: e.target.value } } })} /></Field>
|
||||
<Field label="Accent colour"><input type="color" className="h-10 w-20" value={c.branding.colours.accent ?? "#999999"} onChange={(e) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, accent: e.target.value } } })} /></Field>
|
||||
<ColourField label="Main colour" hint="Buttons, links and headings on every site." error={err("branding.colours.primary")} disabled={!editor}
|
||||
value={c.branding.colours.primary} onChange={(primary) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, primary } } })} />
|
||||
<ColourField label="Accent colour" hint="Highlights and touches beside the main colour." error={err("branding.colours.accent")} disabled={!editor}
|
||||
value={c.branding.colours.accent ?? "#999999"} onChange={(accent) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, accent } } })} />
|
||||
<Field label="Fonts" hint="Shared by all your sites. Your template suggests some.">
|
||||
<select className={inputClass} value={c.branding.style?.fontPairing ?? ""} onChange={(e) => set({ branding: { ...c.branding, style: { fontPairing: (e.target.value || null) as never, corners: c.branding.style?.corners ?? null } } })}>
|
||||
{PAIRINGS.map(([v, l]) => <option key={v} value={v}>{l}</option>)}
|
||||
|
||||
@@ -12,7 +12,18 @@ import { api } from "@/admin/api";
|
||||
import { WithPreview } from "@/admin/LivePreview";
|
||||
import { Btn, cx, Field, inputClass, Loading, Notice, Panel, Tabs, Title, useAction, useAdmin } from "@/admin/ui";
|
||||
|
||||
type Design = { template: string; variants: Record<string, string>; home: { section: string; hidden: boolean }[]; style: Record<string, string> };
|
||||
type HomeEntry = { section: string; hidden: boolean; background?: string };
|
||||
type Design = { template: string; variants: Record<string, string>; home: HomeEntry[]; style: Record<string, string> };
|
||||
|
||||
/** A section's own background (backend variants.ts SECTION_BACKGROUNDS), each from the church's colours; "" follows Style → Section colour. */
|
||||
const BACKGROUNDS: { id: string; name: string; swatch: string }[] = [
|
||||
{ id: "", name: "As the style sets it", swatch: "repeating-linear-gradient(45deg, #fff 0 4px, rgb(var(--brand-tint)) 4px 8px)" },
|
||||
{ id: "light", name: "White", swatch: "#fff" },
|
||||
{ id: "tint", name: "Soft main colour", swatch: "rgb(var(--brand-tint))" },
|
||||
{ id: "accent", name: "Soft accent colour", swatch: "linear-gradient(rgb(var(--accent) / 0.12), rgb(var(--accent) / 0.12)), #fff" },
|
||||
{ id: "brand", name: "Main colour", swatch: "rgb(var(--brand))" },
|
||||
{ id: "dark", name: "Deep main colour", swatch: "linear-gradient(rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.35)), rgb(var(--brand-dark))" },
|
||||
];
|
||||
type Options = { variants: Record<string, Record<string, string[]>>; headers: Record<string, string[]> };
|
||||
|
||||
const TEMPLATES = [
|
||||
@@ -94,7 +105,7 @@ export default function TemplatePage() {
|
||||
)}
|
||||
|
||||
{tab === "home" && (
|
||||
<Panel title="Home page: sections and layouts" icon={ListOrdered} sub={<>Every layout works in every template; the first ones listed suit {TEMPLATES.find((t) => t.id === design.template)?.name} best. What each section says is on the home page, under Pages.</>}>
|
||||
<Panel title="Home page: sections and layouts" icon={ListOrdered} sub={<>Every layout works in every template; the first ones listed suit {TEMPLATES.find((t) => t.id === design.template)?.name} best. Each section can have its own background in your church's colours (a layout with a photo or band keeps its own). What each section says is on the home page, under Pages.</>}>
|
||||
<ul className="divide-y divide-gray-100">
|
||||
{design.home.map((e, i) => {
|
||||
const recommended = options.variants[design.template]?.[e.section] ?? [];
|
||||
@@ -107,6 +118,16 @@ export default function TemplatePage() {
|
||||
onChange={(ev) => save({ variants: { [e.section]: ev.target.value } })}>
|
||||
{ordered.map((v) => <option key={v} value={v}>{VARIANT_NAMES[v]}{recommended.includes(v) ? " (suits this template)" : ""}</option>)}
|
||||
</select>
|
||||
{/* The top of the page draws its own background (photo, colour or plain). */}
|
||||
{e.section !== "hero" && (
|
||||
<span className="flex items-center gap-2">
|
||||
<span className="h-6 w-6 shrink-0 rounded border border-gray-300" style={{ background: BACKGROUNDS.find((b) => b.id === (e.background ?? ""))?.swatch }} aria-hidden />
|
||||
<select aria-label={`${SECTIONS[e.section]} background`} title="Background" className={`${inputClass} w-48`} value={e.background ?? ""} disabled={busy}
|
||||
onChange={(ev) => save({ home: design.home.map(({ background: _b, ...x }) => (x.section === e.section ? (ev.target.value ? { ...x, background: ev.target.value } : x) : { ...x, ...(_b ? { background: _b } : {}) })) })}>
|
||||
{BACKGROUNDS.map((b) => <option key={b.id} value={b.id}>{b.id ? b.name : `Background: ${b.name.toLowerCase()}`}</option>)}
|
||||
</select>
|
||||
</span>
|
||||
)}
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" checked={!e.hidden} disabled={busy} onChange={(ev) => save({ home: design.home.map((x) => (x.section === e.section ? { ...x, hidden: !ev.target.checked } : x)) })} />
|
||||
Show
|
||||
|
||||
@@ -59,18 +59,18 @@ h1, h2, h3 {
|
||||
* Section colour: tinted alternates the church colour as a soft background; mixed adds dark bands.
|
||||
* Never on a section that sets its own background (cc-own-bg: a banner, a photo, a dark band).
|
||||
*/
|
||||
[data-section-colour="tinted"] .cc-section:not(.cc-own-bg):nth-of-type(even) { background: rgb(var(--brand-tint)); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) { background: rgb(var(--brand-dark)); color: rgb(var(--on-brand)); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-card { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.2); color: inherit; }
|
||||
[data-section-colour="tinted"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(even) { background: rgb(var(--brand-tint)); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) { background: rgb(var(--brand-dark)); color: rgb(var(--on-brand)); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-card { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.2); color: inherit; }
|
||||
|
||||
/* Text on a dark background (Bold's cards and bands, a dark section): light, and still AA. */
|
||||
.cc-dark .cc-muted, [data-template="bold"] .cc-card .cc-muted,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-muted { color: rgb(255 255 255 / 0.8); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-muted { color: rgb(255 255 255 / 0.8); }
|
||||
.cc-dark .cc-link, .cc-dark .cc-eyebrow, .cc-dark .cc-brand-text,
|
||||
[data-template="bold"] .cc-card .cc-link, [data-template="bold"] .cc-card .cc-eyebrow, [data-template="bold"] .cc-card .cc-brand-text,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-link,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-eyebrow,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-brand-text { color: rgb(255 255 255); }
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-link,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-eyebrow,
|
||||
[data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-brand-text { color: rgb(255 255 255); }
|
||||
|
||||
.cc-muted { color: rgb(75 85 99); }
|
||||
/* The church's colour as text (made AA on light by the palette): here, not a utility, so the dark rules above win. */
|
||||
@@ -108,10 +108,32 @@ h1, h2, h3 {
|
||||
[data-buttons="pill"] .cc-btn { border-radius: 9999px; }
|
||||
[data-template="bold"] .cc-btn { @apply uppercase tracking-wider; }
|
||||
/* A button on a photo or a dark band: always light on dark. */
|
||||
.cc-on-dark .cc-btn, .cc-dark .cc-btn, [data-section-colour="mixed"] .cc-section:not(.cc-own-bg):nth-of-type(3n) .cc-btn {
|
||||
.cc-on-dark .cc-btn, .cc-dark .cc-btn, [data-section-colour="mixed"] .cc-section:not(.cc-own-bg):not([data-bg]):nth-of-type(3n) .cc-btn {
|
||||
background: rgb(255 255 255); color: rgb(17 24 39); border-color: rgb(255 255 255);
|
||||
}
|
||||
|
||||
/*
|
||||
* A homepage section's own background (Template → Home page), always from the church's colours.
|
||||
* It replaces the Section colour's pattern for that section; a layout with its own background
|
||||
* (cc-own-bg: a photo, a band) keeps it. On the main colour, text is the palette's on-brand
|
||||
* colour (AA); on the deep shade, white.
|
||||
*/
|
||||
.cc-section[data-bg="light"]:not(.cc-own-bg) { background: rgb(255 255 255); }
|
||||
.cc-section[data-bg="tint"]:not(.cc-own-bg) { background: rgb(var(--brand-tint)); }
|
||||
.cc-section[data-bg="accent"]:not(.cc-own-bg) { background: rgb(var(--accent) / 0.12); }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) { background: rgb(var(--brand)); color: rgb(var(--on-brand)); }
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) { background: linear-gradient(rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.35)), rgb(var(--brand-dark)); color: rgb(255 255 255); }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) .cc-card,
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) .cc-card { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.25); color: inherit; box-shadow: none; }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) .cc-muted { color: rgb(var(--on-brand) / 0.85); }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) :is(.cc-link, .cc-eyebrow, .cc-brand-text) { color: rgb(var(--on-brand)); }
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) .cc-muted { color: rgb(255 255 255 / 0.8); }
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) :is(.cc-link, .cc-eyebrow, .cc-brand-text) { color: rgb(255 255 255); }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) .cc-btn { background: rgb(var(--on-brand)); color: rgb(var(--brand)); border-color: rgb(var(--on-brand)); }
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) .cc-btn { background: rgb(255 255 255); color: rgb(17 24 39); border-color: rgb(255 255 255); }
|
||||
.cc-section[data-bg="brand"]:not(.cc-own-bg) .cc-btn:hover,
|
||||
.cc-section[data-bg="dark"]:not(.cc-own-bg) .cc-btn:hover { opacity: 0.9; }
|
||||
|
||||
/* Cards. */
|
||||
.cc-card { @apply overflow-hidden bg-white; border-radius: var(--cc-radius, 0.5rem); }
|
||||
[data-template="heritage"] .cc-card { border: 1px solid rgb(var(--brand-text) / 0.2); }
|
||||
|
||||
@@ -9,8 +9,9 @@ import { Button, cx, DateBadge, dayName, fmtDate, fmtTime, Img, Paragraphs, Pict
|
||||
import type { SectionProps, SiteEvent } from "../types";
|
||||
import { Hero } from "./Hero";
|
||||
|
||||
const Section = ({ children, className, id }: { children: React.ReactNode; className?: string; id?: string }) => (
|
||||
<section id={id} className={cx("cc-section", className)}>{children}</section>
|
||||
/** `data-bg`: the section's own background, when the church gave it one (globals.css). */
|
||||
const Section = ({ p, children, className, id }: { p: SectionProps; children: React.ReactNode; className?: string; id?: string }) => (
|
||||
<section id={id} data-bg={p.section.background} className={cx("cc-section", className)}>{children}</section>
|
||||
);
|
||||
|
||||
const tz = (p: SectionProps) => p.site.church?.timezone ?? "Africa/Johannesburg";
|
||||
@@ -79,7 +80,7 @@ function ServiceTimes(p: SectionProps) {
|
||||
if (p.section.variant === "map") {
|
||||
const geo = p.site.church?.contact.address?.geo;
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap grid items-stretch gap-8 md:grid-cols-2">
|
||||
{panel}
|
||||
{geo ? (
|
||||
@@ -90,7 +91,7 @@ function ServiceTimes(p: SectionProps) {
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
return <Section><div className="cc-wrap"><div className={cx(p.template === "heritage" ? "mx-auto max-w-xl" : "max-w-2xl")}>{panel}</div></div></Section>;
|
||||
return <Section p={p}><div className="cc-wrap"><div className={cx(p.template === "heritage" ? "mx-auto max-w-xl" : "max-w-2xl")}>{panel}</div></div></Section>;
|
||||
}
|
||||
|
||||
// ─── Welcome: Text · Image and text · With pastor's photo and quote ────────────────
|
||||
@@ -108,7 +109,7 @@ function Welcome(p: SectionProps) {
|
||||
if (p.section.variant === "pastor" && d.pastor) {
|
||||
const photo = media(p.site, d.pastor.photoId, p.section.data);
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap grid items-center gap-10 md:grid-cols-[2fr_3fr]">
|
||||
<figure className={cx(centred && "text-center")}>
|
||||
<Img image={photo} ratio="aspect-[4/5]" className={cx(p.template === "community" && "rounded-[2rem]", centred && "mx-auto max-w-xs")} />
|
||||
@@ -122,7 +123,7 @@ function Welcome(p: SectionProps) {
|
||||
}
|
||||
if (p.section.variant === "image-text") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className={cx("grid items-center gap-10 md:grid-cols-2", p.template === "bold" ? "px-0 md:gap-0" : "cc-wrap")}>
|
||||
<Img image={media(p.site, d.imageId, p.section.data)} ratio={p.template === "bold" ? "aspect-square md:aspect-auto md:h-full md:min-h-[28rem]" : "aspect-[4/3]"} className={cx(p.template === "community" && "rounded-[2rem]", p.template === "bold" && "rounded-none")} />
|
||||
<div className={cx(p.template === "bold" && "px-6 py-10 sm:px-12")}>{words}</div>
|
||||
@@ -130,7 +131,7 @@ function Welcome(p: SectionProps) {
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
return <Section><div className="cc-wrap"><div className="cc-text">{words}</div></div></Section>;
|
||||
return <Section p={p}><div className="cc-wrap"><div className="cc-text">{words}</div></div></Section>;
|
||||
}
|
||||
|
||||
// ─── Ministries: Cards · List · Alternating bands ───────────────────────────────
|
||||
@@ -145,7 +146,7 @@ function Ministries(p: SectionProps) {
|
||||
|
||||
if (p.section.variant === "bands") {
|
||||
return (
|
||||
<Section className="!pb-0">
|
||||
<Section p={p} className="!pb-0">
|
||||
<div className="cc-wrap">{head}</div>
|
||||
<div className={cx(p.template === "bold" ? "" : "cc-wrap space-y-10")}>
|
||||
{list.map((m, i) => (
|
||||
@@ -165,7 +166,7 @@ function Ministries(p: SectionProps) {
|
||||
}
|
||||
if (p.section.variant === "list") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ul className={cx("divide-y", p.template === "heritage" ? "mx-auto max-w-2xl divide-brand-text/20" : "divide-gray-200")}>
|
||||
@@ -181,7 +182,7 @@ function Ministries(p: SectionProps) {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ul className={cx("grid gap-6", list.length > 3 ? "sm:grid-cols-2 lg:grid-cols-4" : "sm:grid-cols-3")}>
|
||||
@@ -220,7 +221,7 @@ function Team(p: SectionProps) {
|
||||
);
|
||||
if (p.section.variant === "list") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ul className="mx-auto max-w-2xl divide-y divide-gray-200">
|
||||
@@ -233,7 +234,7 @@ function Team(p: SectionProps) {
|
||||
if (p.section.variant === "featured") {
|
||||
const [lead, ...rest] = people;
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
{face(lead!, true)}
|
||||
@@ -242,7 +243,7 @@ function Team(p: SectionProps) {
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
return <Section><div className="cc-wrap">{head}<div className="grid grid-cols-2 gap-8 sm:grid-cols-4">{people.map((l) => face(l))}</div></div></Section>;
|
||||
return <Section p={p}><div className="cc-wrap">{head}<div className="grid grid-cols-2 gap-8 sm:grid-cols-4">{people.map((l) => face(l))}</div></div></Section>;
|
||||
}
|
||||
|
||||
// ─── Upcoming events: Cards · List · Calendar strip ─────────────────────────────
|
||||
@@ -253,7 +254,12 @@ export function EventLine({ e, timeZone }: { e: SiteEvent; timeZone: string }) {
|
||||
<>
|
||||
<time dateTime={e.startsAt} className="cc-muted block text-sm">{when}</time>
|
||||
{e.location && <span className="cc-muted block text-sm">{e.location}</span>}
|
||||
{e.registration && e.registration.status === "open" && <span className="cc-eyebrow mt-1 block text-xs">Register on our Events site</span>}
|
||||
{e.registration && e.from === "events" && (
|
||||
<span className="cc-eyebrow mt-1 block text-xs">
|
||||
{/* Only an event that takes registrations says "Register"; a contact-only one (or a full or closed one) has its details there. */}
|
||||
{(e.registration.mode ?? "origin") === "origin" && e.registration.status === "open" ? "Register on our Events site" : "More info on our Events site"}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -266,11 +272,11 @@ function Events(p: SectionProps) {
|
||||
const head = <SectionHeading heading={d.heading ?? "Coming up"} centred={p.template === "heritage"} />;
|
||||
const more = page && <p className={cx("mt-8", p.template === "heritage" && "text-center")}><a href={page.path} className="cc-link font-semibold">All events</a></p>;
|
||||
if (!list.length) {
|
||||
return <Section><div className="cc-wrap">{head}<p className="cc-muted">Nothing on the calendar just now. Check back soon.</p></div></Section>;
|
||||
return <Section p={p}><div className="cc-wrap">{head}<p className="cc-muted">Nothing on the calendar just now. Check back soon.</p></div></Section>;
|
||||
}
|
||||
if (p.section.variant === "cards") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ul className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@@ -294,7 +300,7 @@ function Events(p: SectionProps) {
|
||||
}
|
||||
if (p.section.variant === "calendar") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ol className="flex snap-x gap-4 overflow-x-auto pb-4">
|
||||
@@ -314,7 +320,7 @@ function Events(p: SectionProps) {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<ul className={cx("divide-y divide-gray-200", p.template === "heritage" && "mx-auto max-w-2xl")}>
|
||||
@@ -351,7 +357,7 @@ function LatestMessage(p: SectionProps) {
|
||||
);
|
||||
if (p.section.variant === "compact") {
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
<div className="flex flex-col gap-4 border-y border-gray-200 py-6 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div><p className="cc-eyebrow">{d.heading ?? "Latest message"}</p><p className="font-heading text-xl font-semibold">{m.title}</p><p className="cc-muted text-sm">{meta}</p></div>
|
||||
@@ -363,7 +369,7 @@ function LatestMessage(p: SectionProps) {
|
||||
}
|
||||
if (p.section.variant === "video") {
|
||||
return (
|
||||
<Section className={cx(p.template === "bold" && "cc-own-bg cc-dark bg-gray-950 text-white")}>
|
||||
<Section p={p} className={cx(p.template === "bold" && "cc-own-bg cc-dark bg-gray-950 text-white")}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<MessagePlayer title={m.title} embedUrl={m.embedUrl} thumbnail={m.thumbnail} url={m.url} source={m.source} />
|
||||
@@ -373,7 +379,7 @@ function LatestMessage(p: SectionProps) {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap">
|
||||
{head}
|
||||
<div className="cc-card grid items-center gap-0 md:grid-cols-2">
|
||||
@@ -414,7 +420,7 @@ function Invitation(p: SectionProps) {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap text-center">
|
||||
<h2 className="cc-h2">{d.heading}</h2>
|
||||
{d.text && <p className="cc-muted mx-auto mt-4 max-w-2xl text-lg">{d.text}</p>}
|
||||
@@ -428,13 +434,13 @@ function Invitation(p: SectionProps) {
|
||||
|
||||
function TextBlock(p: SectionProps) {
|
||||
const d = p.section.data as { heading: string | null; body: string };
|
||||
return <Section><div className="cc-wrap"><div className="cc-text">{d.heading && <h2 className="cc-h2 mb-6">{d.heading}</h2>}<Paragraphs text={d.body} /></div></div></Section>;
|
||||
return <Section p={p}><div className="cc-wrap"><div className="cc-text">{d.heading && <h2 className="cc-h2 mb-6">{d.heading}</h2>}<Paragraphs text={d.body} /></div></div></Section>;
|
||||
}
|
||||
|
||||
function ImageTextBlock(p: SectionProps) {
|
||||
const d = p.section.data as { heading: string | null; body: string; imageId: string | null; button: ButtonData };
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<div className="cc-wrap grid items-center gap-10 md:grid-cols-2">
|
||||
<Img image={media(p.site, d.imageId, p.section.data)} className={cx(p.template === "community" && "rounded-[2rem]")} />
|
||||
<div>{d.heading && <h2 className="cc-h2 mb-6">{d.heading}</h2>}<Paragraphs text={d.body} /><div className="mt-6"><Button button={d.button} /></div></div>
|
||||
@@ -446,7 +452,7 @@ function ImageTextBlock(p: SectionProps) {
|
||||
function QuoteBlock(p: SectionProps) {
|
||||
const d = p.section.data as { quote: string; by: string | null };
|
||||
return (
|
||||
<Section>
|
||||
<Section p={p}>
|
||||
<figure className="cc-wrap text-center">
|
||||
<blockquote className="font-heading mx-auto max-w-3xl text-2xl leading-snug sm:text-3xl">“{d.quote}”</blockquote>
|
||||
{str(d.by) && <figcaption className="cc-muted mt-4">{d.by}</figcaption>}
|
||||
|
||||
@@ -12,7 +12,8 @@ export type Focus = { x: number; y: number; zoom: number };
|
||||
|
||||
export type Image = { url: string; alt: string; width: number | null; height: number | null; srcset?: { webp: string; jpg: string }; focus?: Focus };
|
||||
|
||||
export type Section = { type: string; variant: string | null; data: Record<string, unknown> };
|
||||
/** `background`: a homepage section's own background (light | tint | accent | brand | dark), when it has one. */
|
||||
export type Section = { type: string; variant: string | null; data: Record<string, unknown>; background?: "light" | "tint" | "accent" | "brand" | "dark" };
|
||||
|
||||
export type Page = {
|
||||
kind: string;
|
||||
@@ -59,7 +60,7 @@ export type SiteEvent = {
|
||||
slug: string | null;
|
||||
link: string | null;
|
||||
from: "website" | "events" | "app";
|
||||
registration: { status: string; priceFromCents: number | null } | null;
|
||||
registration: { mode: string; status: string; priceFromCents: number | null } | null;
|
||||
};
|
||||
|
||||
export type SiteMessage = {
|
||||
|
||||
Reference in New Issue
Block a user