@@ -15,7 +15,6 @@ import {
15
15
HeadingProps ,
16
16
Icon ,
17
17
SimpleGridProps ,
18
- Skeleton ,
19
18
SkeletonText ,
20
19
Stack ,
21
20
useToken ,
@@ -71,7 +70,6 @@ import infrastructurefixed from "@/public/infrastructure_transparent.png"
71
70
import merge from "@/public/upgrades/merge.png"
72
71
import robotfixed from "@/public/wallet-cropped.png"
73
72
import ethereum from "@/public/what-is-ethereum.png"
74
- import { LINES_BEFORE_COLLAPSABLE } from "@/components/Codeblock"
75
73
76
74
const SectionHeading = ( props : HeadingProps ) => (
77
75
< Heading
@@ -228,14 +226,16 @@ export const getStaticProps = (async ({ locale }) => {
228
226
}
229
227
} ) satisfies GetStaticProps < Props >
230
228
231
- // Lazy-load these components on initial load
229
+ // Lazy-load Codeblock on initial load
230
+ const CodeblockSkeleton = ( ) => (
231
+ < Stack px = { 6 } pt = "2.75rem" h = "50vh" >
232
+ < SkeletonText mt = "4" noOfLines = { 12 } startColor = "body.base" />
233
+ </ Stack >
234
+ )
235
+
232
236
const Codeblock = dynamic ( ( ) => import ( "@/components/Codeblock" ) , {
233
237
ssr : false ,
234
- loading : ( ) => (
235
- < Skeleton height = { "100%" } startColor = "body.base" >
236
- Loading...
237
- </ Skeleton >
238
- ) ,
238
+ loading : ( ) => < CodeblockSkeleton /> ,
239
239
} )
240
240
241
241
const HomePage = ( {
@@ -559,50 +559,13 @@ const HomePage = ({
559
559
setIsOpen = { setModalOpen }
560
560
title = { codeExamples [ activeCode ] . title }
561
561
>
562
- < >
563
- { /* <Stack
564
- px={6}
565
- py={8}
566
- maxH={`calc((1.2rem * ${LINES_BEFORE_COLLAPSABLE}) + 4.185rem)`}
567
- pt={hasTopBar ? "2.75rem" : 6}
568
- ps={4}
569
- >
570
- <SkeletonText
571
- mt="4"
572
- noOfLines={12}
573
- spacing="4"
574
- skeletonHeight="2"
575
- startColor="body.base"
576
- />
577
- </Stack> */ }
578
-
579
- < SkeletonText
580
- // noOfLines={13}
581
- // spacing="4"
582
- // skeletonHeight="2"
583
- px = { 6 }
584
- py = { 12 }
585
- overflow = "hidden"
586
- startColor = "body.base"
587
- h = "50%"
588
- >
589
- < Codeblock
590
- codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
591
- allowCollapse = { false }
592
- fromHomepage
593
- >
594
- { codeExamples [ activeCode ] . code }
595
- </ Codeblock >
596
- </ SkeletonText >
597
-
598
- { /* <Codeblock
599
- codeLanguage={codeExamples[activeCode].codeLanguage}
600
- allowCollapse={false}
601
- fromHomepage
602
- >
603
- {codeExamples[activeCode].code}
604
- </Codeblock> */ }
605
- </ >
562
+ < Codeblock
563
+ codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
564
+ allowCollapse = { false }
565
+ fromHomepage
566
+ >
567
+ { codeExamples [ activeCode ] . code }
568
+ </ Codeblock >
606
569
</ CodeModal >
607
570
) }
608
571
</ Row >
0 commit comments