-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [M3-8171] - Add CheckoutSummary Story
- Loading branch information
1 parent
f787b09
commit 87bf3fb
Showing
2 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
packages/manager/src/components/CheckoutSummary/CheckoutSummary.stories.tsx
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,55 @@ | ||
import React from 'react'; | ||
|
||
import { Typography } from 'src/components/Typography'; | ||
|
||
import { CheckoutSummary } from './CheckoutSummary'; | ||
|
||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
|
||
type Story = StoryObj<typeof CheckoutSummary>; | ||
|
||
const Item = ({ children }: { children?: React.ReactNode }) => ( | ||
<Typography sx={{ fontStyle: 'italic', marginTop: '1em' }}> | ||
{children} | ||
</Typography> | ||
); | ||
|
||
const defaultArgs = { | ||
displaySections: [ | ||
{ title: 'Debian 11' }, | ||
{ details: '$36/month', title: 'Dedicated 4GB' }, | ||
], | ||
heading: 'Checkout Summary', | ||
}; | ||
|
||
const meta: Meta<typeof CheckoutSummary> = { | ||
component: CheckoutSummary, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ margin: '2em' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
title: 'Components/CheckoutSummary', | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Default: Story = { | ||
args: defaultArgs, | ||
}; | ||
|
||
export const WithAgreement: Story = { | ||
args: { | ||
...defaultArgs, | ||
agreement: <Item>Agreement item can go here!</Item>, | ||
}, | ||
}; | ||
|
||
export const WithChildren: Story = { | ||
args: { | ||
...defaultArgs, | ||
children: <Item>Child items can go here!</Item>, | ||
}, | ||
}; |
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