@@ -70,8 +70,29 @@ import merge from "@/public/images/upgrades/merge.png"
70
70
import robotfixed from "@/public/images/wallet-cropped.png"
71
71
import ethereum from "@/public/images/what-is-ethereum.png"
72
72
73
+ // lazy loaded components
74
+ const Codeblock = lazy ( ( ) =>
75
+ Promise . all ( [
76
+ import ( "@/components/Codeblock" ) ,
77
+ // Add a delay to prevent the skeleton from flashing
78
+ new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ,
79
+ ] ) . then ( ( [ module ] ) => module )
80
+ )
73
81
const StatsBoxGrid = lazy ( ( ) => import ( "@/components/StatsBoxGrid" ) )
74
82
83
+ const Skeleton = ( ) => (
84
+ < Stack px = { 6 } pt = "2.75rem" h = "50vh" >
85
+ < SkeletonText
86
+ mt = "4"
87
+ noOfLines = { 6 }
88
+ spacing = { 4 }
89
+ skeletonHeight = "1.4rem"
90
+ startColor = "body.medium"
91
+ opacity = { 0.2 }
92
+ />
93
+ </ Stack >
94
+ )
95
+
75
96
const SectionHeading = ( props : HeadingProps ) => (
76
97
< Heading
77
98
lineHeight = { 1.4 }
@@ -227,27 +248,6 @@ export const getStaticProps = (async ({ locale }) => {
227
248
}
228
249
} ) satisfies GetStaticProps < Props >
229
250
230
- const CodeblockSkeleton = ( ) => (
231
- < Stack px = { 6 } pt = "2.75rem" h = "50vh" >
232
- < SkeletonText
233
- mt = "4"
234
- noOfLines = { 6 }
235
- spacing = { 4 }
236
- skeletonHeight = "1.4rem"
237
- startColor = "body.medium"
238
- opacity = { 0.2 }
239
- />
240
- </ Stack >
241
- )
242
-
243
- const Codeblock = lazy ( ( ) =>
244
- Promise . all ( [
245
- import ( "@/components/Codeblock" ) ,
246
- // Add a delay to prevent the skeleton from flashing
247
- new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ,
248
- ] ) . then ( ( [ module ] ) => module )
249
- )
250
-
251
251
const HomePage = ( {
252
252
communityEvents,
253
253
metricResults,
@@ -563,7 +563,7 @@ const HomePage = ({
563
563
setIsOpen = { setModalOpen }
564
564
title = { codeExamples [ activeCode ] . title }
565
565
>
566
- < Suspense fallback = { < CodeblockSkeleton /> } >
566
+ < Suspense fallback = { < Skeleton /> } >
567
567
< Codeblock
568
568
codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
569
569
allowCollapse = { false }
@@ -589,7 +589,7 @@ const HomePage = ({
589
589
590
590
< LazyLoadComponent
591
591
component = { StatsBoxGrid }
592
- fallback = { < CodeblockSkeleton /> }
592
+ fallback = { < Skeleton /> }
593
593
componentProps = { { data : metricResults } }
594
594
intersectionOptions = { {
595
595
root : null ,
0 commit comments