Skip to content

Commit 99c2421

Browse files
authored
Merge pull request #221 from ethereum/remaining-todos
Remaining small TODOs
2 parents 2d4e990 + f2e8a8b commit 99c2421

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

src/components/Codeblock.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { useEffect, useState } from "react"
1+
import React, { useState } from "react"
2+
import { useTranslation } from "next-i18next"
23
import Highlight, {
34
defaultProps,
45
Language,
@@ -9,9 +10,9 @@ import { Box, BoxProps, Flex, useColorModeValue } from "@chakra-ui/react"
910

1011
import CopyToClipboard from "@/components/CopyToClipboard"
1112
import Emoji from "@/components/Emoji"
12-
1313
// https://github.com/FormidableLabs/prism-react-renderer/tree/master#custom-language-support
14-
;(typeof global !== "undefined" ? global : window).Prism = Prism
14+
;
15+
(typeof global !== "undefined" ? global : window).Prism = Prism
1516
require("prismjs/components/prism-solidity")
1617

1718
const LINES_BEFORE_COLLAPSABLE = 8
@@ -217,6 +218,7 @@ const Codeblock: React.FC<IProps> = ({
217218
codeLanguage,
218219
fromHomepage = false,
219220
}) => {
221+
const { t } = useTranslation('common')
220222
const selectedTheme = useColorModeValue(codeTheme.light, codeTheme.dark)
221223

222224
const codeText = React.Children.toArray(children)
@@ -321,13 +323,9 @@ const Codeblock: React.FC<IProps> = ({
321323
totalLines - 1 > LINES_BEFORE_COLLAPSABLE && (
322324
<TopBarItem onClick={() => setIsCollapsed(!isCollapsed)}>
323325
{isCollapsed ? (
324-
// TODO: Implement after intl
325-
// <Translation id="show-all" />
326-
<>Show all</>
326+
t("show-all")
327327
) : (
328-
// TODO: Implement after intl
329-
// <Translation id="show-less" />
330-
<>Show less</>
328+
t("show-less")
331329
)}
332330
</TopBarItem>
333331
)}
@@ -338,16 +336,12 @@ const Codeblock: React.FC<IProps> = ({
338336
{!isCopied ? (
339337
<>
340338
<Emoji text=":clipboard:" fontSize="md" />{" "}
341-
{/* TODO: Implement after intl */}
342-
{/* <Translation id="copy" /> */}
343-
Copy
339+
{t("copy")}
344340
</>
345341
) : (
346342
<>
347343
<Emoji text=":white_check_mark:" fontSize="md" />{" "}
348-
{/* TODO: Implement after intl */}
349-
{/* <Translation id="copied" /> */}
350-
Copied
344+
{t("copied")}
351345
</>
352346
)}
353347
</TopBarItem>

src/components/ExpandableCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ExpandableCard = ({
3434
eventName = "",
3535
}: ExpandableCardProps) => {
3636
const [isVisible, setIsVisible] = useState(false)
37-
const { t } = useTranslation("common") // TODO: Double-check namespace
37+
const { t } = useTranslation("common")
3838
const matomo = {
3939
eventAction,
4040
eventCategory: `ExpandableCard${eventCategory}`,

src/components/Staking/StakingProductsCardGrid.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
UnknownProductGlyphIcon,
2626
WarningProductGlyphIcon,
2727
} from "@/components/icons/staking"
28-
import Translation from "@/components/Translation"
2928

3029
import { MatomoEventOptions } from "@/lib/utils/matomo"
3130

@@ -276,8 +275,7 @@ const StakingProductCard: React.FC<ICardProps> = ({
276275
</List>
277276
</Box>
278277
<Box {...PADDED_DIV_STYLE}>
279-
{/* TODO: Matomo - re-enable */}
280-
<ButtonLink to={url} /* customEventOptions={matomo} */ width="100%">
278+
<ButtonLink to={url} customEventOptions={matomo} width="100%">
281279
{t("page-staking-products-get-started")}
282280
</ButtonLink>
283281
</Box>

src/components/UpcomingEventsList.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ import { Box } from "@chakra-ui/react"
33

44
import Translation from "@/components/Translation"
55

6+
import { trackCustomEvent } from "@/lib/utils/matomo"
7+
68
import events from "../data/community-events.json"
79

810
import { Button } from "./Buttons"
911
import EventCard from "./EventCard"
1012
import InfoBanner from "./InfoBanner"
1113
import InlineLink from "./Link"
1214

13-
// TODO: add trackCustomEvent when util is migrated
14-
// import { trackCustomEvent } from "../utils/matomo"
15-
1615
interface ICommunityEventData {
1716
title: string
1817
to: string
@@ -88,12 +87,11 @@ const UpcomingEventsList: React.FC = () => {
8887
const loadMoreEvents = () => {
8988
setMaxRange((counter) => counter + eventsPerLoad)
9089
setIsVisible(maxRange + eventsPerLoad <= orderedUpcomingEvents.length)
91-
// TODO: add trackCustomEvent when util is migrated
92-
// trackCustomEvent({
93-
// eventCategory: "more events button",
94-
// eventAction: "click",
95-
// eventName: "load more",
96-
// })
90+
trackCustomEvent({
91+
eventCategory: "more events button",
92+
eventAction: "click",
93+
eventName: "load more",
94+
})
9795
}
9896

9997
if (orderedUpcomingEvents.length === 0) {

0 commit comments

Comments
 (0)