Show product subline on cards/cart/PDP hero; brand-color trailing period
Follows Products.subline (docker/payload commit ad7156e). Cards and cart line items showed nothing but the bare name — added the subline under it. der-eine and todo-cards' hero taglines were hardcoded copy nearly identical to this new field — switched both to read subline instead, so future edits go through the CMS. Also adds a shared ProductName component: every hand-written PDP headline already styled a trailing "." in brand color, but the few places that render product.name as plain text (cards, cart, the Payload-driven tasse-die-pause hero) had silently lost that styling. Centralizes it so it can't drift per call site again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1Hu5bZ1kZUgKhab6yNwCt
This commit is contained in:
@@ -6,6 +6,7 @@ const product = (overrides: Partial<Product> = {}): Product => ({
|
||||
id: "todo-karten",
|
||||
numericId: 1,
|
||||
name: "ToDo-Karten",
|
||||
subline: null,
|
||||
description: null,
|
||||
descriptionText: "",
|
||||
sku: null,
|
||||
|
||||
@@ -181,6 +181,9 @@ export type Product = {
|
||||
// slug-based call site.
|
||||
numericId: number;
|
||||
name: string;
|
||||
// Short tagline shown under the name on cards/cart/PDP hero — see
|
||||
// Products.ts's own field comment. null/"" means show nothing extra.
|
||||
subline: string | null;
|
||||
// Raw Lexical richText JSON — rendered formatted (bold/italic/multiple
|
||||
// paragraphs) on the PDP via the shared <RichText> component. Plain-text
|
||||
// consumers (Passend-dazu cards, JSON-LD) use `descriptionText` below
|
||||
@@ -271,6 +274,7 @@ export type Product = {
|
||||
type PayloadProduct = {
|
||||
id: number;
|
||||
name: string;
|
||||
subline: string | null;
|
||||
slug: string;
|
||||
description: unknown | null;
|
||||
sku: string | null;
|
||||
@@ -356,6 +360,7 @@ export function mapPayloadProduct(product: PayloadProduct): Product {
|
||||
id: product.slug,
|
||||
numericId: product.id,
|
||||
name: product.name,
|
||||
subline: product.subline || null,
|
||||
description: product.description ?? null,
|
||||
descriptionText: extractPlainText(descriptionRoot),
|
||||
sku: product.sku || null,
|
||||
|
||||
Reference in New Issue
Block a user