Shows the handle as a link to the profile and six square photos from edge to edge (2, 3 or 6 per row), each linking to the profile in a new tab. The photos are ones the page already loads, so the section adds no downloads; the API will later fill it with the real feed. Without a valid https link to Instagram the section is left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import type { ReactNode } from 'react';
|
|
import { Box, Container } from '@chakra-ui/react';
|
|
|
|
type HomeSectionProps = {
|
|
// Id of the heading that names this section for assistive technology
|
|
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';
|
|
spacing?: 'default' | 'tight';
|
|
'data-testid'?: string;
|
|
children: ReactNode;
|
|
};
|
|
|
|
// Frame of a homepage section (design .section): vertical rhythm, an
|
|
// optional alternate background and the content column.
|
|
export default function HomeSection({
|
|
labelledBy,
|
|
id,
|
|
tone = 'paper',
|
|
width = 'default',
|
|
spacing = 'default',
|
|
'data-testid': testId,
|
|
children,
|
|
}: HomeSectionProps) {
|
|
return (
|
|
<Box
|
|
as="section"
|
|
id={id}
|
|
aria-labelledby={labelledBy}
|
|
data-testid={testId}
|
|
bg={tone === 'alt' ? 'paper.alt' : 'paper'}
|
|
// An anchor target (#contact) lands below the fixed header
|
|
scrollMarginTop={id ? 'header' : undefined}
|
|
py={spacing === 'tight' ? 'sectionYTight' : 'sectionY'}
|
|
>
|
|
{width === 'full' ? (
|
|
children
|
|
) : (
|
|
<Container
|
|
maxW={width === 'narrow' ? 'contentNarrow' : 'content'}
|
|
>
|
|
{children}
|
|
</Container>
|
|
)}
|
|
</Box>
|
|
);
|
|
}
|