From d692200d4f5dbe47651a424ff887fd6efe6b6c60 Mon Sep 17 00:00:00 2001 From: Mackie Date: Wed, 3 Jun 2026 22:40:49 +0800 Subject: [PATCH] wrapper --- src/blocks/RenderBlocks.tsx | 3 +- src/components/ui/Container.tsx | 9 +++ src/heros/SplitHero/index.tsx | 128 +++++++++++++++++--------------- 3 files changed, 80 insertions(+), 60 deletions(-) create mode 100644 src/components/ui/Container.tsx diff --git a/src/blocks/RenderBlocks.tsx b/src/blocks/RenderBlocks.tsx index a872772..bddd5f8 100644 --- a/src/blocks/RenderBlocks.tsx +++ b/src/blocks/RenderBlocks.tsx @@ -54,8 +54,7 @@ export const RenderBlocks: React.FC<{ if (Block) { return ( -
- {/* @ts-expect-error there may be some mismatch between the expected types here */} +
) diff --git a/src/components/ui/Container.tsx b/src/components/ui/Container.tsx new file mode 100644 index 0000000..5a1a628 --- /dev/null +++ b/src/components/ui/Container.tsx @@ -0,0 +1,9 @@ +// components/ui/Container.tsx +import React from 'react' + +export const Container: React.FC<{ children: React.ReactNode; className?: string }> = ({ + children, + className = '', +}) => { + return
{children}
+} diff --git a/src/heros/SplitHero/index.tsx b/src/heros/SplitHero/index.tsx index 3ffcbb9..14b6271 100644 --- a/src/heros/SplitHero/index.tsx +++ b/src/heros/SplitHero/index.tsx @@ -1,5 +1,6 @@ import React from 'react' import Image from 'next/image' +import { Container } from '@/components/ui/Container' import type { Page } from '@/payload-types' import type { Media as MediaType } from '@/payload-types' @@ -18,67 +19,78 @@ export const SplitHero: React.FC = function (props) { const hasImage = splitImage && typeof splitImage === 'object' && splitImage.url return ( -
-
-
- {eyebrow && ( -

{eyebrow}

- )} - {heading && ( -

- {heading} -

- )} - {subtext && ( -

{subtext}

- )} - {Array.isArray(tags) && tags.length > 0 && ( -
- {tags.map(function ({ tag }, i) { - return ( - - {tag} - - ) - })} +
+ +
+
+
+ {eyebrow && ( +

+ {eyebrow} +

+ )} + {heading && ( +

+ {heading} +

+ )} + {subtext && ( +

+ {subtext} +

+ )} + {Array.isArray(tags) && tags.length > 0 && ( +
+ {tags.map(function ({ tag }, i) { + return ( + + {tag} + + ) + })} +
+ )} +
+
+ {primaryCta && primaryCta.label && primaryCta.url && ( + +