Files
AndreaSlopFotografie/aidlc-docs/features/soorten-fotoshoots-page/inception/application-design/component-methods.md
T
SluijsensandClaude Opus 5.5 166e5d32bb Records unit 1 of the Soorten fotoshoots page as generated
Adds the feature's inception documents (requirements, execution plan,
application design), the code generation plan and summary of unit 1,
its state and audit log, and its row in the active features list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 08:26:06 +01:00

3.8 KiB

Component Methods — Soorten fotoshoots Page

Props and function signatures. Business rules (exact link rules, structured data rules, properties for PBT) follow in Functional Design for unit 2.

Types (content/types.ts)

export type ShootTypeId = 'newborn' | 'zwangerschap' | 'gezin' | 'loveshoot' | 'portret';

// Colour tokens allowed behind a framed photo
export type FrameColor = 'sand' | 'accent' | 'frame.stone' | 'frame.rust' | 'frame.taupe' | 'frame.olive';

export interface ShootType {
    id: ShootTypeId;              // stable; also used by portfolio-page and in URLs
    name: string;                 // heading / short name: 'Newborn' … 'Portretten'
    shootLabel: string;           // 'Newbornshoot' … 'Portretshoot'
    photosLabel: string;          // "newbornfoto's" … "portretfoto's" (portfolio link)
    paragraphs: string[];
    image: ContentImage;          // 4:5 crop
    frameColor: FrameColor;
    packageId?: PricingPackage['id'];
}

export interface ShootTypesPageContent {
    head: { eyebrow: string; title: string; intro: string };
    closing: { title: string; lead: RichText; buttonLabel: string };
}

export interface SiteContent {
    // … existing fields
    serviceArea: ServiceArea[];
}

export interface ServiceArea {
    type: 'City' | 'AdministrativeArea';
    name: string;
}

photosLabel and frameColor are additions to the shape agreed with portfolio-page; both are additive and announced to it.

Shared components

// FramedImage
type FramedImageProps = {
    image: ContentImage;
    aspectRatio: string;
    priority?: boolean;
    frameColor?: FrameColor;      // default 'sand'
};

// MediaText
type MediaTextProps = {
    image: ContentImage;
    aspectRatio: string;
    priority?: boolean;
    reverse?: boolean;            // default false
    frameColor?: FrameColor;      // default 'sand'
    'data-testid'?: string;
    children: ReactNode;
};

// CallToAction
type CallToActionProps = {
    title: string;
    titleId: string;              // names the section
    lead?: ReactNode;
    'data-testid'?: string;
    children: ReactNode;          // the action, e.g. a LinkButton
};

// RichParagraph (moved, same props)
type RichParagraphProps = { paragraph: RichText };

Page components

// ShootList
type ShootListProps = {
    shoots: ShootType[];
    portfolioLive: boolean;
};

// ShootBlock
type ShootBlockProps = {
    shoot: ShootType;
    reverse: boolean;
    priority: boolean;
    portfolioLive: boolean;
};

Logic

// lib/shootLinks.ts — router link props, so routes and search stay type-checked
export function shootContactLink(shoot: ShootType):
    | { to: '/'; search: { pakket: string }; hash: 'contact' }
    | { to: '/'; hash: 'contact' };

export function shootPortfolioLink(shoot: ShootType):
    { to: '/portfolio'; search: { shoot: ShootTypeId } };

// The portfolio links show once the page is live (indexed in sitePages)
export function isPortfolioLive(pages: Record<RoutePath, PageMeta>): boolean;

When contact-page lands, shootContactLink switches to { to: '/contact', search?: { pakket } }; nothing else changes. The /portfolio route must accept ?shoot= in its search validation (portfolio-page's route); until it does, the link type is guarded by the isPortfolioLive switch and the typed route check is added when portfolio-page's route is in master.

// seo.ts
export function areaServed(area: ServiceArea[]): object[];        // schema.org Place items
export function professionalService(content: SiteContent): object; // now uses areaServed(content.serviceArea)
export function shootServices(shoots: ShootType[], content: SiteContent): object; // ItemList of Service
// Used in the route head:
// webPage('WebPage', '/soorten-fotoshoots', { mainEntity: shootServices(shootTypes, siteContent) })