@@ -2,43 +2,10 @@ import type { PortableTextBlock } from '@portabletext/types'
22import { forwardRef , type HTMLAttributes } from 'react'
33import { twMerge } from 'tailwind-merge'
44import { urlForImage } from '@/sanity/lib/utils'
5- import Blocks , { type MarkType } from '../../portableText/Blocks'
6- import isEmpty from '../../portableText/helpers/isEmpty'
5+ import { CampaignBannerTitle } from './CampaignBannerTitle'
76import { colorKeyToUtilityMap } from '../../styles/colorKeyToUtilityMap'
87import type { CampaignBannerData } from '../../types/index'
98
10- /* eslint-disable @typescript-eslint/ban-ts-comment */
11- const campaignTitleBlocks : MarkType = {
12- //@ts -ignore
13- smallText : ( { children } : PortableTextBlock ) => (
14- < p className = 'text-sm' > { < > { children } </ > } </ p >
15- ) ,
16- //@ts -ignore
17- largeText : ( { children } : PortableTextBlock ) => (
18- < p className = 'block w-fit text-balance rounded-xs bg-white-100 text-2xl leading-none' >
19- { < > { children } </ > }
20- </ p >
21- ) ,
22- //@ts -ignore
23- extraLargeText : ( { children } : PortableTextBlock ) => {
24- return (
25- < p className = 'mt-4 block w-fit text-balance rounded-xs bg-white-100 font-semibold text-4xl leading-none lg:text-8xl' >
26- { < > { children } </ > }
27- </ p >
28- )
29- } ,
30- //@ts -ignore
31- normal : ( { children } : PortableTextBlock ) => {
32- if ( isEmpty ( children ) ) return null
33- return (
34- < p >
35- < > { children } </ >
36- </ p >
37- )
38- } ,
39- }
40- /* eslint-enable @typescript-eslint/ban-ts-comment */
41-
429export type CampaignBannerProps = {
4310 data : CampaignBannerData
4411 className ?: string
@@ -89,10 +56,9 @@ const CampaignBanner = forwardRef<HTMLElement, CampaignBannerProps>(
8956 < div className = { `mx-auto px-layout-md` } >
9057 < div className = 'flex justify-start' >
9158 < h2 className = '' >
92- < Blocks
59+ < CampaignBannerTitle
9360 value = { title }
9461 blockClassName = 'my-0 text-energy-red-100'
95- blocksComponents = { campaignTitleBlocks }
9662 className = 'w-fit max-w-prose text-energy-red-100'
9763 />
9864 </ h2 >
0 commit comments