Skip to content

Commit b3fe127

Browse files
authored
Merge branch 'dev' into get-eth-page
2 parents f3e40fb + 69c9e28 commit b3fe127

37 files changed

+2599
-1162
lines changed

public/favicon.ico

-25.3 KB
Binary file not shown.

src/components/MarkdownImage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { extname } from "path"
2+
13
import { Flex } from "@chakra-ui/react"
24

35
import { Image, type ImageProps } from "@/components/Image"
@@ -34,6 +36,9 @@ const MarkdownImage = ({
3436
imageHeight = CONTENT_IMAGES_MAX_WIDTH / imageAspectRatio
3537
}
3638

39+
const fileExt = extname(transformedSrc).toLowerCase()
40+
const isAnimated = [".gif", ".apng", ".webp"].includes(fileExt)
41+
3742
return (
3843
// display the wrapper as a `span` to avoid dom nesting warnings as mdx
3944
// sometimes wraps images in `p` tags
@@ -45,6 +50,7 @@ const MarkdownImage = ({
4550
height={imageHeight}
4651
loading="lazy"
4752
src={transformedSrc}
53+
unoptimized={isAnimated}
4854
{...rest}
4955
/>
5056
</Link>

src/components/PageMetadata.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ const PageMetadata: React.FC<IProps> = ({
9898
/>
9999
))}
100100
<link rel="canonical" key={canonical} href={canonical} />
101-
{/* favicon */}
102-
<link rel="icon" type="image/x-icon" href="favicon.ico" />
103-
{/* TODO: Add manifest */}
104-
{/* <link rel="manifest" href="/manifest.json" /> */}
105101
</Head>
106102
)
107103
}

src/components/Quiz/QuizItem.tsx

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,29 @@
1-
import { useContext } from "react"
21
import { useTranslation } from "next-i18next"
32
import { Box, Flex, ListItem, Stack, Text } from "@chakra-ui/react"
43

5-
import allQuizzesData from "../../data/quizzes"
6-
import { QuizzesListItem } from "../../types"
7-
import { trackCustomEvent } from "../../utils/matomo"
4+
import type { QuizzesSection } from "@/lib/types"
5+
86
import { Button } from "../Buttons"
97
import { GreenTickIcon } from "../icons/quiz"
108
import Tag from "../Tag"
119
import Translation from "../Translation"
1210

13-
import { QuizzesHubContext } from "./context"
14-
15-
const QuizItem: React.FC<QuizzesListItem> = (props) => {
16-
const { id, level, quizHandler, modalHandler } = props
17-
const {
18-
userStats: { completed },
19-
} = useContext(QuizzesHubContext)
20-
const numberOfQuestions = allQuizzesData[id].questions.length
21-
const isCompleted = JSON.parse(completed)[id][0]
11+
export type QuizzesListItemProps = Omit<QuizzesSection, "id"> & {
12+
isCompleted: boolean
13+
numberOfQuestions: number
14+
titleId: string
15+
handleStart: () => void
16+
}
2217

18+
const QuizItem = ({
19+
level,
20+
isCompleted = false,
21+
titleId,
22+
numberOfQuestions,
23+
handleStart,
24+
}: QuizzesListItemProps) => {
2325
const { t } = useTranslation("learn-quizzes")
2426

25-
const handleStart = () => {
26-
quizHandler(id)
27-
modalHandler(true)
28-
29-
trackCustomEvent({
30-
eventCategory: "quiz_hub_events",
31-
eventAction: "quizzes click",
32-
eventName: `${id}`,
33-
})
34-
}
35-
3627
return (
3728
<ListItem
3829
color={isCompleted ? "body.medium" : "text"}
@@ -57,7 +48,7 @@ const QuizItem: React.FC<QuizzesListItem> = (props) => {
5748
content: 'counter(list-counter) ". "',
5849
}}
5950
>
60-
<Translation id={allQuizzesData[id].title} />
51+
<Translation id={titleId} />
6152
</Text>
6253

6354
{/* Show green tick if quizz was completed only */}
@@ -84,7 +75,7 @@ const QuizItem: React.FC<QuizzesListItem> = (props) => {
8475
w={{ base: "full", lg: "auto" }}
8576
onClick={handleStart}
8677
>
87-
<Translation id="start" />
78+
<Translation id="learn-quizzes:start" />
8879
</Button>
8980
</Box>
9081
</Flex>

src/components/Quiz/QuizRadioGroup.tsx

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/components/Quiz/QuizSummary.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)