Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(app): refactor externallink stories #14895

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading