-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(app): refactor externallink stories (#14895)
* refactor(app): refactor externallink stories
- Loading branch information
1 parent
2dd0978
commit ca7e92c
Showing
2 changed files
with
22 additions
and
23 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 |
---|---|---|
@@ -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', | ||
}, | ||
} |
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