forked from ethereum/ethereum-org-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added story for DocLink component [resolves ethereum#14595]
- Loading branch information
1 parent
a86e174
commit 6d75cc7
Showing
2 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import * as React from "react" | ||
import { VStack } from "@chakra-ui/react" | ||
import { Meta, StoryObj } from "@storybook/react" | ||
|
||
import DocLink from "." | ||
|
||
const meta = { | ||
title: "Atoms / DocLink", | ||
component: DocLink, | ||
tags: ["autodocs"], | ||
} satisfies Meta<typeof DocLink> | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = { | ||
args: { | ||
href: "/history/", | ||
children: "History of Ethereum", | ||
}, | ||
render: (args) => ( | ||
<VStack spacing={4} align="stretch"> | ||
<DocLink {...args} /> | ||
</VStack> | ||
), | ||
} | ||
|
||
export const ExternalLink: Story = { | ||
args: { | ||
href: "https://ethereum.org", | ||
children: "Ethereum Website", | ||
isExternal: true, | ||
}, | ||
render: (args) => ( | ||
<VStack spacing={4} align="stretch"> | ||
<DocLink {...args} /> | ||
</VStack> | ||
), | ||
} | ||
|
||
export const MultipleLinks: Story = { | ||
args: { | ||
href: "#", | ||
}, | ||
render: () => ( | ||
<VStack spacing={4} align="stretch"> | ||
<DocLink href="/history/">History of Ethereum</DocLink> | ||
<DocLink href="https://ethereum.org" isExternal> | ||
Ethereum Website | ||
</DocLink> | ||
<DocLink href="/developers/docs/intro-to-ethereum/"> | ||
Introduction to Ethereum | ||
</DocLink> | ||
</VStack> | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters