Extracts shared section blocks for use beyond the homepage

HomeSection becomes PageSection, since every page needs the same section
frame, and gains a flushTop spacing for a block right below a page head.
The framed photo next to text from the homepage About block becomes
MediaText, and the accent label that four components wrote out by hand
becomes Eyebrow, which can also render as a heading. The homepage renders
exactly as before: a layout comparison of every element against master
at three widths shows no differences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 23:35:22 +02:00
co-authored by Claude Opus 5.5
parent 26106f280f
commit 01e849c6b0
18 changed files with 321 additions and 89 deletions
@@ -1,7 +1,6 @@
import { Grid, Link, Stack, Text } from '@chakra-ui/react';
import FramedImage from '@/components/FramedImage/FramedImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import Reveal from '@/components/Reveal/Reveal';
import { Link, Stack, Text } from '@chakra-ui/react';
import MediaText from '@/components/MediaText/MediaText';
import PageSection from '@/components/PageSection/PageSection';
import RouterLink from '@/components/RouterLink';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent } from '@/content/types';
@@ -16,40 +15,31 @@ type AboutBlockProps = {
// link to the about page (design .about). Stacked on phones and tablets.
export default function AboutBlock({ content }: AboutBlockProps) {
return (
<HomeSection labelledBy={TITLE_ID} tone="alt" data-testid="about-block">
<Grid
templateColumns={{ base: '1fr', lg: '1fr 1fr' }}
gap="clamp(2rem, 6vw, 5.5rem)"
alignItems="center"
>
<Reveal>
<FramedImage image={content.image} aspectRatio="4 / 3" />
</Reveal>
<Reveal>
<SectionHeading
id={TITLE_ID}
eyebrow={content.eyebrow}
title={content.title}
align="start"
spacing="compact"
/>
<Stack gap={4} color="ink.soft">
{content.paragraphs.map((paragraph) => (
<Text key={paragraph}>{paragraph}</Text>
))}
<Text>
<Link variant="underline" asChild>
<RouterLink
to={content.link.to}
data-testid="about-block-link"
>
{content.link.label}
</RouterLink>
</Link>
</Text>
</Stack>
</Reveal>
</Grid>
</HomeSection>
<PageSection labelledBy={TITLE_ID} tone="alt" data-testid="about-block">
<MediaText image={content.image} aspectRatio="4 / 3">
<SectionHeading
id={TITLE_ID}
eyebrow={content.eyebrow}
title={content.title}
align="start"
spacing="compact"
/>
<Stack gap={4} color="ink.soft">
{content.paragraphs.map((paragraph) => (
<Text key={paragraph}>{paragraph}</Text>
))}
<Text>
<Link variant="underline" asChild>
<RouterLink
to={content.link.to}
data-testid="about-block-link"
>
{content.link.label}
</RouterLink>
</Link>
</Text>
</Stack>
</MediaText>
</PageSection>
);
}
@@ -3,7 +3,7 @@ import { Box, useMediaQuery } from '@chakra-ui/react';
import { useNavigate } from '@tanstack/react-router';
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
import ContactFormGate from '@/components/ContactForm/ContactFormGate';
import HomeSection from '@/components/HomeSection/HomeSection';
import PageSection from '@/components/PageSection/PageSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type {
@@ -109,7 +109,7 @@ export default function ContactSection({
const placeholder = <Box minH={FORM_PLACEHOLDER_HEIGHT} />;
return (
<HomeSection
<PageSection
labelledBy={TITLE_ID}
id="contact"
width="narrow"
@@ -146,6 +146,6 @@ export default function ContactSection({
</Box>
</ContactFormGate>
</Reveal>
</HomeSection>
</PageSection>
);
}
@@ -1,6 +1,6 @@
import { Box, chakra, Container, Link, VisuallyHidden } from '@chakra-ui/react';
import DeferredImage from '@/components/DeferredImage/DeferredImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import PageSection from '@/components/PageSection/PageSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent } from '@/content/types';
@@ -22,7 +22,7 @@ export default function InstagramGrid({
profileUrl,
}: InstagramGridProps) {
return (
<HomeSection
<PageSection
labelledBy={TITLE_ID}
spacing="tight"
width="full"
@@ -112,6 +112,6 @@ export default function InstagramGrid({
))}
</chakra.ul>
</Reveal>
</HomeSection>
</PageSection>
);
}
@@ -2,7 +2,7 @@ import { chakra, useBreakpointValue } from '@chakra-ui/react';
import DeferredImage, {
DEFERRED_LOAD_MARGIN,
} from '@/components/DeferredImage/DeferredImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import PageSection from '@/components/PageSection/PageSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent } from '@/content/types';
@@ -33,7 +33,7 @@ export default function IntroGallery({ content }: IntroGalleryProps) {
const scrollable = useBreakpointValue({ base: true, sm: false }) ?? false;
return (
<HomeSection labelledBy={TITLE_ID} data-testid="intro-gallery">
<PageSection labelledBy={TITLE_ID} data-testid="intro-gallery">
<Reveal>
<SectionHeading
id={TITLE_ID}
@@ -99,6 +99,6 @@ export default function IntroGallery({ content }: IntroGalleryProps) {
))}
</chakra.ul>
</Reveal>
</HomeSection>
</PageSection>
);
}
+3 -3
View File
@@ -1,6 +1,6 @@
import { Box, Grid } from '@chakra-ui/react';
import DeferredImage from '@/components/DeferredImage/DeferredImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import PageSection from '@/components/PageSection/PageSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent, PricingPackage } from '@/content/types';
@@ -32,7 +32,7 @@ export default function Pricing({ content, packages }: PricingProps) {
if (shown.length === 0) return null;
return (
<HomeSection labelledBy={TITLE_ID} data-testid="pricing">
<PageSection labelledBy={TITLE_ID} data-testid="pricing">
<Box position="relative" isolation="isolate">
{content.decorations.map((decoration, index) => (
<DeferredImage
@@ -68,6 +68,6 @@ export default function Pricing({ content, packages }: PricingProps) {
))}
</Grid>
</Box>
</HomeSection>
</PageSection>
);
}
@@ -1,4 +1,5 @@
import { Box, chakra, Grid, Text } from '@chakra-ui/react';
import Eyebrow from '@/components/Eyebrow/Eyebrow';
import FramedImage from '@/components/FramedImage/FramedImage';
import type { Testimonial } from '@/content/types';
@@ -44,10 +45,7 @@ export default function TestimonialSlide({
>
“
</Text>
{/* accent.deep instead of the design's accent: meets 4.5:1 (NFR-HP-01) */}
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
{testimonial.shoot}
</Text>
<Eyebrow>{testimonial.shoot}</Eyebrow>
{/* Plain elements, not Chakra's Blockquote: its slot recipe
would pull shared code into the chunk the hero waits for */}
<chakra.figure display="flex" flexDirection="column" gap={7}>
@@ -1,7 +1,7 @@
import { lazy, Suspense } from 'react';
import { Box } from '@chakra-ui/react';
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
import HomeSection from '@/components/HomeSection/HomeSection';
import PageSection from '@/components/PageSection/PageSection';
import Reveal from '@/components/Reveal/Reveal';
import SectionHeading from '@/components/SectionHeading/SectionHeading';
import type { HomeContent, Testimonial } from '@/content/types';
@@ -36,7 +36,7 @@ export default function Testimonials({
if (shown.length === 0) return null;
return (
<HomeSection
<PageSection
labelledBy={TITLE_ID}
tone="alt"
data-testid="testimonials"
@@ -63,7 +63,7 @@ export default function Testimonials({
</Box>
)}
</Reveal>
</HomeSection>
</PageSection>
);
}