1
1
import React , { ReactNode } from "react"
2
+ import { useTranslation } from "next-i18next"
2
3
import {
3
4
Box ,
4
5
calc ,
@@ -12,7 +13,8 @@ import {
12
13
VStack ,
13
14
} from "@chakra-ui/react"
14
15
15
- import { trackCustomEvent } from "../../utils/matomo"
16
+ import { trackCustomEvent } from "@/lib/utils/matomo"
17
+
16
18
import { ButtonLink } from "../Buttons"
17
19
import {
18
20
StakingGlyphCentralizedIcon ,
@@ -209,18 +211,17 @@ const Pills = ({ children }: ChildOnlyType) => (
209
211
</ Flex >
210
212
)
211
213
212
- const Glyph = ( { glyphIcon } : { glyphIcon : typeof Icon } ) => {
213
- const Icon = glyphIcon
214
- return (
215
- < Center gridArea = { { base : "content" , md : "glyph" } } >
216
- < Icon
217
- boxSize = { { base : "50%" , md : "50px" } }
218
- color = { $colorVar . reference }
219
- opacity = { { base : 0.1 , md : "initial" } }
220
- />
221
- </ Center >
222
- )
223
- }
214
+ type GlyphProps = { glyphIcon : typeof Icon }
215
+ const Glyph = ( { glyphIcon } : GlyphProps ) => (
216
+ < Center gridArea = { { base : "content" , md : "glyph" } } >
217
+ < Icon
218
+ as = { glyphIcon }
219
+ boxSize = { { base : "50%" , md : "50px" } }
220
+ color = { $colorVar . reference }
221
+ opacity = { { base : 0.1 , md : "initial" } }
222
+ />
223
+ </ Center >
224
+ )
224
225
225
226
const Content = ( { children } : ChildOnlyType ) => (
226
227
< Box
@@ -239,9 +240,8 @@ const Content = ({ children }: ChildOnlyType) => (
239
240
</ Box >
240
241
)
241
242
242
- export interface IProps { }
243
-
244
- const StakingHierarchy : React . FC < IProps > = ( ) => {
243
+ const StakingHierarchy = ( ) => {
244
+ const { t } = useTranslation ( "page-staking" )
245
245
const [ stakingGold , stakingGreen , stakingBlue , stakingRed ] = useToken (
246
246
"colors" ,
247
247
[ "stakingGold" , "stakingGreen" , "stakingBlue" , "stakingRed" ]
@@ -263,34 +263,22 @@ const StakingHierarchy: React.FC<IProps> = () => {
263
263
< StyledEtherSvg size = "100%" />
264
264
< Line />
265
265
< Header >
266
- < HeadingEl >
267
- < Translation id = "page-staking-hierarchy-solo-h2" />
268
- </ HeadingEl >
266
+ < HeadingEl > { t ( "page-staking-hierarchy-solo-h2" ) } </ HeadingEl >
269
267
< Pills >
270
268
< p >
271
- < em >
272
- < Translation id = "page-staking-hierarchy-solo-pill-1" />
273
- </ em >
274
- </ p >
275
- < p >
276
- < Translation id = "page-staking-hierarchy-solo-pill-2" />
277
- </ p >
278
- < p >
279
- < Translation id = "page-staking-hierarchy-solo-pill-3" />
280
- </ p >
281
- < p >
282
- < Translation id = "page-staking-hierarchy-solo-pill-4" />
269
+ < em > { t ( "page-staking-hierarchy-solo-pill-1" ) } </ em >
283
270
</ p >
271
+ < p > { t ( "page-staking-hierarchy-solo-pill-2" ) } </ p >
272
+ < p > { t ( "page-staking-hierarchy-solo-pill-3" ) } </ p >
273
+ < p > { t ( "page-staking-hierarchy-solo-pill-4" ) } </ p >
284
274
</ Pills >
285
275
</ Header >
286
276
< Glyph glyphIcon = { StakingGlyphCPUIcon } />
287
277
< Content >
288
278
< p >
289
- < Translation id = "page-staking-hierarchy-solo-p1" />
290
- </ p >
291
- < p >
292
- < Translation id = "page-staking-hierarchy-solo-p2" />
279
+ < Translation id = "page-staking:page-staking-hierarchy-solo-p1" />
293
280
</ p >
281
+ < p > { t ( "page-staking-hierarchy-solo-p2" ) } </ p >
294
282
< ButtonLink
295
283
to = "/staking/solo/"
296
284
onClick = { ( ) => {
@@ -302,40 +290,26 @@ const StakingHierarchy: React.FC<IProps> = () => {
302
290
} }
303
291
width = { { base : "100%" , md : "auto" } }
304
292
>
305
- < Translation id = "page-staking-more-on-solo" />
293
+ { t ( "page-staking-more-on-solo" ) }
306
294
</ ButtonLink >
307
295
</ Content >
308
296
</ SectionGrid >
309
297
< SectionGrid number = { 2 } >
310
298
< StyledEtherSvg size = "90%" />
311
299
< Line />
312
300
< Header >
313
- < HeadingEl >
314
- < Translation id = "page-staking-dropdown-saas" />
315
- </ HeadingEl >
301
+ < HeadingEl > { t ( "page-staking-dropdown-saas" ) } </ HeadingEl >
316
302
< Pills >
317
- < p >
318
- < Translation id = "page-staking-hierarchy-saas-pill-1" > </ Translation >
319
- </ p >
320
- < p >
321
- < Translation id = "page-staking-hierarchy-saas-pill-2" > </ Translation >
322
- </ p >
323
- < p >
324
- < Translation id = "page-staking-hierarchy-saas-pill-3" > </ Translation >
325
- </ p >
303
+ < p > { t ( "page-staking-hierarchy-saas-pill-1" ) } </ p >
304
+ < p > { t ( "page-staking-hierarchy-saas-pill-2" ) } </ p >
305
+ < p > { t ( "page-staking-hierarchy-saas-pill-3" ) } </ p >
326
306
</ Pills >
327
307
</ Header >
328
308
< Glyph glyphIcon = { StakingGlyphCloudIcon } />
329
309
< Content >
330
- < p >
331
- < Translation id = "page-staking-hierarchy-saas-p1" />
332
- </ p >
333
- < p >
334
- < Translation id = "page-staking-hierarchy-saas-p2" />
335
- </ p >
336
- < p >
337
- < Translation id = "page-staking-hierarchy-saas-p3" />
338
- </ p >
310
+ < p > { t ( "page-staking-hierarchy-saas-p1" ) } </ p >
311
+ < p > { t ( "page-staking-hierarchy-saas-p2" ) } </ p >
312
+ < p > { t ( "page-staking-hierarchy-saas-p3" ) } </ p >
339
313
< ButtonLink
340
314
to = "/staking/saas/"
341
315
onClick = { ( ) => {
@@ -347,48 +321,30 @@ const StakingHierarchy: React.FC<IProps> = () => {
347
321
} }
348
322
width = { { base : "100%" , md : "auto" } }
349
323
>
350
- < Translation id = "page-staking-more-on-saas" />
324
+ { t ( "page-staking-more-on-saas" ) }
351
325
</ ButtonLink >
352
326
</ Content >
353
327
</ SectionGrid >
354
328
< SectionGrid number = { 3 } >
355
329
< StyledEtherSvg size = "80%" />
356
330
< Line />
357
331
< Header >
358
- < HeadingEl >
359
- < Translation id = "page-staking-dropdown-pools" />
360
- </ HeadingEl >
332
+ < HeadingEl > { t ( "page-staking-dropdown-pools" ) } </ HeadingEl >
361
333
< Pills >
334
+ < p > { t ( "page-staking-hierarchy-pools-pill-1" ) } </ p >
335
+ < p > { t ( "page-staking-hierarchy-pools-pill-2" ) } </ p >
336
+ < p > { t ( "page-staking-hierarchy-pools-pill-3" ) } </ p >
362
337
< p >
363
- < Translation id = "page-staking-hierarchy-pools-pill-1" />
364
- </ p >
365
- < p >
366
- < Translation id = "page-staking-hierarchy-pools-pill-2" />
367
- </ p >
368
- < p >
369
- < Translation id = "page-staking-hierarchy-pools-pill-3" />
370
- </ p >
371
- < p >
372
- < em >
373
- < Translation id = "page-staking-hierarchy-pools-pill-4" />
374
- </ em >
338
+ < em > { t ( "page-staking-hierarchy-pools-pill-4" ) } </ em >
375
339
</ p >
376
340
</ Pills >
377
341
</ Header >
378
342
< Glyph glyphIcon = { StakingGlyphTokenWalletIcon } />
379
343
< Content >
380
- < p >
381
- < Translation id = "page-staking-hierarchy-pools-p1" />
382
- </ p >
383
- < p >
384
- < Translation id = "page-staking-hierarchy-pools-p2" />
385
- </ p >
386
- < p >
387
- < Translation id = "page-staking-hierarchy-pools-p3" />
388
- </ p >
389
- < p >
390
- < Translation id = "page-staking-hierarchy-pools-p4" />
391
- </ p >
344
+ < p > { t ( "page-staking-hierarchy-pools-p1" ) } </ p >
345
+ < p > { t ( "page-staking-hierarchy-pools-p2" ) } </ p >
346
+ < p > { t ( "page-staking-hierarchy-pools-p3" ) } </ p >
347
+ < p > { t ( "page-staking-hierarchy-pools-p4" ) } </ p >
392
348
< ButtonLink
393
349
to = "/staking/pools/"
394
350
onClick = { ( ) => {
@@ -400,38 +356,28 @@ const StakingHierarchy: React.FC<IProps> = () => {
400
356
} }
401
357
width = { { base : "100%" , md : "auto" } }
402
358
>
403
- < Translation id = "page-staking-more-on-pools" />
359
+ { t ( "page-staking-more-on-pools" ) }
404
360
</ ButtonLink >
405
361
</ Content >
406
362
</ SectionGrid >
407
363
< SectionGrid number = { 4 } >
408
364
< StyledEtherSvg size = "70%" />
409
365
< Line />
410
366
< Header >
411
- < HeadingEl >
412
- < Translation id = "page-staking-hierarchy-cex-h2" />
413
- </ HeadingEl >
367
+ < HeadingEl > { t ( "page-staking-hierarchy-cex-h2" ) } </ HeadingEl >
414
368
< Pills >
415
369
< p >
416
- < em >
417
- < Translation id = "page-staking-hierarchy-cex-pill-1" />
418
- </ em >
419
- </ p >
420
- < p >
421
- < Translation id = "page-staking-hierarchy-cex-pill-2" />
370
+ < em > { t ( "page-staking-hierarchy-cex-pill-1" ) } </ em >
422
371
</ p >
372
+ < p > { t ( "page-staking-hierarchy-cex-pill-2" ) } </ p >
423
373
</ Pills >
424
374
</ Header >
425
375
< Glyph glyphIcon = { StakingGlyphCentralizedIcon } />
426
376
< Content >
377
+ < p > { t ( "page-staking-hierarchy-cex-p1" ) } </ p >
378
+ < p > { t ( "page-staking-hierarchy-cex-p2" ) } </ p >
427
379
< p >
428
- < Translation id = "page-staking-hierarchy-cex-p1" />
429
- </ p >
430
- < p >
431
- < Translation id = "page-staking-hierarchy-cex-p2" />
432
- </ p >
433
- < p >
434
- < Translation id = "page-staking-hierarchy-cex-p3" />
380
+ < Translation id = "page-staking:page-staking-hierarchy-cex-p3" />
435
381
</ p >
436
382
</ Content >
437
383
</ SectionGrid >
0 commit comments