1
1
import { MdInfoOutline } from "react-icons/md"
2
- import { Box , Icon } from "@chakra-ui/react"
3
2
import { Meta , StoryObj } from "@storybook/react"
4
3
5
- import { Image } from "@/components/Image"
4
+ import { ChildOnlyProp } from "@/lib/types"
5
+
6
+ import { TwImage } from "@/components/Image"
6
7
import InlineLink from "@/components/Link"
7
- import Text from "@/components/OldText"
8
8
import Tooltip from "@/components/Tooltip"
9
9
10
10
import { getTranslation } from "@/storybook-utils"
11
11
12
12
import { langViewportModes } from "../../../.storybook/modes"
13
13
import { ContentContainer } from "../MdComponents"
14
+ import { TooltipProvider } from "../ui/tooltip"
14
15
15
16
import {
16
17
Banner as BannerComponent ,
@@ -35,11 +36,13 @@ const meta = {
35
36
} ,
36
37
decorators : [
37
38
( Story ) => (
38
- < Box position = "relative" w = " full">
39
+ < div className = "relative w- full" >
39
40
< ContentContainer >
40
- < Story />
41
+ < TooltipProvider >
42
+ < Story />
43
+ </ TooltipProvider >
41
44
</ ContentContainer >
42
- </ Box >
45
+ </ div >
43
46
) ,
44
47
] ,
45
48
} satisfies Meta < typeof BannerComponent >
@@ -59,13 +62,19 @@ const tooltipContent = ({ apiUrl, apiProvider, ariaLabel }) => (
59
62
</ div >
60
63
)
61
64
65
+ const StatPrimary = ( props : ChildOnlyProp ) => (
66
+ < div className = "mb-4 text-5xl leading-none" { ...props } />
67
+ )
68
+
69
+ const StatDescription = ( props : ChildOnlyProp ) => (
70
+ < div className = "text-md text-[#666] dark:text-[#b2b2b2]" { ...props } />
71
+ )
72
+
62
73
export const Banner : Story = {
63
74
render : ( ) => {
64
75
return (
65
76
< BannerComponent >
66
- < Box fontSize = "md" color = "text200" >
67
- Banner
68
- </ Box >
77
+ < div className = "text-md text-[#666] dark:text-[#b2b2b2]" > Banner</ div >
69
78
</ BannerComponent >
70
79
)
71
80
} ,
@@ -76,9 +85,9 @@ export const BannerBody: Story = {
76
85
return (
77
86
< BannerComponent >
78
87
< BannerBodyComponent >
79
- < Box fontSize = "md" color = "text200 ">
88
+ < div className = "text-md text-[#666] dark:text-[#b2b2b2] ">
80
89
Banner Body
81
- </ Box >
90
+ </ div >
82
91
</ BannerBodyComponent >
83
92
</ BannerComponent >
84
93
)
@@ -90,7 +99,7 @@ export const BannerImage: Story = {
90
99
return (
91
100
< BannerComponent >
92
101
< BannerImageComponent >
93
- < Image src = { stats } alt = "" width = { 400 } />
102
+ < TwImage src = { stats } alt = "" width = { 400 } />
94
103
</ BannerImageComponent >
95
104
</ BannerComponent >
96
105
)
@@ -103,15 +112,13 @@ export const BannerGridCell: Story = {
103
112
< BannerComponent >
104
113
< BannerBodyComponent >
105
114
< BannerGridCellComponent >
106
- < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
107
- 4k+
108
- </ Box >
109
- < Box fontSize = "md" color = "text200" >
115
+ < StatPrimary > 4k+</ StatPrimary >
116
+ < StatDescription >
110
117
{ getTranslation (
111
118
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
112
119
PAGE_WHAT_IS_ETH
113
120
) }
114
- < Text as = " span" whiteSpace = " nowrap">
121
+ < span className = "whitespace- nowrap">
115
122
116
123
< Tooltip
117
124
content = { tooltipContent ( {
@@ -120,12 +127,12 @@ export const BannerGridCell: Story = {
120
127
ariaLabel : "Read more about Ethereum projects stats" ,
121
128
} ) }
122
129
>
123
- < Box as = " span" >
124
- < Icon as = { MdInfoOutline } verticalAlign = " middle" />
125
- </ Box >
130
+ < span >
131
+ < MdInfoOutline className = "inline-block align- middle" />
132
+ </ span >
126
133
</ Tooltip >
127
- </ Text >
128
- </ Box >
134
+ </ span >
135
+ </ StatDescription >
129
136
</ BannerGridCellComponent >
130
137
</ BannerBodyComponent >
131
138
</ BannerComponent >
@@ -141,15 +148,13 @@ export const BannerGrid: Story = {
141
148
< BannerGridComponent >
142
149
{ Array . from ( { length : 6 } , ( _ , i ) => i + 1 ) . map ( ( item ) => (
143
150
< BannerGridCellComponent key = { item } >
144
- < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
145
- { item } k+
146
- </ Box >
147
- < Box fontSize = "md" color = "text200" >
151
+ < StatPrimary > { item } k+</ StatPrimary >
152
+ < StatDescription >
148
153
{ getTranslation (
149
154
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
150
155
PAGE_WHAT_IS_ETH
151
156
) }
152
- < Text as = " span" whiteSpace = " nowrap">
157
+ < span className = "whitespace- nowrap">
153
158
154
159
< Tooltip
155
160
content = { tooltipContent ( {
@@ -159,18 +164,18 @@ export const BannerGrid: Story = {
159
164
ariaLabel : "Read more about Ethereum projects stats" ,
160
165
} ) }
161
166
>
162
- < Box as = " span" >
163
- < Icon as = { MdInfoOutline } verticalAlign = " middle" />
164
- </ Box >
167
+ < span >
168
+ < MdInfoOutline className = "inline-block align- middle" />
169
+ </ span >
165
170
</ Tooltip >
166
- </ Text >
167
- </ Box >
171
+ </ span >
172
+ </ StatDescription >
168
173
</ BannerGridCellComponent >
169
174
) ) }
170
175
</ BannerGridComponent >
171
176
</ BannerBodyComponent >
172
177
< BannerImageComponent >
173
- < Image src = { stats } alt = "" width = { 400 } />
178
+ < TwImage src = { stats } alt = "" width = { 400 } />
174
179
</ BannerImageComponent >
175
180
</ BannerComponent >
176
181
)
0 commit comments