Skip to content

Commit b5e7da9

Browse files
authored
Merge pull request #13582 from ethereum/fix-glossary-tooltip
Fix glossary tooltip links
2 parents 196ed04 + 025578f commit b5e7da9

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/components/Glossary/GlossaryTooltip/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useRouter } from "next/router"
33
import { Box, Text, VStack } from "@chakra-ui/react"
44

55
import Heading from "@/components/Heading"
6+
import InlineLink from "@/components/Link"
67
import Tooltip, { type TooltipProps } from "@/components/Tooltip"
78
import Translation from "@/components/Translation"
89

@@ -31,6 +32,9 @@ const GlossaryTooltip = ({
3132
<Translation
3233
id={termKey + "-term"}
3334
options={{ ns: "glossary-tooltip" }}
35+
// Override the default `a` tag transformation to avoid circular
36+
// dependency issues
37+
transform={{ a: InlineLink }}
3438
/>
3539
</Heading>
3640
{/**
@@ -43,6 +47,9 @@ const GlossaryTooltip = ({
4347
<Translation
4448
id={termKey + "-definition"}
4549
options={{ ns: "glossary-tooltip" }}
50+
// Override the default `a` tag transformation to avoid circular
51+
// dependency issues
52+
transform={{ a: InlineLink }}
4653
/>
4754
</Text>
4855
</VStack>

src/components/Roadmap/RoadmapActionCard/RoadmapActionCard.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Box, SimpleGrid } from "@chakra-ui/react"
22
import type { Meta, StoryObj } from "@storybook/react"
33

4-
import { ContentContainer } from "@/components/MdComponents"
5-
64
import RoadmapActionCardComponent from "."
75

86
const meta = {
@@ -11,11 +9,11 @@ const meta = {
119
decorators: [
1210
(Story) => (
1311
<Box maxW="1008px">
14-
<ContentContainer>
12+
<div>
1513
<SimpleGrid columns={{ base: 1, md: 2 }} spacing={8}>
1614
<Story />
1715
</SimpleGrid>
18-
</ContentContainer>
16+
</div>
1917
</Box>
2018
),
2119
],

src/components/Translation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTranslation } from "next-i18next"
55

66
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
77

8-
import InlineLink from "./Link"
8+
import TooltipLink from "./TooltipLink"
99

1010
type TranslationProps = {
1111
id: string
@@ -16,7 +16,7 @@ type TranslationProps = {
1616
// Custom components mapping to be used by `htmr` when parsing the translation
1717
// text
1818
const defaultTransform = {
19-
a: InlineLink,
19+
a: TooltipLink,
2020
}
2121

2222
// Renders the translation string for the given translation key `id`. It

0 commit comments

Comments
 (0)