Skip to content

Commit

Permalink
refactor(app): refactor externallink stories (#14895)
Browse files Browse the repository at this point in the history
* refactor(app): refactor externallink stories
  • Loading branch information
koji authored and Carlos-fernandez committed May 20, 2024
1 parent 2dd0978 commit ca7e92c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
36 changes: 20 additions & 16 deletions app/src/atoms/Link/ExternalLink.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import * as React from 'react'
import { Flex, COLORS } from '@opentrons/components'
import { ExternalLink } from './ExternalLink'
import { COLORS, Flex, SPACING } from '@opentrons/components'
import { ExternalLink as ExternalLinkComponent } from './ExternalLink'

import type { Story, Meta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
const meta: Meta<typeof ExternalLinkComponent> = {
title: 'App/Atoms/ExternalLink',
component: ExternalLink,
} as Meta

const Template: Story<React.ComponentProps<typeof ExternalLink>> = args => (
<Flex backgroundColor={COLORS.grey10}>
<ExternalLink {...args} />
</Flex>
)
component: ExternalLinkComponent,
decorators: [
Story => (
<Flex backgroundColor={COLORS.grey10} padding={SPACING.spacing16}>
<Story />
</Flex>
),
],
}
export default meta
type Story = StoryObj<typeof ExternalLinkComponent>

export const Primary = Template.bind({})
Primary.args = {
href: 'https://www.opentrons.com',
children: 'Open the link',
export const ExternalLink: Story = {
args: {
href: 'https://www.opentrons.com',
children: 'Open the link',
},
}
9 changes: 2 additions & 7 deletions app/src/atoms/Link/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import * as React from 'react'

import {
Link,
LinkProps,
Icon,
TYPOGRAPHY,
SPACING,
} from '@opentrons/components'
import { Link, Icon, TYPOGRAPHY, SPACING } from '@opentrons/components'
import type { LinkProps } from '@opentrons/components'

export interface ExternalLinkProps extends LinkProps {
href: string
Expand Down

0 comments on commit ca7e92c

Please sign in to comment.