Skip to content

Commit 25ccbe6

Browse files
committed
refactor: use ui/skeleton, and MainArticle
1 parent f44c0a9 commit 25ccbe6

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/pages/index.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { GetStaticProps, InferGetStaticPropsType } from "next"
33
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
44
import { FaDiscord, FaGithub } from "react-icons/fa6"
55
import { MdChevronRight } from "react-icons/md"
6-
import { Flex, Skeleton } from "@chakra-ui/react"
76

87
import type {
98
AllMetricData,
@@ -43,6 +42,7 @@ import {
4342
SectionHeader,
4443
SectionTag,
4544
} from "@/components/ui/section"
45+
import { SkeletonLines } from "@/components/ui/skeleton"
4646
import WindowBox from "@/components/WindowBox"
4747

4848
import { cn } from "@/lib/utils/cn"
@@ -182,13 +182,7 @@ const HomePage = ({
182182
} = useHome()
183183

184184
return (
185-
<Flex
186-
as={MainArticle}
187-
flexDirection="column"
188-
alignItems="center"
189-
dir={dir}
190-
width="full"
191-
>
185+
<MainArticle className="flex w-full flex-col items-center" dir={dir}>
192186
<PageMetadata
193187
title={t("page-index:page-index-meta-title")}
194188
description={t("page-index:page-index-meta-description")}
@@ -288,7 +282,7 @@ const HomePage = ({
288282
<p className="mt-8 text-xl font-bold">
289283
{t("page-index:page-index-activity-description")}
290284
</p>
291-
<Suspense fallback={<Skeleton />}>
285+
<Suspense fallback={<SkeletonLines noOfLines={10} />}>
292286
<StatsBoxGrid metricResults={metricResults} />
293287
</Suspense>
294288
</div>
@@ -394,13 +388,13 @@ const HomePage = ({
394388
</div>
395389

396390
{isModalOpen && (
397-
// TODO: Migrate CodeModal, CodeBlock, Skeleton from Chakra-UI to tailwind/shad-cn
391+
// TODO: Migrate CodeModal, CodeBlock from Chakra-UI to tailwind/shad-cn
398392
<CodeModal
399393
isOpen={isModalOpen}
400394
setIsOpen={setModalOpen}
401395
title={codeExamples[activeCode].title}
402396
>
403-
<Suspense fallback={<Skeleton />}>
397+
<Suspense fallback={<SkeletonLines noOfLines={16} />}>
404398
<Codeblock
405399
codeLanguage={codeExamples[activeCode].codeLanguage}
406400
allowCollapse={false}
@@ -667,7 +661,7 @@ const HomePage = ({
667661
</div>
668662
</Section>
669663
</div>
670-
</Flex>
664+
</MainArticle>
671665
)
672666
}
673667

0 commit comments

Comments
 (0)