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
4
import { Image } 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,7 +22,7 @@ const HubHero = ({
21
22
}
22
23
23
24
return (
24
- < Box position = "relative" >
25
+ < div className = "relative" >
25
26
< Image
26
27
src = { heroImg }
27
28
alt = ""
@@ -38,55 +39,53 @@ const HubHero = ({
38
39
} }
39
40
/>
40
41
< 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
- } }
42
+ // spacing :: used space-y as considering it to be column
43
+ className = { cn (
44
+ "gap-0 space-y-4 p-4 lg:p-8" ,
45
+ "text-center xl:text-start" ,
46
+ "xl:rounded" ,
47
+ "xl:bg-[#222222cc]" ,
48
+ "xl:absolute xl:top-1/2 xl:max-w-sm" ,
49
+ "xl:-translate-y-1/2 xl:transform" ,
50
+ "xl:backdrop-blur xl:backdrop-filter" ,
51
+ "break-words" ,
52
+ "xl:start-[32px]"
53
+ ) }
56
54
>
57
55
{ title ? (
58
- < Text
59
- as = "h1"
60
- size = "md"
61
- color = "body.medium"
62
- fontWeight = "normal"
63
- textTransform = "uppercase"
64
- >
56
+ < h1 className = "text-md font-normal uppercase text-body-medium" >
65
57
{ title }
66
- </ Text >
58
+ </ h1 >
67
59
) : null }
68
60
< Stack
69
- alignSelf = "center"
70
- spacing = { { base : "2" , md : "1" } }
71
- maxW = "container.md"
61
+ // TODO: Spacings on @chakra Stack behaves differently on different screen sizes
62
+ // spacing :: used space-y as considering it to be column
63
+ // --eth-sizes-container-md: 768px ==> tailwind max-w-3xl
64
+ className = "max-w-3xl gap-0 space-y-2 self-center md:space-y-1"
72
65
>
73
- < Heading as = { title ? "h2" : "h1" } size = "2xl" >
74
- { header }
75
- </ Heading >
76
- < Text size = "lg" > { description } </ Text >
66
+ { title ? (
67
+ < h2 className = "text-4xl lg:text-5xl" > { header } </ h2 >
68
+ ) : (
69
+ < h1 className = "text-4xl lg:text-5xl" > { header } </ h1 >
70
+ ) }
71
+
72
+ < p className = "text-lg" > { description } </ p >
77
73
</ Stack >
78
74
< Stack
79
- direction = { { base : "column" , md : "row" } }
80
- justify = { { md : "center" , xl : "start" } }
81
- spacing = "4"
75
+ className = { cn (
76
+ "h-fit flex-col gap-0 md:flex-row" ,
77
+ "md:justify-center xl:justify-start" ,
78
+ // spacing :: used space-y & x as considering it to be sm:column md:row
79
+ "space-y-4 md:space-x-4 md:space-y-0"
80
+ ) }
82
81
>
83
82
{ buttons ?. map ( ( button , idx ) => {
84
83
if ( ! button ) return
85
84
return < CallToAction key = { idx } index = { idx } { ...button } />
86
85
} ) }
87
86
</ Stack >
88
87
</ Stack >
89
- </ Box >
88
+ </ div >
90
89
)
91
90
}
92
91
0 commit comments