Extends the shared blocks for the shoot types page
FramedImage and MediaText take a colour for the block behind the photo (sand by default) and MediaText can put the photo in the right-hand column from lg, without changing the reading order. RichParagraph moves to the shared components, a new CallToAction closes a page with a heading, lead and action, and the homepage pricing section gets the anchor #prijzen. A test helper reads the generated CSS rules, since jsdom applies neither media queries nor pseudo-elements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
||||
import { Grid } from '@chakra-ui/react';
|
||||
import FramedImage from '@/components/FramedImage/FramedImage';
|
||||
import Reveal from '@/components/Reveal/Reveal';
|
||||
import type { ContentImage } from '@/content/types';
|
||||
import type { ContentImage, FrameColor } from '@/content/types';
|
||||
|
||||
type MediaTextProps = {
|
||||
image: ContentImage;
|
||||
@@ -10,18 +10,25 @@ type MediaTextProps = {
|
||||
aspectRatio: string;
|
||||
// The photo is at the top of the page and should not wait (FramedImage)
|
||||
priority?: boolean;
|
||||
// Photo in the right-hand column from `lg` (design .about--reverse).
|
||||
// Only the visual order changes: the photo stays first in the DOM.
|
||||
reverse?: boolean;
|
||||
// Colour of the block behind the photo (FramedImage)
|
||||
frameColor?: FrameColor;
|
||||
'data-testid'?: string;
|
||||
// The text column; each page fills in its own heading and text
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
// A framed photo next to a text column (design .about), used on the
|
||||
// homepage and the about page. Stacked on phones and tablets, two equal
|
||||
// columns from `lg`; both columns fade in on scroll.
|
||||
// homepage, the about page and the shoot types page. Stacked on phones and
|
||||
// tablets, two equal columns from `lg`; both columns fade in on scroll.
|
||||
export default function MediaText({
|
||||
image,
|
||||
aspectRatio,
|
||||
priority,
|
||||
reverse = false,
|
||||
frameColor,
|
||||
'data-testid': testId,
|
||||
children,
|
||||
}: MediaTextProps) {
|
||||
@@ -32,11 +39,12 @@ export default function MediaText({
|
||||
alignItems="center"
|
||||
data-testid={testId}
|
||||
>
|
||||
<Reveal>
|
||||
<Reveal order={reverse ? { lg: 2 } : undefined}>
|
||||
<FramedImage
|
||||
image={image}
|
||||
aspectRatio={aspectRatio}
|
||||
priority={priority}
|
||||
frameColor={frameColor}
|
||||
/>
|
||||
</Reveal>
|
||||
<Reveal>{children}</Reveal>
|
||||
|
||||
Reference in New Issue
Block a user