Skip to content

Commit c7f5f12

Browse files
authored
Merge pull request #13214 from TylerAPfledderer/feat/roadmapactioncard-story
feat(RoadmapActionCard): create story
2 parents 39b6692 + 3bc2485 commit c7f5f12

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

src/components/Glossary/GlossaryTooltip/index.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ 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"
76
import Tooltip, { type TooltipProps } from "@/components/Tooltip"
87
import Translation from "@/components/Translation"
98

@@ -15,10 +14,6 @@ type GlossaryTooltipProps = Omit<TooltipProps, "content"> & {
1514
termKey: string
1615
}
1716

18-
const components = {
19-
a: InlineLink,
20-
}
21-
2217
const GlossaryTooltip = ({
2318
children,
2419
termKey,
@@ -36,7 +31,6 @@ const GlossaryTooltip = ({
3631
<Translation
3732
id={termKey + "-term"}
3833
options={{ ns: "glossary-tooltip" }}
39-
transform={components}
4034
/>
4135
</Heading>
4236
{/**
@@ -49,7 +43,6 @@ const GlossaryTooltip = ({
4943
<Translation
5044
id={termKey + "-definition"}
5145
options={{ ns: "glossary-tooltip" }}
52-
transform={components}
5346
/>
5447
</Text>
5548
</VStack>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { Box, SimpleGrid } from "@chakra-ui/react"
2+
import type { Meta, StoryObj } from "@storybook/react"
3+
4+
import { ContentContainer } from "@/components/MdComponents"
5+
6+
import RoadmapActionCardComponent from "."
7+
8+
const meta = {
9+
title: "Molecules / Display Content / RoadmapActionCard",
10+
component: RoadmapActionCardComponent,
11+
decorators: [
12+
(Story) => (
13+
<Box maxW="1008px">
14+
<ContentContainer>
15+
<SimpleGrid columns={{ base: 1, md: 2 }} spacing={8}>
16+
<Story />
17+
</SimpleGrid>
18+
</ContentContainer>
19+
</Box>
20+
),
21+
],
22+
} satisfies Meta<typeof RoadmapActionCardComponent>
23+
24+
export default meta
25+
26+
export const RoadmapActionCard: StoryObj<typeof meta> = {
27+
args: {
28+
alt: "",
29+
to: "/roadmap/scaling",
30+
title: "Cheaper transactions",
31+
image: "scaling",
32+
description:
33+
"Rollups are too expensive and rely on centralized components, causing users to place too much trust in their operators. The roadmap includes fixes for both of these problems.",
34+
buttonText: "More on reducing fees",
35+
},
36+
render: (args) => (
37+
<>
38+
{Array.from({ length: 4 }).map((_, i) => (
39+
<RoadmapActionCardComponent key={i} {...args} />
40+
))}
41+
</>
42+
),
43+
}

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 TooltipLink from "./TooltipLink"
8+
import InlineLink from "./Link"
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: TooltipLink,
19+
a: InlineLink,
2020
}
2121

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

0 commit comments

Comments
 (0)