@@ -3,7 +3,9 @@ import { Box, Icon } from "@chakra-ui/react"
3
3
import { Meta , StoryObj } from "@storybook/react"
4
4
5
5
import { Image } from "@/components/Image"
6
+ import InlineLink from "@/components/Link"
6
7
import Text from "@/components/OldText"
8
+ import Tooltip from "@/components/Tooltip"
7
9
8
10
import { getTranslation } from "@/storybook-utils"
9
11
@@ -46,11 +48,24 @@ export default meta
46
48
47
49
type Story = StoryObj < typeof meta >
48
50
51
+ const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
52
+
53
+ const tooltipContent = ( { apiUrl, apiProvider, ariaLabel } ) => (
54
+ < div >
55
+ { getTranslation ( "data-provided-by" , "common" ) } { " " }
56
+ < InlineLink href = { apiUrl } aria-label = { ariaLabel } >
57
+ { apiProvider }
58
+ </ InlineLink >
59
+ </ div >
60
+ )
61
+
49
62
export const Banner : Story = {
50
63
render : ( ) => {
51
64
return (
52
65
< BannerComponent >
53
- < div > What </ div >
66
+ < Box fontSize = "md" color = "text200" >
67
+ Banner
68
+ </ Box >
54
69
</ BannerComponent >
55
70
)
56
71
} ,
@@ -61,7 +76,9 @@ export const BannerBody: Story = {
61
76
return (
62
77
< BannerComponent >
63
78
< BannerBodyComponent >
64
- < div > What </ div >
79
+ < Box fontSize = "md" color = "text200" >
80
+ Banner Body
81
+ </ Box >
65
82
</ BannerBodyComponent >
66
83
</ BannerComponent >
67
84
)
@@ -82,57 +99,79 @@ export const BannerImage: Story = {
82
99
83
100
export const BannerGridCell : Story = {
84
101
render : ( ) => {
85
- const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
86
102
return (
87
103
< BannerComponent >
88
- < BannerGridCellComponent >
89
- < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
90
- 4k+
91
- </ Box >
92
- < Box fontSize = "md" color = "text200" >
93
- { getTranslation (
94
- "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
95
- PAGE_WHAT_IS_ETH
96
- ) }
97
- < Text as = "span" whiteSpace = "nowrap" >
98
-
99
- < Box as = "span" >
100
- < Icon as = { MdInfoOutline } verticalAlign = "middle" />
101
- </ Box >
102
- </ Text >
103
- </ Box >
104
- </ BannerGridCellComponent >
104
+ < BannerBodyComponent >
105
+ < BannerGridCellComponent >
106
+ < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
107
+ 4k+
108
+ </ Box >
109
+ < Box fontSize = "md" color = "text200" >
110
+ { getTranslation (
111
+ "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
112
+ PAGE_WHAT_IS_ETH
113
+ ) }
114
+ < Text as = "span" whiteSpace = "nowrap" >
115
+
116
+ < Tooltip
117
+ content = { tooltipContent ( {
118
+ apiUrl : "https://dappradar.com/rankings/protocol/ethereum" ,
119
+ apiProvider : "State of the dapps" ,
120
+ ariaLabel : "Read more about Ethereum projects stats" ,
121
+ } ) }
122
+ >
123
+ < Box as = "span" >
124
+ < Icon as = { MdInfoOutline } verticalAlign = "middle" />
125
+ </ Box >
126
+ </ Tooltip >
127
+ </ Text >
128
+ </ Box >
129
+ </ BannerGridCellComponent >
130
+ </ BannerBodyComponent >
105
131
</ BannerComponent >
106
132
)
107
133
} ,
108
134
}
109
135
110
136
export const BannerGrid : Story = {
111
137
render : ( ) => {
112
- const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
113
138
return (
114
139
< BannerComponent >
115
- < BannerGridComponent >
116
- { Array . from ( { length : 6 } , ( _ , i ) => i + 1 ) . map ( ( item ) => (
117
- < BannerGridCellComponent key = { item } >
118
- < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
119
- { item } k+
120
- </ Box >
121
- < Box fontSize = "md" color = "text200" >
122
- { getTranslation (
123
- "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
124
- PAGE_WHAT_IS_ETH
125
- ) }
126
- < Text as = "span" whiteSpace = "nowrap" >
127
-
128
- < Box as = "span" >
129
- < Icon as = { MdInfoOutline } verticalAlign = "middle" />
130
- </ Box >
131
- </ Text >
132
- </ Box >
133
- </ BannerGridCellComponent >
134
- ) ) }
135
- </ BannerGridComponent >
140
+ < BannerBodyComponent >
141
+ < BannerGridComponent >
142
+ { Array . from ( { length : 6 } , ( _ , i ) => i + 1 ) . map ( ( item ) => (
143
+ < BannerGridCellComponent key = { item } >
144
+ < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
145
+ { item } k+
146
+ </ Box >
147
+ < Box fontSize = "md" color = "text200" >
148
+ { getTranslation (
149
+ "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
150
+ PAGE_WHAT_IS_ETH
151
+ ) }
152
+ < Text as = "span" whiteSpace = "nowrap" >
153
+
154
+ < Tooltip
155
+ content = { tooltipContent ( {
156
+ apiUrl :
157
+ "https://dappradar.com/rankings/protocol/ethereum" ,
158
+ apiProvider : "State of the dapps" ,
159
+ ariaLabel : "Read more about Ethereum projects stats" ,
160
+ } ) }
161
+ >
162
+ < Box as = "span" >
163
+ < Icon as = { MdInfoOutline } verticalAlign = "middle" />
164
+ </ Box >
165
+ </ Tooltip >
166
+ </ Text >
167
+ </ Box >
168
+ </ BannerGridCellComponent >
169
+ ) ) }
170
+ </ BannerGridComponent >
171
+ </ BannerBodyComponent >
172
+ < BannerImageComponent >
173
+ < Image src = { stats } alt = "" width = { 400 } />
174
+ </ BannerImageComponent >
136
175
</ BannerComponent >
137
176
)
138
177
} ,
0 commit comments