wrapper
This commit is contained in:
parent
502acf04e5
commit
d692200d4f
3 changed files with 80 additions and 60 deletions
|
|
@ -54,8 +54,7 @@ export const RenderBlocks: React.FC<{
|
|||
|
||||
if (Block) {
|
||||
return (
|
||||
<div className="my-16" key={index}>
|
||||
{/* @ts-expect-error there may be some mismatch between the expected types here */}
|
||||
<div key={index}>
|
||||
<Block {...block} disableInnerContainer />
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
9
src/components/ui/Container.tsx
Normal file
9
src/components/ui/Container.tsx
Normal file
|
|
@ -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 <div className={`mx-auto w-full max-w-[1200px] px-8 ${className}`}>{children}</div>
|
||||
}
|
||||
|
|
@ -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,11 +19,15 @@ export const SplitHero: React.FC<SplitHeroProps> = function (props) {
|
|||
const hasImage = splitImage && typeof splitImage === 'object' && splitImage.url
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 border-b border-foreground/8">
|
||||
<div className="border-b border-foreground/8">
|
||||
<Container className="px-0">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2">
|
||||
<div className="flex flex-col justify-between gap-8 px-8 py-14 md:border-r border-foreground/8">
|
||||
<div>
|
||||
{eyebrow && (
|
||||
<p className="text-xs tracking-widest uppercase text-foreground/30 mb-5">{eyebrow}</p>
|
||||
<p className="text-xs tracking-widest uppercase text-foreground/30 mb-5">
|
||||
{eyebrow}
|
||||
</p>
|
||||
)}
|
||||
{heading && (
|
||||
<h1 className="text-4xl font-medium text-foreground leading-[1.1] mb-4 whitespace-pre-line">
|
||||
|
|
@ -30,7 +35,9 @@ export const SplitHero: React.FC<SplitHeroProps> = function (props) {
|
|||
</h1>
|
||||
)}
|
||||
{subtext && (
|
||||
<p className="text-sm text-foreground/50 leading-relaxed max-w-sm mb-6">{subtext}</p>
|
||||
<p className="text-sm text-foreground/50 leading-relaxed max-w-sm mb-6">
|
||||
{subtext}
|
||||
</p>
|
||||
)}
|
||||
{Array.isArray(tags) && tags.length > 0 && (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
|
|
@ -68,11 +75,14 @@ export const SplitHero: React.FC<SplitHeroProps> = function (props) {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-muted/30 flex items-center justify-center min-h-[260px]">
|
||||
<div className="bg-muted/30 flex items-center justify-center min-h-[320px] relative overflow-hidden">
|
||||
{hasImage ? (
|
||||
<div className="relative w-full h-full min-h-[260px]">
|
||||
<Image src={splitImage.url!} alt={splitImage.alt ?? ''} fill className="object-cover" />
|
||||
</div>
|
||||
<Image
|
||||
src={splitImage.url!}
|
||||
alt={splitImage.alt ?? ''}
|
||||
fill
|
||||
className="object-cover object-top"
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center gap-2 opacity-20">
|
||||
<i className="ti ti-user" style={{ fontSize: 48 }} aria-hidden="true" />
|
||||
|
|
@ -80,5 +90,7 @@ export const SplitHero: React.FC<SplitHeroProps> = function (props) {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue