Skip to content

Commit 57897fb

Browse files
use storybook Component Story Format 3
1 parent 24d4a93 commit 57897fb

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
import { space } from '@guardian/source/foundations';
2-
import type { StoryFn } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react';
32
import { ProductLinkButton } from './ProductLinkButton';
43

5-
export default {
4+
const meta = {
65
component: ProductLinkButton,
76
title: 'Components/ProductLinkButton',
8-
decorators: [
9-
(Story: StoryFn) => (
10-
<div style={{ padding: `${space[3]}px` }}>
11-
<Story />
12-
</div>
13-
),
14-
],
15-
};
7+
parameters: {
8+
layout: 'padded',
9+
},
10+
args: {
11+
label: '£6.50 for 350g at Ollie’s Kimchi',
12+
url: 'https://ollieskimchi.co.uk/shop/ols/products/ollies-kimchi',
13+
},
14+
} satisfies Meta<typeof ProductLinkButton>;
1615

17-
export const ProductLinkButtonStory = () => {
18-
return (
19-
<ProductLinkButton
20-
label="£6.50 for 350g at Ollie’s Kimchi"
21-
url="https://ollieskimchi.co.uk/shop/ols/products/ollies-kimchi"
22-
/>
23-
);
24-
};
16+
export default meta;
17+
18+
type Story = StoryObj<typeof meta>;
19+
20+
export const Default = {} satisfies Story;

0 commit comments

Comments
 (0)