Skip to content

Commit f511fd5

Browse files
committed
apply suggestions from code review
fix missing i18n string for Bug Bounty breadcrumb text
1 parent c323e3f commit f511fd5

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

src/components/Breadcrumbs/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Breadcrumbs = ({
3838
startDepth = 0,
3939
...props
4040
}: BreadcrumbsProps) => {
41-
const { t } = useTranslation("page-index")
41+
const { t } = useTranslation(["common", "page-index"])
4242
const { locale, asPath } = useRouter()
4343

4444
const hasHome = asPath !== "/"
@@ -57,12 +57,10 @@ const Breadcrumbs = ({
5757
]
5858
: []),
5959
,
60-
...sliced.map((path, idx) => {
61-
return {
62-
fullPath: slugChunk.slice(0, idx + 2).join("/") + "/",
63-
text: t(path), // TODO: fix i18n strings for path breadcrumbs
64-
}
65-
}),
60+
...sliced.map((path, idx) => ({
61+
fullPath: slugChunk.slice(0, idx + 2).join("/") + "/",
62+
text: t(path),
63+
})),
6664
]
6765
.filter((item): item is Crumb => !!item)
6866
.slice(startDepth)

src/components/Leaderboard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import Emoji from "@/components/Emoji"
1515
import { BaseLink } from "@/components/Link"
1616

17-
import { GITHUB_ROOT } from "@/lib/constants"
17+
import { GITHUB_URL } from "@/lib/constants"
1818

1919
import { useRtlFlip } from "@/hooks/useRtlFlip"
2020

@@ -60,7 +60,7 @@ const Leaderboard = ({ content, limit = 100 }: LeaderboardProps) => {
6060
.map(({ name, username, score }, idx) => {
6161
const hasGitHub = !!username
6262
const avatarImg =
63-
GITHUB_ROOT + (username || "random") + ".png?size=40"
63+
GITHUB_URL + (username || "random") + ".png?size=40"
6464
const avatarAlt = hasGitHub ? `${username} GitHub avatar` : ""
6565

6666
let emoji: string | null = null
@@ -104,7 +104,7 @@ const Leaderboard = ({ content, limit = 100 }: LeaderboardProps) => {
104104
<Flex flex="1 1 75%" direction="column" me={8}>
105105
<LinkOverlay
106106
as={BaseLink}
107-
href={hasGitHub ? `${GITHUB_ROOT}${username}` : "#"}
107+
href={hasGitHub ? `${GITHUB_URL}${username}` : "#"}
108108
textDecor="none"
109109
color="text"
110110
hideArrow

src/intl/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"aria-toggle-menu-button": "Toggle menu button",
1616
"beacon-chain": "Beacon Chain",
1717
"bridges": "Blockchain bridges",
18+
"bug-bounty": "Bug bounty",
1819
"clear": "Clear",
1920
"close": "Close",
2021
"community": "Community",

src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const CONTENT_IMAGES_MAX_WIDTH = 800
2525
export const GITHUB_BASE_API =
2626
"https://api.github.com/repos/ethereum/ethereum-org-website"
2727
export const GITHUB_COMMITS_URL = GITHUB_BASE_API + "/commits"
28-
export const GITHUB_ROOT = `https://github.com/`
28+
export const GITHUB_URL = `https://github.com/`
2929

3030
// Quiz Hub
3131
export const PROGRESS_BAR_GAP = "4px"

0 commit comments

Comments
 (0)