Skip to content

Commit 3aab0b5

Browse files
authored
Merge pull request #14903 from TylerAPfledderer/feat/migrate-quizzes-page
[ShadCN]: Migrate quizzes page
2 parents 4bf663e + 4eb6d1e commit 3aab0b5

File tree

1 file changed

+22
-34
lines changed

1 file changed

+22
-34
lines changed

src/pages/quizzes.tsx

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { GetStaticProps, InferGetStaticPropsType, NextPage } from "next"
33
import { useTranslation } from "next-i18next"
44
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
55
import { FaGithub } from "react-icons/fa"
6-
import { Box, Flex, Icon, Stack, Text } from "@chakra-ui/react"
76

87
import { BasePageProps, Lang, QuizKey, QuizStatus } from "@/lib/types"
98

@@ -17,6 +16,7 @@ import QuizzesList from "@/components/Quiz/QuizzesList"
1716
import QuizzesModal from "@/components/Quiz/QuizzesModal"
1817
import QuizzesStats from "@/components/Quiz/QuizzesStats"
1918
import { useLocalQuizData } from "@/components/Quiz/useLocalQuizData"
19+
import { Flex, HStack, Stack } from "@/components/ui/flex"
2020

2121
import { existsNamespace } from "@/lib/utils/existsNamespace"
2222
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
@@ -78,7 +78,7 @@ const QuizzesHubPage: NextPage<
7878
)
7979

8080
return (
81-
<Box as={MainArticle}>
81+
<MainArticle>
8282
<PageMetadata
8383
title={t("common:quizzes-title")}
8484
description={t("quizzes-subtitle")}
@@ -102,10 +102,10 @@ const QuizzesHubPage: NextPage<
102102
updateUserStats={updateUserStats}
103103
/>
104104
</QuizzesModal>
105-
<Box px={{ base: 0, lg: "8" }} py={{ base: 0, lg: "4" }} mb="12">
106-
<Flex direction={{ base: "column-reverse", lg: "row" }} columnGap="20">
107-
<Stack spacing="10" flex="1">
108-
<Box>
105+
<div className="mb-12 lg:px-8 lg:py-4">
106+
<Flex className="gap-x-20 max-lg:flex-col-reverse">
107+
<Stack className="flex-1 gap-10">
108+
<div>
109109
<QuizzesList
110110
content={ethereumBasicsQuizzes}
111111
headingId={t("basics")}
@@ -118,51 +118,39 @@ const QuizzesHubPage: NextPage<
118118
descriptionId={t("using-ethereum-description")}
119119
{...commonQuizListProps}
120120
/>
121-
</Box>
122-
<Flex
123-
direction={{ base: "column", xl: "row" }}
124-
justify="space-between"
125-
align="center"
126-
bg="background.highlight"
127-
borderRadius={{ lg: "lg" }}
128-
p="8"
129-
gap={{ base: "4", xl: 0 }}
130-
>
131-
<Box>
132-
<Text align={{ base: "center", xl: "left" }} fontWeight="bold">
133-
{t("want-more-quizzes")}
134-
</Text>
135-
136-
<Text align={{ base: "center", xl: "left" }}>
137-
{t("contribute")}
138-
</Text>
139-
</Box>
121+
</div>
122+
<Flex className="items-center justify-between bg-background-highlight p-8 max-xl:flex-col max-xl:gap-4 lg:rounded-lg">
123+
<div className="max-xl:text-center">
124+
<p className="font-bold">{t("want-more-quizzes")}</p>
125+
126+
<p>{t("contribute")}</p>
127+
</div>
140128
<ButtonLink
141129
href="/contributing/quizzes/"
142130
variant="outline"
143131
hideArrow
144132
onClick={handleGHAdd}
145133
>
146-
<Flex alignItems="center">
147-
<Icon as={FaGithub} color="text" boxSize={6} me={2} />
134+
<HStack className="gap-0">
135+
<FaGithub className="me-2 size-6 text-body" />
148136
{t("add-quiz")}
149-
</Flex>
137+
</HStack>
150138
</ButtonLink>
151139
</Flex>
152140
</Stack>
153-
<Box flex="1">
141+
<div className="flex-1">
154142
<QuizzesStats
155143
averageScoresArray={userStats.average}
156144
completedQuizzes={userStats.completed}
157145
totalCorrectAnswers={userStats.score}
158146
/>
159-
</Box>
147+
</div>
160148
</Flex>
161-
</Box>
162-
<Box w="full" py="4" px="8">
149+
</div>
150+
<div className="w-full px-8 py-4">
163151
<FeedbackCard />
164-
</Box>
165-
</Box>
152+
</div>
153+
</MainArticle>
166154
)
167155
}
168156

0 commit comments

Comments
 (0)