Replaces the placeholder with the page from the design and the texts from the live site: Andrea's introduction with her portrait, how it started, two photos, life outside photography and a booking button. The page is now indexed, with its own title, description, preview image and AboutPage data about Andrea. The portrait loads straight away instead of after the page, since on phones it is the largest paint. Lighthouse no longer lets every indexed page use the homepage's lower mobile performance target; it now only applies to the homepage itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import type { ReactNode } from 'react';
|
|
import { Box, Container } from '@chakra-ui/react';
|
|
|
|
type PageSectionProps = {
|
|
// Id of the heading that names this section for assistive technology.
|
|
// Without it (a block without a heading) the section is no landmark.
|
|
labelledBy?: string;
|
|
id?: string;
|
|
tone?: 'paper' | 'alt';
|
|
// full: no content column, for edge-to-edge content; the section then
|
|
// places its own Container around what should stay in the column
|
|
width?: 'default' | 'narrow' | 'full';
|
|
// flushTop: no space above, for the first block right below a page head
|
|
// (design .section--flush-top)
|
|
spacing?: 'default' | 'tight' | 'flushTop';
|
|
'data-testid'?: string;
|
|
children: ReactNode;
|
|
};
|
|
|
|
// Frame of a content section on any page (design .section): vertical
|
|
// rhythm, an optional alternate background and the content column.
|
|
export default function PageSection({
|
|
labelledBy,
|
|
id,
|
|
tone = 'paper',
|
|
width = 'default',
|
|
spacing = 'default',
|
|
'data-testid': testId,
|
|
children,
|
|
}: PageSectionProps) {
|
|
const padding = spacing === 'tight' ? 'sectionYTight' : 'sectionY';
|
|
|
|
return (
|
|
<Box
|
|
as="section"
|
|
id={id}
|
|
aria-labelledby={labelledBy}
|
|
data-testid={testId}
|
|
bg={tone === 'alt' ? 'paper.alt' : 'paper'}
|
|
// An anchor target (#contact) lands right below the fixed header,
|
|
// which has shrunk to its sticky height by the time it gets there
|
|
scrollMarginTop={id ? 'header.sticky' : undefined}
|
|
pt={spacing === 'flushTop' ? 0 : padding}
|
|
pb={padding}
|
|
>
|
|
{width === 'full' ? (
|
|
children
|
|
) : (
|
|
<Container
|
|
maxW={width === 'narrow' ? 'contentNarrow' : 'content'}
|
|
>
|
|
{children}
|
|
</Container>
|
|
)}
|
|
</Box>
|
|
);
|
|
}
|