1
+ import { useTranslations } from "next-intl"
1
2
import { MdInfoOutline } from "react-icons/md"
2
3
import { Meta , StoryObj } from "@storybook/react"
3
4
4
5
import { ChildOnlyProp } from "@/lib/types"
5
6
6
- import { TwImage } from "@/components/Image"
7
- import InlineLink from "@/components/Link"
7
+ import { Image } from "@/components/Image"
8
8
import Tooltip from "@/components/Tooltip"
9
-
10
- import { getTranslation } from "@/storybook-utils"
9
+ import InlineLink from "@/components/ui/Link"
11
10
12
11
import { langViewportModes } from "../../../.storybook/modes"
13
12
import { ContentContainer } from "../MdComponents"
@@ -50,14 +49,18 @@ type Story = StoryObj<typeof meta>
50
49
51
50
const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
52
51
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
- )
52
+ const tooltipContent = ( { apiUrl, apiProvider, ariaLabel } ) => {
53
+ const t = useTranslations ( "common" )
54
+
55
+ return (
56
+ < div >
57
+ { t ( "data-provided-by" ) } { " " }
58
+ < InlineLink href = { apiUrl } aria-label = { ariaLabel } >
59
+ { apiProvider }
60
+ </ InlineLink >
61
+ </ div >
62
+ )
63
+ }
61
64
62
65
const StatPrimary = ( props : ChildOnlyProp ) => (
63
66
< div className = "mb-4 text-5xl leading-none" { ...props } />
@@ -96,7 +99,7 @@ export const BannerImage: Story = {
96
99
return (
97
100
< BannerComponent >
98
101
< BannerImageComponent >
99
- < TwImage src = { stats } alt = "" width = { 400 } />
102
+ < Image src = { stats } alt = "" width = { 400 } />
100
103
</ BannerImageComponent >
101
104
</ BannerComponent >
102
105
)
@@ -105,16 +108,15 @@ export const BannerImage: Story = {
105
108
106
109
export const BannerGridCell : Story = {
107
110
render : ( ) => {
111
+ const t = useTranslations ( PAGE_WHAT_IS_ETH )
112
+
108
113
return (
109
114
< BannerComponent >
110
115
< BannerBodyComponent >
111
116
< BannerGridCellComponent >
112
117
< StatPrimary > 4k+</ StatPrimary >
113
118
< StatDescription >
114
- { getTranslation (
115
- "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
116
- PAGE_WHAT_IS_ETH
117
- ) }
119
+ { t ( "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ) }
118
120
< span className = "whitespace-nowrap" >
119
121
120
122
< Tooltip
@@ -139,6 +141,8 @@ export const BannerGridCell: Story = {
139
141
140
142
export const BannerGrid : Story = {
141
143
render : ( ) => {
144
+ const t = useTranslations ( PAGE_WHAT_IS_ETH )
145
+
142
146
return (
143
147
< BannerComponent >
144
148
< BannerBodyComponent >
@@ -147,10 +151,7 @@ export const BannerGrid: Story = {
147
151
< BannerGridCellComponent key = { item } >
148
152
< StatPrimary > { item } k+</ StatPrimary >
149
153
< StatDescription >
150
- { getTranslation (
151
- "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ,
152
- PAGE_WHAT_IS_ETH
153
- ) }
154
+ { t ( "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" ) }
154
155
< span className = "whitespace-nowrap" >
155
156
156
157
< Tooltip
@@ -172,7 +173,7 @@ export const BannerGrid: Story = {
172
173
</ BannerGridComponent >
173
174
</ BannerBodyComponent >
174
175
< BannerImageComponent >
175
- < TwImage src = { stats } alt = "" width = { 400 } />
176
+ < Image src = { stats } alt = "" width = { 400 } />
176
177
</ BannerImageComponent >
177
178
</ BannerComponent >
178
179
)
0 commit comments