From e35bf96cb290ec92f675042ff91b1c0b59df9b8a Mon Sep 17 00:00:00 2001 From: rchlfryn Date: Sat, 28 Feb 2026 09:44:00 -0800 Subject: [PATCH 1/5] Remove unused payload prop --- src/blocks/RenderBlocks.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blocks/RenderBlocks.tsx b/src/blocks/RenderBlocks.tsx index 12d9550b3..e7786eb1f 100644 --- a/src/blocks/RenderBlocks.tsx +++ b/src/blocks/RenderBlocks.tsx @@ -32,7 +32,7 @@ export const RenderBlocks = (props: { blocks: Page['layout'][0][]; payload: Payl {blocks.map((block) => { return (
- +
) })} @@ -43,7 +43,7 @@ export const RenderBlocks = (props: { blocks: Page['layout'][0][]; payload: Payl return null } -export const RenderBlock = ({ block, payload }: { block: Page['layout'][0]; payload: Payload }) => { +export const RenderBlock = ({ block }: { block: Page['layout'][0] }) => { const { blockType } = block // if a block has two variants - to make TS happy we fallback to the default for the block variant switch (blockType) { From 3525001fa4246e5d9f1c7e6ad95ddb38ce82e17d Mon Sep 17 00:00:00 2001 From: rchlfryn Date: Sat, 28 Feb 2026 10:01:06 -0800 Subject: [PATCH 2/5] Change isLexical to isLayoutBlock --- docs/coding-guide.md | 14 +++++++------- src/blocks/BlogList/Component.tsx | 6 +++--- src/blocks/Document/Component.tsx | 6 +++--- src/blocks/EventList/Component.tsx | 6 +++--- src/blocks/EventTable/Component.tsx | 6 +++--- src/blocks/Form/Component.tsx | 6 +++--- src/blocks/GenericEmbed/Component.tsx | 6 +++--- src/blocks/Header/Component.tsx | 8 ++++---- src/blocks/Media/Component.tsx | 6 +++--- src/blocks/RenderBlocks.tsx | 20 ++++++++++---------- src/blocks/SingleBlogPost/Component.tsx | 6 +++--- src/blocks/SingleEvent/Component.tsx | 6 +++--- src/blocks/Sponsors/components/index.tsx | 6 +++--- src/components/BackgroundColorWrapper.tsx | 6 +++--- src/components/Footer/Footer.tsx | 4 ++-- src/components/RichText/index.tsx | 22 ++++++++++++---------- 16 files changed, 68 insertions(+), 66 deletions(-) diff --git a/docs/coding-guide.md b/docs/coding-guide.md index f9bdbbe02..d71b84bde 100644 --- a/docs/coding-guide.md +++ b/docs/coding-guide.md @@ -181,10 +181,10 @@ blocks When creating a new block, you must register it in the following locations: 1. **`src/blocks/RenderBlocks.tsx`** - For standalone page blocks - - Set `isLexical={false}` + - Set `isLayoutBlock={false}` 2. **`src/components/RichText/index.tsx`** - For blocks used inline within rich text editors - - Set `isLexical={true}` to avoid double-wrapping + - Set `isLayoutBlock={true}` to avoid double-wrapping - Only add blocks that should be available in Lexical editors 3. **`src/constants/defaults.ts`** - Add the block to the defaults configuration @@ -194,9 +194,9 @@ When creating a new block, you must register it in the following locations: - A `richText` field's `BlocksFeature` configuration - This ensures Payload generates TypeScript types for your block -**Why the different `isLexical` values?** -- Standalone blocks (`RenderBlocks.tsx`) are not rendered by a Lexical editor → `isLexical={false}` -- Inline Lexical blocks (`RichText/index.tsx`) are rendered inside a Lexical editor → `isLexical={true}` +**Why the different `isLayoutBlock` values?** +- Standalone blocks (`RenderBlocks.tsx`) are not rendered by a Lexical editor → `isLayoutBlock={false}` +- Inline Lexical blocks (`RichText/index.tsx`) are rendered inside a Lexical editor → `isLayoutBlock={true}` ### BackgroundColorWrapper @@ -205,7 +205,7 @@ A reusable layout component that wraps content with configurable background colo **Props:** - `backgroundColor` - Tailwind background color class name -- `isLexical` - Whether the block is rendered within a Lexical editor (`default: false`) +- `isLayoutBlock` - Whether the block is rendered within a Lexical editor (`default: false`) - `containerClassName` - Optional - additional classes for the inner container div - `outerClassName` - Optional - additional classes for the outer wrapper div @@ -213,7 +213,7 @@ A reusable layout component that wraps content with configurable background colo ```tsx diff --git a/src/blocks/BlogList/Component.tsx b/src/blocks/BlogList/Component.tsx index c6d45ea70..569a2883d 100644 --- a/src/blocks/BlogList/Component.tsx +++ b/src/blocks/BlogList/Component.tsx @@ -14,7 +14,7 @@ import { cn } from '@/utilities/ui' import { useEffect, useState } from 'react' type BlogListComponentProps = BlogListBlockProps & { - isLexical: boolean + isLayoutBlock: boolean className?: string } @@ -24,7 +24,7 @@ export const BlogListBlockComponent = (args: BlogListComponentProps) => { belowHeadingContent, backgroundColor, className, - isLexical = true, + isLayoutBlock = true, postOptions, } = args @@ -91,7 +91,7 @@ export const BlogListBlockComponent = (args: BlogListComponentProps) => { return (
diff --git a/src/blocks/Document/Component.tsx b/src/blocks/Document/Component.tsx index 3c5ec51e6..219161e50 100644 --- a/src/blocks/Document/Component.tsx +++ b/src/blocks/Document/Component.tsx @@ -7,11 +7,11 @@ import { getHostnameFromTenant } from '@/utilities/tenancy/getHostnameFromTenant import { cn } from '@/utilities/ui' type Props = DocumentBlockProps & { - isLexical: boolean + isLayoutBlock: boolean } export const DocumentBlockComponent = (props: Props) => { - const { document, isLexical = true } = props + const { document, isLayoutBlock = true } = props const { tenant } = useTenant() if (!isValidRelationship(document) || !document.url) { @@ -21,7 +21,7 @@ export const DocumentBlockComponent = (props: Props) => { const src = getMediaURL(document.url, null, getHostnameFromTenant(tenant)) return ( -
+