chore: enforce common prop typing style
This commit is contained in:
@@ -19,9 +19,9 @@ export async function generateStaticParams() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
params: Promise<{ slug?: string[] }>;
|
params: Promise<{ slug?: string[] }>;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Portfolio page — one route per section, sections list always visible.
|
* Portfolio page — one route per section, sections list always visible.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Badge, Card, CardSidebar, CardTitle, RichText } from '$shared/ui';
|
import { Badge, Card, CardSidebar, CardTitle, RichText } from '$shared/ui';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Job title
|
* Job title
|
||||||
*/
|
*/
|
||||||
@@ -25,7 +25,7 @@ type Props = {
|
|||||||
* Additional CSS classes forwarded to the card
|
* Additional CSS classes forwarded to the card
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Work experience card with sidebar layout.
|
* Work experience card with sidebar layout.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Image from 'next/image';
|
|||||||
import { Card, RichText } from '$shared/ui';
|
import { Card, RichText } from '$shared/ui';
|
||||||
import { ProjectMetadata } from '../ProjectMetadata/ProjectMetadata';
|
import { ProjectMetadata } from '../ProjectMetadata/ProjectMetadata';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Project name
|
* Project name
|
||||||
*/
|
*/
|
||||||
@@ -36,7 +36,7 @@ type Props = {
|
|||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
reverse?: boolean;
|
reverse?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Full-width detailed project card with metadata sidebar.
|
* Full-width detailed project card with metadata sidebar.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
import { Badge, Button, Card, CardSidebar, CardTitle, ImageLightbox, RichText } from '$shared/ui';
|
import { Badge, Button, Card, CardSidebar, CardTitle, ImageLightbox, RichText } from '$shared/ui';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Project name
|
* Project name
|
||||||
*/
|
*/
|
||||||
@@ -32,7 +32,7 @@ type Props = {
|
|||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
priority?: boolean;
|
priority?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project card with sidebar layout.
|
* Project card with sidebar layout.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Project year
|
* Project year
|
||||||
*/
|
*/
|
||||||
@@ -17,7 +17,7 @@ type Props = {
|
|||||||
* Additional CSS classes
|
* Additional CSS classes
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sidebar metadata display for a project: year, role, and stack.
|
* Sidebar metadata display for a project: year, role, and stack.
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* CSS classes on the svg element
|
* CSS classes on the svg element
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close / X icon (Lucide).
|
* Close / X icon (Lucide).
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* CSS classes on the svg element
|
* CSS classes on the svg element
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Magnify / search icon (Lucide).
|
* Magnify / search icon (Lucide).
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { cn } from '$shared/lib';
|
|||||||
import { Button } from '$shared/ui/Button';
|
import { Button } from '$shared/ui/Button';
|
||||||
import { Modal, type ModalHandle } from '$shared/ui/Modal';
|
import { Modal, type ModalHandle } from '$shared/ui/Modal';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Image source URL
|
* Image source URL
|
||||||
*/
|
*/
|
||||||
@@ -33,7 +33,7 @@ type Props = {
|
|||||||
* @default '(min-width: 1024px) 56rem, 100vw'
|
* @default '(min-width: 1024px) 56rem, 100vw'
|
||||||
*/
|
*/
|
||||||
sizes?: string;
|
sizes?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clickable image thumbnail that opens a fullscreen brutalist dialog on click.
|
* Clickable image thumbnail that opens a fullscreen brutalist dialog on click.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import parse from 'html-react-parser';
|
import parse from 'html-react-parser';
|
||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* SVG markup string to inline as React elements
|
* SVG markup string to inline as React elements
|
||||||
*/
|
*/
|
||||||
@@ -10,7 +10,7 @@ type Props = {
|
|||||||
* Additional CSS classes on the wrapper span
|
* Additional CSS classes on the wrapper span
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses an SVG markup string into React elements.
|
* Parses an SVG markup string into React elements.
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ export type ModalHandle = {
|
|||||||
close: () => void;
|
close: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = DialogHTMLAttributes<HTMLDialogElement> & {
|
export interface Props extends DialogHTMLAttributes<HTMLDialogElement> {
|
||||||
/**
|
/**
|
||||||
* Called when the user activates the backdrop (click or Enter/Space).
|
* Called when the user activates the backdrop (click or Enter/Space).
|
||||||
* Replaces the default close — useful when the close path must be wrapped
|
* Replaces the default close — useful when the close path must be wrapped
|
||||||
* (e.g. in a view transition). When omitted, the dialog closes itself.
|
* (e.g. in a view transition). When omitted, the dialog closes itself.
|
||||||
*/
|
*/
|
||||||
onBackdropClose?: () => void;
|
onBackdropClose?: () => void;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thin wrapper over native `<dialog>` with `showModal()`. Locks body scroll
|
* Thin wrapper over native `<dialog>` with `showModal()`. Locks body scroll
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import parse from 'html-react-parser';
|
import parse from 'html-react-parser';
|
||||||
import { cn } from '$shared/lib';
|
import { cn } from '$shared/lib';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* HTML string from PocketBase rich-text editor
|
* HTML string from PocketBase rich-text editor
|
||||||
*/
|
*/
|
||||||
@@ -10,7 +10,7 @@ type Props = {
|
|||||||
* Additional CSS classes merged onto the wrapper div
|
* Additional CSS classes merged onto the wrapper div
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders a PocketBase rich-text HTML string as React elements.
|
* Renders a PocketBase rich-text HTML string as React elements.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Fragment, type ReactNode, ViewTransition as VT } from 'react';
|
|||||||
*/
|
*/
|
||||||
const Transition = (VT ?? Fragment) as typeof VT;
|
const Transition = (VT ?? Fragment) as typeof VT;
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Maps to the view-transition-name CSS property
|
* Maps to the view-transition-name CSS property
|
||||||
*/
|
*/
|
||||||
@@ -15,7 +15,7 @@ type Props = {
|
|||||||
* Content to animate
|
* Content to animate
|
||||||
*/
|
*/
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps children in React's ViewTransition when available,
|
* Wraps children in React's ViewTransition when available,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
import type { ErrorInfo, ReactNode } from 'react';
|
import type { ErrorInfo, ReactNode } from 'react';
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Section content to render
|
* Section content to render
|
||||||
*/
|
*/
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
}
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Children } from 'react';
|
|||||||
import type { SectionRecord } from '$entities/Section';
|
import type { SectionRecord } from '$entities/Section';
|
||||||
import { SectionAccordion } from '$entities/Section';
|
import { SectionAccordion } from '$entities/Section';
|
||||||
|
|
||||||
type Props = {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* Ordered section metadata — drives navigation labels and IDs
|
* Ordered section metadata — drives navigation labels and IDs
|
||||||
*/
|
*/
|
||||||
@@ -17,7 +17,7 @@ type Props = {
|
|||||||
* Pre-rendered RSC content slots, one per section, matched by index
|
* Pre-rendered RSC content slots, one per section, matched by index
|
||||||
*/
|
*/
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders all portfolio sections as an accordion list.
|
* Renders all portfolio sections as an accordion list.
|
||||||
|
|||||||
Reference in New Issue
Block a user