Skip to content

Commit d95cc10

Browse files
authored
Merge pull request #13982 from Baystef/feat/developerdocslinks-story
Create Story for DeveloperDocsLinks COmponent
2 parents 0f89bb7 + 1af7805 commit d95cc10

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.storybook/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const config: StorybookConfig = {
6161
if (imageRule) {
6262
imageRule["exclude"] = /\.svg$/
6363
}
64+
// Configure yaml files to be loaded with yaml-loader
65+
config.module.rules.push({
66+
test: /\.ya?ml$/,
67+
use: "yaml-loader",
68+
})
6469

6570
// Configure .svg files to be loaded with @svgr/webpack
6671
config.module.rules.push({
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Meta, StoryObj } from "@storybook/react"
2+
3+
import { langViewportModes } from "../../../.storybook/modes"
4+
5+
import DeveloperDocsLinksComponent from "."
6+
7+
const meta = {
8+
title: "Molecules / Navigation / DeveloperDocsLinks",
9+
component: DeveloperDocsLinksComponent,
10+
parameters: {
11+
layout: "fullscreen",
12+
chromatic: {
13+
modes: {
14+
...langViewportModes,
15+
},
16+
},
17+
},
18+
decorators: [
19+
(Story) => (
20+
<article className="max-w-3xl scroll-mt-24">
21+
<Story />
22+
</article>
23+
),
24+
],
25+
} satisfies Meta<typeof DeveloperDocsLinksComponent>
26+
27+
export default meta
28+
29+
type Story = StoryObj<typeof meta>
30+
31+
export const FoundationalTopics: Story = {
32+
args: {
33+
headerId: "foundational-topics",
34+
},
35+
}
36+
37+
export const EthereumStack: Story = {
38+
args: {
39+
headerId: "ethereum-stack",
40+
},
41+
}
42+
43+
export const Advanced: Story = {
44+
args: {
45+
headerId: "advanced",
46+
},
47+
}

src/components/DeveloperDocsLinks.tsx renamed to src/components/DeveloperDocsLinks/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import Translation from "@/components/Translation"
44

55
import docLinks from "@/data/developer-docs-links.yaml"
66

7-
import InlineLink from "./ui/Link"
8-
import { ListItem, UnorderedList } from "./ui/list"
7+
import InlineLink from "../ui/Link"
8+
import { ListItem, UnorderedList } from "../ui/list"
99

1010
export type DeveloperDocsLinksProps = {
1111
headerId: string

0 commit comments

Comments
 (0)