@@ -4,58 +4,60 @@ import type { CommonHeroProps } from "@/lib/types"
4
4
5
5
import Breadcrumbs from "@/components/Breadcrumbs"
6
6
import { Image } from "@/components/Image"
7
- import { Stack } from "@/components/ui/flex"
7
+
8
+ import { breakpointAsNumber , screens } from "@/lib/utils/screen"
8
9
9
10
import { CallToAction } from "../CallToAction"
10
11
11
- export type ContentHeroProps = Omit < CommonHeroProps < string > , "header" >
12
+ export type ContentHeroProps = Omit <
13
+ CommonHeroProps ,
14
+ "header" | "blurDataURL"
15
+ > & {
16
+ blurDataURL ?: CommonHeroProps [ "blurDataURL" ]
17
+ }
12
18
13
19
const ContentHero = ( props : ContentHeroProps ) => {
14
20
const { breadcrumbs, heroImg, buttons, title, description, blurDataURL } =
15
21
props
22
+ if ( blurDataURL ) heroImg . blurDataURL = blurDataURL
23
+
16
24
return (
17
- < div className = "bg-gradient-main" >
18
- < div className = "mx-auto grid max-w-screen-2xl grid-cols-1 items-center lg:grid-cols-2" >
19
- < div className = "h-[300px] md:h-[400px] lg:order-1 lg:h-full" >
20
- < Image
21
- className = "box h-full max-h-[451px] w-full flex-auto object-contain md:flex-none"
22
- src = { heroImg }
23
- alt = ""
24
- priority
25
- blurDataURL = { blurDataURL }
26
- width = { 760 }
27
- height = { 451 }
28
- // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
29
- sizes = "(max-width: 992px) 100vw, 760px"
30
- />
25
+ < div className = "mx-auto grid w-full max-w-screen-2xl grid-cols-1 items-center border-b pb-16 lg:grid-cols-2" >
26
+ < div className = "flex h-[300px] items-center justify-center md:h-[400px] lg:col-start-2 lg:h-full" >
27
+ < Image
28
+ className = "my-auto h-full max-h-[479px] w-full flex-auto object-contain md:flex-none"
29
+ src = { heroImg }
30
+ alt = ""
31
+ priority
32
+ sizes = { `(max-width: ${ screens . lg } ) 100vw, ${ breakpointAsNumber [ "2xl" ] / 2 } px` }
33
+ />
34
+ </ div >
35
+ < div className = "flex h-full flex-col gap-9 p-8 lg:col-start-1 lg:row-start-1 lg:px-11 lg:py-16" >
36
+ < Breadcrumbs { ...breadcrumbs } />
37
+ < div className = "flex flex-col gap-6" >
38
+ < h1 className = "text-4xl font-black lg:text-7xl" > { title } </ h1 >
39
+ { typeof description === "string" ? (
40
+ < p className = "text-lg" > { description } </ p >
41
+ ) : (
42
+ description
43
+ ) }
44
+ { buttons && (
45
+ < div className = "flex flex-col gap-4 md:flex-row" >
46
+ { buttons . map ( ( button , idx ) => {
47
+ if ( ! button ) return
48
+ // If it's a React element, render it directly
49
+ if ( typeof button === "object" && "type" in button ) {
50
+ return < div key = { idx } > { button as ReactElement } </ div >
51
+ }
52
+ // Otherwise, render as button props
53
+ return < CallToAction key = { idx } index = { idx } { ...button } />
54
+ } ) }
55
+ </ div >
56
+ ) }
31
57
</ div >
32
- < Stack className = "justify-center gap-9 p-8 lg:p-16" >
33
- < Breadcrumbs { ...breadcrumbs } />
34
- < Stack className = "gap-6" >
35
- < h1 > { title } </ h1 >
36
- { typeof description === "string" ? (
37
- < p className = "text-lg" > { description } </ p >
38
- ) : (
39
- description
40
- ) }
41
- { buttons && (
42
- < Stack className = "flex-col gap-4 md:flex-row" >
43
- { buttons . map ( ( button , idx ) => {
44
- if ( ! button ) return
45
- // If it's a React element, render it directly
46
- if ( typeof button === "object" && "type" in button ) {
47
- return < div key = { idx } > { button as ReactElement } </ div >
48
- }
49
- // Otherwise, render as button props
50
- return < CallToAction key = { idx } index = { idx } { ...button } />
51
- } ) }
52
- </ Stack >
53
- ) }
54
- </ Stack >
55
- { /* TODO:
56
- * Add conditional Big Stat box here
57
- */ }
58
- </ Stack >
58
+ { /* TODO:
59
+ * Add conditional Big Stat box here
60
+ */ }
59
61
</ div >
60
62
</ div >
61
63
)
0 commit comments