Skip to content

Commit

Permalink
Added story for DocLink component [resolves ethereum#14595]
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandriaroberts committed Jan 9, 2025
1 parent a86e174 commit 6d75cc7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
57 changes: 57 additions & 0 deletions src/components/DocLink/DocLink.stories.tsx
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>
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { AiOutlineArrowRight } from "react-icons/ai"

import { cn } from "@/lib/utils/cn"

import { Center, Flex, Stack } from "./ui/flex"
import { LinkBox, LinkOverlay } from "./ui/link-box"
import Emoji from "./Emoji"
import Emoji from "../Emoji"
import { Center, Flex, Stack } from "../ui/flex"
import { LinkBox, LinkOverlay } from "../ui/link-box"

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

Expand Down

0 comments on commit 6d75cc7

Please sign in to comment.