Plans the Over mij page
Refreshes the reverse engineering docs after the homepage sections and records the requirements, execution plan and application design for the Over mij page: live texts in the design's structure, an indexed page with its own structured data and preview image, and shared building blocks (PageSection, MediaText, Eyebrow) reused by the homepage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
# Component Methods — Over mij Page
|
||||
|
||||
Props are TypeScript types; components are default-exported function components, as elsewhere in `web/src/components/`. Business rules (structured data contents, inline link model) are detailed in Functional Design for unit 2.
|
||||
|
||||
## Shared building blocks
|
||||
|
||||
### PageSection (renamed from HomeSection)
|
||||
```ts
|
||||
type PageSectionProps = {
|
||||
labelledBy: string; // id of the heading that names the section
|
||||
id?: string; // anchor target, gets the header offset
|
||||
tone?: 'paper' | 'alt';
|
||||
width?: 'default' | 'narrow' | 'full';
|
||||
spacing?: 'default' | 'tight' | 'flushTop'; // flushTop: new
|
||||
'data-testid'?: string;
|
||||
children: ReactNode;
|
||||
};
|
||||
```
|
||||
|
||||
### MediaText
|
||||
```ts
|
||||
type MediaTextProps = {
|
||||
image: ContentImage;
|
||||
aspectRatio: string; // crop of the photo, e.g. '4 / 3'
|
||||
'data-testid'?: string;
|
||||
children: ReactNode; // the text column
|
||||
};
|
||||
```
|
||||
- Renders the grid; the photo column is `FramedImage`, each column wrapped in `Reveal`.
|
||||
- A `reverse` (photo on the right) option is **not** added: no page needs it yet (design `.about--reverse` is unused).
|
||||
|
||||
### Eyebrow
|
||||
```ts
|
||||
type EyebrowProps = Omit<TextProps, 'as'> & {
|
||||
as?: 'p' | 'span' | 'h2' | 'h3' | 'h4'; // default 'p'
|
||||
children: ReactNode;
|
||||
};
|
||||
```
|
||||
- Applies `textStyle="eyebrow"`, `color="accent.deep"`, `mb={4}`; other `TextProps` (e.g. `id`, `mb`) pass through, so a heading can be referenced by `aria-labelledby`.
|
||||
- Heading levels do not get the heading recipe's font family/size: the label style wins on purpose (FR-OM-03).
|
||||
|
||||
### PhotoDuo
|
||||
```ts
|
||||
type PhotoDuoProps = {
|
||||
photos: [ContentImage, ContentImage];
|
||||
label: string; // accessible name of the list, e.g. "Foto's"
|
||||
'data-testid'?: string;
|
||||
};
|
||||
```
|
||||
|
||||
### SectionHeading, PageIntro, ContactFormGate, TestimonialSlide
|
||||
- Props unchanged; internally `Eyebrow` replaces the inline `Text` label.
|
||||
|
||||
## Page-specific components (`components/about/`)
|
||||
|
||||
### AboutIntro
|
||||
```ts
|
||||
type AboutIntroProps = { content: AboutPageContent['intro'] };
|
||||
```
|
||||
|
||||
### StorySection
|
||||
```ts
|
||||
type StorySectionProps = {
|
||||
content: AboutPageContent['story']; // one story block: title + paragraphs
|
||||
titleId: string; // id of the h3, for aria-labelledby
|
||||
tone?: 'paper' | 'alt';
|
||||
children?: ReactNode; // below the text, e.g. the booking button
|
||||
'data-testid'?: string;
|
||||
};
|
||||
```
|
||||
|
||||
### RichParagraph
|
||||
```ts
|
||||
type RichParagraphProps = { paragraph: RichText }; // RichText defined in Functional Design
|
||||
```
|
||||
|
||||
## Route
|
||||
```ts
|
||||
export const Route = createFileRoute('/over-mij')({
|
||||
head: () => aboutHead(aboutContent, siteContent), // or inline: pageHead + script
|
||||
component: About,
|
||||
});
|
||||
```
|
||||
|
||||
## SEO functions (`seo.ts`, pure, 100% coverage)
|
||||
```ts
|
||||
export const businessId: string; // e.g. `${siteUrl}/#business`
|
||||
export function professionalService(content: SiteContent); // now includes '@id': businessId
|
||||
export function person(content: SiteContent, image: OgImage): PersonJsonLd;
|
||||
export function aboutPage(path: RoutePath, content: SiteContent): AboutPageJsonLd;
|
||||
export function structuredDataScript(data: unknown): { type: 'application/ld+json'; children: string };
|
||||
```
|
||||
- `structuredDataScript` wraps the existing `jsonLdScript` so `siteHead` and the about page build the script tag the same way.
|
||||
- Exact fields and the rules behind them (`sameAs`, image, no e-mail, `@id` links) are specified in Functional Design (unit 2).
|
||||
|
||||
## Content types (`content/types.ts`)
|
||||
```ts
|
||||
export interface AboutPageContent {
|
||||
head: { eyebrow: string; title: string };
|
||||
intro: { eyebrow: string; title: string; paragraphs: RichText[]; image: ContentImage };
|
||||
background: { title: string; paragraphs: string[] };
|
||||
photos: [ContentImage, ContentImage];
|
||||
personal: { title: string; paragraphs: string[] };
|
||||
booking: { label: string; to: /* route + optional hash, see Functional Design */ };
|
||||
}
|
||||
```
|
||||
- `RichText` and the link target type are defined in Functional Design.
|
||||
Reference in New Issue
Block a user