1
1
import { pick } from "lodash"
2
- import dynamic from "next/dynamic"
3
2
import {
4
3
getMessages ,
5
4
getTranslations ,
@@ -9,6 +8,7 @@ import { MdInfoOutline } from "react-icons/md"
9
8
10
9
import type { ChildOnlyProp , CommitHistory , Lang } from "@/lib/types"
11
10
11
+ import AdoptionChart from "@/components/AdoptionChart/lazy"
12
12
import {
13
13
Banner ,
14
14
BannerBody ,
@@ -18,10 +18,12 @@ import {
18
18
} from "@/components/BannerGrid"
19
19
import Callout from "@/components/Callout"
20
20
import Card from "@/components/Card"
21
+ import EnergyConsumptionChart from "@/components/EnergyConsumptionChart/lazy"
21
22
import FeedbackCard from "@/components/FeedbackCard"
22
23
import FileContributors from "@/components/FileContributors"
23
24
import I18nProvider from "@/components/I18nProvider"
24
25
import { Image , ImageProps } from "@/components/Image"
26
+ import ListenToPlayer from "@/components/ListenToPlayer/lazy"
25
27
import MainArticle from "@/components/MainArticle"
26
28
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
27
29
import StatErrorMessage from "@/components/StatErrorMessage"
@@ -31,7 +33,6 @@ import { Button } from "@/components/ui/buttons/Button"
31
33
import { ButtonLink } from "@/components/ui/buttons/Button"
32
34
import { Center , Flex , HStack , Stack } from "@/components/ui/flex"
33
35
import InlineLink from "@/components/ui/Link"
34
- import { Skeleton , SkeletonLines } from "@/components/ui/skeleton"
35
36
36
37
import { cn } from "@/lib/utils/cn"
37
38
import { getAppPageContributorInfo } from "@/lib/utils/contributors"
@@ -42,6 +43,9 @@ import {
42
43
getRequiredNamespacesForPage ,
43
44
} from "@/lib/utils/translations"
44
45
46
+ import WhatTabs from "./_components/WhatTabs/lazy"
47
+ import WhySwiper from "./_components/WhySwiper/lazy"
48
+
45
49
import { fetchGrowThePie } from "@/lib/api/fetchGrowThePie"
46
50
import dogeComputerImg from "@/public/images/doge-computer.png"
47
51
import ethImg from "@/public/images/eth.png"
@@ -53,112 +57,6 @@ import whoRunsEthereum from "@/public/images/run-a-node/ethereum-inside.png"
53
57
import stats from "@/public/images/upgrades/newrings.png"
54
58
import hero from "@/public/images/what-is-ethereum.png"
55
59
56
- const AdoptionChart = dynamic ( ( ) => import ( "@/components/AdoptionChart" ) , {
57
- ssr : false ,
58
- loading : ( ) => (
59
- < div className = "ms-8 grid w-full max-w-96 flex-[2] grid-cols-3 gap-x-4 gap-y-6" >
60
- < div className = "flex h-fit flex-1 flex-col self-end overflow-hidden rounded-4xl border" >
61
- < Skeleton className = "m-4" />
62
- </ div >
63
- < div className = "flex h-fit flex-1 flex-col self-end overflow-hidden rounded-4xl border [&>div]:border-b last:[&>div]:border-none" >
64
- { Array . from ( { length : 3 } ) . map ( ( _ , idx ) => (
65
- < div key = { "col2" + idx } className = "border-b p-4 last:border-none" >
66
- < Skeleton className = "" />
67
- </ div >
68
- ) ) }
69
- </ div >
70
- < div className = "flex h-fit flex-1 flex-col self-end overflow-hidden rounded-4xl border" >
71
- { Array . from ( { length : 8 } ) . map ( ( _ , idx ) => (
72
- < div key = { "col2" + idx } className = "border-b p-4 last:border-none" >
73
- < Skeleton className = "" />
74
- </ div >
75
- ) ) }
76
- </ div >
77
- < Skeleton className = "mx-6" />
78
- < Skeleton className = "mx-6" />
79
- < Skeleton className = "mx-6" />
80
- </ div >
81
- ) ,
82
- } )
83
-
84
- const ListenToPlayer = dynamic ( ( ) => import ( "@/components/ListenToPlayer" ) , {
85
- ssr : false ,
86
- loading : ( ) => < Skeleton className = "h-10.5 w-56" /> ,
87
- } )
88
-
89
- const WhatTabs = dynamic ( ( ) => import ( "./_components/WhySlider" ) , {
90
- ssr : false ,
91
- loading : ( ) => (
92
- < >
93
- < div className = "mb-4 flex w-2/3 gap-4 border-b py-4" >
94
- < Skeleton className = "flex-1" />
95
- < Skeleton className = "flex-1" />
96
- </ div >
97
- < div className = "h-fit rounded-lg border p-8" >
98
- < SkeletonLines noOfLines = { 5 } className = "pt-0" />
99
- </ div >
100
- </ >
101
- ) ,
102
- } )
103
-
104
- const WhySwiper = dynamic ( ( ) => import ( "./_components/WhySlider" ) , {
105
- ssr : false ,
106
- loading : ( ) => (
107
- < div className = "h-fit space-y-8 rounded border bg-background p-8" >
108
- < SkeletonLines noOfLines = { 5 } />
109
- < SkeletonLines noOfLines = { 5 } />
110
- < Skeleton className = "mx-auto h-5 w-40 rounded-full" />
111
- </ div >
112
- ) ,
113
- } )
114
-
115
- const EnergyConsumptionChart = dynamic (
116
- ( ) => import ( "@/components/EnergyConsumptionChart" ) ,
117
- {
118
- ssr : false ,
119
- loading : ( ) => (
120
- < div className = "my-16 w-full space-y-4" >
121
- < div className = "grid w-full grid-cols-5 place-items-end sm:grid-cols-6 md:grid-cols-10" >
122
- < div className = "flex flex-col items-center space-y-4" >
123
- < Skeleton className = "h-60 w-9" />
124
- < Skeleton className = "h-8 w-9" />
125
- </ div >
126
- < div className = "flex flex-col items-center space-y-4" >
127
- < Skeleton className = "h-40 w-9" />
128
- < Skeleton className = "h-8 w-9" />
129
- </ div >
130
- < div className = "flex flex-col items-center space-y-4" >
131
- < Skeleton className = "h-20 w-9" />
132
- < Skeleton className = "h-8 w-9" />
133
- </ div > { " " }
134
- < div className = "flex flex-col items-center space-y-4" >
135
- < Skeleton className = "h-10 w-9" />
136
- < Skeleton className = "h-8 w-9" />
137
- </ div >
138
- < div className = "flex flex-col items-center space-y-4 max-sm:hidden" >
139
- < Skeleton className = "h-6 w-9" />
140
- < Skeleton className = "h-8 w-9" />
141
- </ div >
142
- { Array . from ( { length : 4 } ) . map ( ( _ , idx ) => (
143
- < div
144
- key = { idx }
145
- className = "flex flex-col items-center space-y-4 max-md:hidden"
146
- >
147
- < Skeleton className = "h-3 w-9" />
148
- < Skeleton className = "h-8 w-9" />
149
- </ div >
150
- ) ) }
151
- < div className = "flex flex-col items-center space-y-4" >
152
- < Skeleton className = "h-1 w-9" />
153
- < Skeleton className = "h-8 w-9" />
154
- </ div >
155
- </ div >
156
- < Skeleton className = "mx-auto w-80" />
157
- </ div >
158
- ) ,
159
- }
160
- )
161
-
162
60
const Summary = ( {
163
61
className,
164
62
...rest
@@ -377,7 +275,6 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
377
275
< div className = "w-full bg-background-highlight" >
378
276
< Section >
379
277
< div className = "mb-8" >
380
- { /* CLIENT SIDE */ }
381
278
< ListenToPlayer slug = { "what-is-ethereum" } />
382
279
</ div >
383
280
< Stack className = "gap-14" >
@@ -429,7 +326,6 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
429
326
430
327
< TwoColumnContent >
431
328
< Width60 >
432
- { /* CLIENT SIDE */ }
433
329
< WhatTabs />
434
330
</ Width60 >
435
331
< Width40 />
@@ -449,13 +345,11 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
449
345
< p > { t ( "page-what-is-ethereum-why-would-i-use-ethereum-2" ) } </ p >
450
346
451
347
< div className = "max-w-full" >
452
- { /* CLIENT SIDE */ }
453
348
< WhySwiper />
454
349
</ div >
455
350
</ Stack >
456
351
</ Width60 >
457
352
< Width40 >
458
- { /* CLIENT SIDE */ }
459
353
< AdoptionChart />
460
354
</ Width40 >
461
355
</ TwoColumnContent >
@@ -701,7 +595,6 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
701
595
< Section >
702
596
< TwoColumnContent className = "lg:flex-row-reverse" >
703
597
< Width40 >
704
- { /* CLIENT SIDE */ }
705
598
< EnergyConsumptionChart />
706
599
</ Width40 >
707
600
< Width60 >
0 commit comments