1
- import { Box , Heading , SimpleGrid , Stack , Text } from "@chakra-ui/react"
2
-
3
1
import type { CommonHeroProps } from "@/lib/types"
4
2
5
3
import Breadcrumbs from "@/components/Breadcrumbs"
6
- import { Image } from "@/components/Image"
4
+ import { TwImage } from "@/components/Image"
5
+ import { Stack } from "@/components/ui/flex"
7
6
8
7
import { CallToAction } from "../CallToAction"
9
8
10
9
export type ContentHeroProps = Omit < CommonHeroProps < string > , "header" >
11
10
12
11
const ContentHero = ( props : ContentHeroProps ) => {
13
- const {
14
- breadcrumbs,
15
- heroImg,
16
- buttons,
17
- title,
18
- description,
19
- blurDataURL,
20
- maxHeight,
21
- } = props
12
+ const { breadcrumbs, heroImg, buttons, title, description, blurDataURL } =
13
+ props
22
14
return (
23
- < Box bgImg = "bgMainGradient" >
24
- < SimpleGrid
25
- columns = { { base : 1 , lg : 2 } }
26
- maxW = "1536px"
27
- mx = "auto"
28
- alignItems = "center"
29
- >
30
- < Box
31
- order = { { lg : 1 } }
32
- py = { { base : 0 , lg : 12 } }
33
- height = { {
34
- base : "300px" ,
35
- md : "400px" ,
36
- lg : maxHeight ? maxHeight : "full" ,
37
- } }
38
- >
39
- < Image
15
+ < div className = "bg-gradient-main" >
16
+ < div className = "mx-auto grid max-w-screen-2xl grid-cols-1 items-center lg:grid-cols-2" >
17
+ < div className = "h-[300px] md:h-[400px] lg:order-1 lg:h-full lg:py-12" >
18
+ < TwImage
19
+ className = "box h-full max-h-[451px] w-full flex-auto object-contain md:flex-none"
40
20
src = { heroImg }
41
21
alt = ""
42
22
priority
@@ -45,25 +25,19 @@ const ContentHero = (props: ContentHeroProps) => {
45
25
height = { 451 }
46
26
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
47
27
sizes = "(max-width: 992px) 100vw, 760px"
48
- boxSize = "full"
49
- style = { { objectFit : "contain" } }
50
- flex = { { base : "1 1 100%" , md : "none" } }
51
- maxHeight = { 451 }
52
28
/>
53
- </ Box >
54
- < Stack p = { { base : "8" , lg : "16" } } spacing = "9" justify = "center ">
29
+ </ div >
30
+ < Stack className = "justify-center gap-9 p-8 lg:p-16 ">
55
31
< Breadcrumbs { ...breadcrumbs } />
56
- < Stack spacing = "6" >
57
- < Heading as = "h1" size = "2xl" >
58
- { title }
59
- </ Heading >
32
+ < Stack className = "gap-6" >
33
+ < h1 > { title } </ h1 >
60
34
{ typeof description === "string" ? (
61
- < Text fontSize = " lg"> { description } </ Text >
35
+ < p className = "text- lg"> { description } </ p >
62
36
) : (
63
37
description
64
38
) }
65
39
{ buttons && (
66
- < Stack direction = { { base : "column" , md : " row" } } spacing = "4 ">
40
+ < Stack className = "flex-col gap-4 md:flex- row">
67
41
{ buttons . map ( ( button , idx ) => {
68
42
if ( ! button ) return
69
43
return < CallToAction key = { idx } index = { idx } { ...button } />
@@ -75,8 +49,8 @@ const ContentHero = (props: ContentHeroProps) => {
75
49
* Add conditional Big Stat box here
76
50
*/ }
77
51
</ Stack >
78
- </ SimpleGrid >
79
- </ Box >
52
+ </ div >
53
+ </ div >
80
54
)
81
55
}
82
56
0 commit comments