@@ -15,6 +15,8 @@ import {
15
15
HeadingProps ,
16
16
Icon ,
17
17
SimpleGridProps ,
18
+ Skeleton ,
19
+ SkeletonText ,
18
20
Stack ,
19
21
useToken ,
20
22
} from "@chakra-ui/react"
@@ -69,6 +71,7 @@ import infrastructurefixed from "@/public/infrastructure_transparent.png"
69
71
import merge from "@/public/upgrades/merge.png"
70
72
import robotfixed from "@/public/wallet-cropped.png"
71
73
import ethereum from "@/public/what-is-ethereum.png"
74
+ import { LINES_BEFORE_COLLAPSABLE } from "@/components/Codeblock"
72
75
73
76
const SectionHeading = ( props : HeadingProps ) => (
74
77
< Heading
@@ -228,6 +231,11 @@ export const getStaticProps = (async ({ locale }) => {
228
231
// Lazy-load these components on initial load
229
232
const Codeblock = dynamic ( ( ) => import ( "@/components/Codeblock" ) , {
230
233
ssr : false ,
234
+ loading : ( ) => (
235
+ < Skeleton height = { "100%" } startColor = "body.base" >
236
+ Loading...
237
+ </ Skeleton >
238
+ ) ,
231
239
} )
232
240
233
241
const HomePage = ( {
@@ -300,6 +308,7 @@ const HomePage = ({
300
308
} ,
301
309
]
302
310
311
+ // todo: move to interfaces
303
312
interface CodeExample extends ITitleCardItem {
304
313
codeLanguage : string
305
314
code : string
@@ -550,13 +559,50 @@ const HomePage = ({
550
559
setIsOpen = { setModalOpen }
551
560
title = { codeExamples [ activeCode ] . title }
552
561
>
553
- < Codeblock
554
- codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
555
- allowCollapse = { false }
556
- fromHomepage
557
- >
558
- { codeExamples [ activeCode ] . code }
559
- </ Codeblock >
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
+ </ >
560
606
</ CodeModal >
561
607
) }
562
608
</ Row >
0 commit comments