Reading mode spacing, phone map width, no fixed back links
- Reading mode: parts the page draws on their own lines get a space between them, so words no longer run together; the column is 60rem (was 42rem) and headings are bold in the display face. - Local groups map scales to its column on a phone instead of holding 34rem and scrolling sideways. - Group, region, partner and team pages drop their fixed back link (records are reached from many pages); orgListHref is gone. Not-found pages keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
de17da7dc8
commit
502a294940
7 changed files with 20 additions and 52 deletions
|
|
@ -68,11 +68,11 @@ function inline(node: Node): Inline[] {
|
|||
if (!(node instanceof Element) || skipped(node) || node.tagName === 'IMG') return []
|
||||
if (node.tagName === 'BR') return [' ']
|
||||
const children = [...node.childNodes].flatMap(inline)
|
||||
if (node instanceof HTMLAnchorElement) {
|
||||
const href = hrefOf(node)
|
||||
return href ? [{ href, children }] : children
|
||||
}
|
||||
return children
|
||||
const href = node instanceof HTMLAnchorElement ? hrefOf(node) : null
|
||||
const parts: Inline[] = href ? [{ href, children }] : children
|
||||
// A part the page draws on its own line (a span set to block, a
|
||||
// flex row's items) has no space in its text: give it one.
|
||||
return getComputedStyle(node).display.startsWith('inline') ? parts : [' ', ...parts, ' ']
|
||||
}
|
||||
|
||||
const textOf = (parts: Inline[]): string =>
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ iframe[src*="churchcenter"] {
|
|||
}
|
||||
}
|
||||
.reader {
|
||||
max-width: 42rem;
|
||||
max-width: 60rem;
|
||||
margin-inline: auto;
|
||||
padding: 2.5rem 1rem 6rem;
|
||||
line-height: 1.75;
|
||||
|
|
@ -315,6 +315,8 @@ iframe[src*="churchcenter"] {
|
|||
}
|
||||
.reader :is(h1, h2, h3, h4, h5, h6) {
|
||||
margin-top: 2rem;
|
||||
font-family: var(--font-display);
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.reader h1 { font-size: 2rem; }
|
||||
|
|
|
|||
|
|
@ -151,18 +151,3 @@ export function refHref(
|
|||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/* Where "back" goes from a record page. A group belongs to
|
||||
/community, a retreat to /retreats. */
|
||||
export function orgListHref(kind?: string | null): { to: string; label: string } {
|
||||
switch (kind) {
|
||||
case 'region':
|
||||
return { to: '/community#regions', label: 'All regions' }
|
||||
case 'group':
|
||||
return { to: '/community#groups', label: 'All groups' }
|
||||
case 'partner':
|
||||
return { to: '/community#partners', label: 'All partner organizations' }
|
||||
default:
|
||||
return { to: '/community', label: 'Community' }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {
|
|||
useOrganization,
|
||||
type OrganizationRecord,
|
||||
} from '../lib/useContent.ts'
|
||||
import { orgHref, orgListHref } from '../lib/hrefs.ts'
|
||||
import { orgHref } from '../lib/hrefs.ts'
|
||||
import { mediaUrl } from '../lib/media.ts'
|
||||
import { initialsFor } from '../lib/organizations.ts'
|
||||
import Logo from '../components/Logo.tsx'
|
||||
|
|
@ -70,7 +70,6 @@ export default function OrganizationDetail() {
|
|||
}
|
||||
|
||||
const accent = org.color || BRAND
|
||||
const back = orgListHref(org.kind)
|
||||
|
||||
const sections: any[] = [
|
||||
{
|
||||
|
|
@ -79,7 +78,7 @@ export default function OrganizationDetail() {
|
|||
accent,
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6 space-y-8">
|
||||
<Facts org={org} accent={accent} back={back} />
|
||||
<Facts org={org} accent={accent} />
|
||||
|
||||
{org.description.map((paragraph, index) => (
|
||||
<p key={index} className="leading-relaxed max-w-3xl" style={{ color: BODY }}>
|
||||
|
|
@ -211,11 +210,9 @@ export default function OrganizationDetail() {
|
|||
function Facts({
|
||||
org,
|
||||
accent,
|
||||
back,
|
||||
}: {
|
||||
org: OrganizationRecord
|
||||
accent: string
|
||||
back: { to: string; label: string }
|
||||
}) {
|
||||
const where =
|
||||
org.location_label || [org.locality, org.state_code].filter(Boolean).join(', ')
|
||||
|
|
@ -248,10 +245,6 @@ function Facts({
|
|||
<span style={{ color: BODY }}>Since {org.details.started}</span>
|
||||
)}
|
||||
{org.is_online && <span style={{ color: BODY }}>Online</span>}
|
||||
|
||||
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
|
||||
{back.label}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,14 +142,6 @@ function Facts({
|
|||
{orgName}
|
||||
</Link>
|
||||
</span>
|
||||
|
||||
<Link
|
||||
to={orgHref(orgId, orgKind)}
|
||||
className="ml-auto hover:underline"
|
||||
style={{ color: accentText(accent) }}
|
||||
>
|
||||
Back to {orgName}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -960,18 +960,14 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
|
|||
<div className="grid grid-cols-1 lg:grid-cols-[1.45fr_1fr] gap-10 items-stretch">
|
||||
{/* Map */}
|
||||
<div className="min-w-0">
|
||||
{/* On a phone the map keeps a readable size (tiles big enough
|
||||
to read and tap) and scrolls sideways in its own box. */}
|
||||
<div className="-mx-6 overflow-x-auto px-6 sm:mx-0 sm:px-0">
|
||||
<div className="min-w-[34rem] sm:min-w-0">
|
||||
<RegionMap
|
||||
slices={slices}
|
||||
groupCounts={groupCounts}
|
||||
onPick={pickArea}
|
||||
{...shared}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/* Scales to the column's width at every size; on a phone the
|
||||
legend and the list below are the easier way in. */}
|
||||
<RegionMap
|
||||
slices={slices}
|
||||
groupCounts={groupCounts}
|
||||
onPick={pickArea}
|
||||
{...shared}
|
||||
/>
|
||||
<Legend
|
||||
domestic={domestic}
|
||||
international={international}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue