1
- import { Box , Heading , Stack , Text } from "@chakra-ui/react"
2
-
3
1
import type { CommonHeroProps } from "@/lib/types"
4
2
5
3
import { CallToAction } from "@/components/Hero/CallToAction"
6
- import { Image } from "@/components/Image"
4
+ import { TwImage } from "@/components/Image"
5
+ import { Stack } from "@/components/ui/flex"
6
+
7
+ import { cn } from "@/lib/utils/cn"
7
8
8
9
export type HubHeroProps = Omit < CommonHeroProps , "breadcrumbs" | "blurDataURL" >
9
10
@@ -21,72 +22,56 @@ const HubHero = ({
21
22
}
22
23
23
24
return (
24
- < Box position = "relative" >
25
- < Image
25
+ < div className = "relative" >
26
+ < TwImage
26
27
src = { heroImg }
27
28
alt = ""
28
29
priority
29
30
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
30
31
sizes = "(max-width: 1504px) 100vw, 1504px"
31
32
style = { { width : "100vw" , objectFit : "cover" } }
32
- h = { {
33
- base : "192px" ,
34
- md : "256px" ,
35
- lg : "320px" ,
36
- xl : "576px" ,
37
- "2xl" : "672px" ,
38
- } }
33
+ className = "h-[192px] w-screen object-cover md:h-[256px] lg:h-[320px] xl:h-[576px] 2xl:h-[672px]"
39
34
/>
40
35
< Stack
41
- spacing = "4"
42
- p = { { base : "4" , lg : "8" } }
43
- textAlign = { { base : "center" , xl : "start" } }
44
- borderRadius = { { xl : "base" } }
45
- bg = { { xl : "hubHeroContentBg" } }
46
- position = { { xl : "absolute" } }
47
- maxW = { { xl : "sm" } }
48
- top = { { xl : "50%" } }
49
- transform = { { xl : "translateY(-50%)" } }
50
- backdropFilter = { { xl : "auto" } }
51
- backdropBlur = { { xl : "base" } }
52
- wordBreak = "break-word"
53
- sx = { {
54
- "inset-inline-start" : { xl : "32px" } ,
55
- } }
36
+ className = { cn (
37
+ "gap-4 p-4 lg:p-8" ,
38
+ "text-center xl:text-start" ,
39
+ "xl:rounded" ,
40
+ "xl:bg-hub-hero-content-bg" ,
41
+ "xl:absolute xl:top-1/2 xl:max-w-sm" ,
42
+ "xl:-translate-y-1/2 xl:transform" ,
43
+ "xl:backdrop-blur xl:backdrop-filter" ,
44
+ "break-words" ,
45
+ "xl:start-[32px]"
46
+ ) }
56
47
>
57
48
{ title ? (
58
- < Text
59
- as = "h1"
60
- size = "md"
61
- color = "body.medium"
62
- fontWeight = "normal"
63
- textTransform = "uppercase"
64
- >
49
+ < h1 className = "text-md font-normal uppercase text-body-medium" >
65
50
{ title }
66
- </ Text >
51
+ </ h1 >
67
52
) : null }
68
- < Stack
69
- alignSelf = "center"
70
- spacing = { { base : "2" , md : "1" } }
71
- maxW = "container.md"
72
- >
73
- < Heading as = { title ? "h2" : "h1" } size = "2xl" >
74
- { header }
75
- </ Heading >
76
- < Text size = "lg" > { description } </ Text >
53
+ < Stack className = "max-w-screen-md gap-2 self-center md:gap-1" >
54
+ { title ? (
55
+ < h2 className = "text-4xl lg:text-5xl" > { header } </ h2 >
56
+ ) : (
57
+ < h1 className = "text-4xl lg:text-5xl" > { header } </ h1 >
58
+ ) }
59
+
60
+ < p className = "text-lg" > { description } </ p >
77
61
</ Stack >
78
62
< Stack
79
- direction = { { base : "column" , md : "row" } }
80
- justify = { { md : "center" , xl : "start" } }
81
- spacing = "4"
63
+ className = { cn (
64
+ "flex-col gap-4 md:flex-row" ,
65
+ "md:justify-center xl:justify-start"
66
+ ) }
82
67
>
83
68
{ buttons ?. map ( ( button , idx ) => {
84
69
if ( ! button ) return
85
70
return < CallToAction key = { idx } index = { idx } { ...button } />
86
71
} ) }
87
72
</ Stack >
88
73
</ Stack >
89
- </ Box >
74
+ </ div >
90
75
)
91
76
}
92
77
0 commit comments