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:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user