Skip to content

Commit bddc0f6

Browse files
committed
convert quizzes home hero
1 parent 6930d2c commit bddc0f6

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed
788 KB
Loading

src/pages/quizzes.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { useTranslation } from "gatsby-plugin-react-i18next"
55
import { FaGithub } from "react-icons/fa"
66

77
import ButtonLink from "../components/Buttons/ButtonLink"
8-
import PageHero from "../components/PageHero"
98
import PageMetadata from "../components/PageMetadata"
109
import Translation from "../components/Translation"
1110
import FeedbackCard from "../components/FeedbackCard"
11+
import HubHero from "../components/Hero/HubHero"
1212
import QuizWidget from "../components/Quiz/QuizWidget"
1313
import QuizzesList from "../components/Quiz/QuizzesList"
1414
import QuizzesModal from "../components/Quiz/QuizzesModal"
@@ -65,14 +65,6 @@ const QuizzesHubPage = ({ data }: PageProps<Queries.QuizzesHubPageQuery>) => {
6565

6666
const { t } = useTranslation()
6767

68-
const heroContent = {
69-
title: <Translation id="quizzes-title" />,
70-
header: <Translation id="test-your-knowledge" />,
71-
subtitle: <Translation id="quizzes-subtitle" />,
72-
image: getImage(data.doge)!,
73-
alt: t("quizzes-title"),
74-
}
75-
7668
const contextState = {
7769
status: quizStatus,
7870
quizKey: currentQuiz,
@@ -90,9 +82,13 @@ const QuizzesHubPage = ({ data }: PageProps<Queries.QuizzesHubPageQuery>) => {
9082
title={t("quizzes-title")}
9183
description={t("quizzes-subtitle")}
9284
/>
93-
<Box w="100%" bg="layer2Gradient" pb={8}>
94-
<PageHero content={heroContent} isReverse />
95-
</Box>
85+
86+
<HubHero
87+
heroImgSrc={getImage(data.heroImage)!}
88+
header={t("test-your-knowledge")}
89+
title={t("quizzes-title")}
90+
description={t("quizzes-subtitle")}
91+
/>
9692

9793
<QuizzesHubContext.Provider value={contextState}>
9894
<QuizzesModal isOpen={isOpen} onClose={onClose}>
@@ -223,7 +219,7 @@ export const query = graphql`
223219
}
224220
}
225221
}
226-
doge: file(relativePath: { eq: "doge-computer.png" }) {
222+
heroImage: file(relativePath: { eq: "heroes/quizzes-hub-hero.png" }) {
227223
childImageSharp {
228224
gatsbyImageData(
229225
width: 624

0 commit comments

Comments
 (0)