Skip to content

Commit 1e43257

Browse files
committed
Refactor AvatarData and its stories
1 parent 848167d commit 1e43257

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import { Story } from "@storybook/react";
2-
import { AvatarData, AvatarDataProps } from "./AvatarData";
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import { AvatarData } from "./AvatarData";
33

4-
export default {
4+
const meta: Meta<typeof AvatarData> = {
55
title: "components/AvatarData",
66
component: AvatarData,
7+
args: {
8+
title: "coder",
9+
subtitle: "coder@coder.com",
10+
},
711
};
812

9-
const Template: Story<AvatarDataProps> = (args: AvatarDataProps) => (
10-
<AvatarData {...args} />
11-
);
13+
export default meta;
14+
type Story = StoryObj<typeof AvatarData>;
1215

13-
export const Example = Template.bind({});
14-
Example.args = {
15-
title: "coder",
16-
subtitle: "coder@coder.com",
17-
};
16+
export const WithTitleAndSubtitle: Story = {};
1817

19-
export const WithImage = Template.bind({});
20-
WithImage.args = {
21-
title: "coder",
22-
subtitle: "coder@coder.com",
23-
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
18+
export const WithImage: Story = {
19+
args: {
20+
src: "https://AvatarDatas.githubusercontent.com/u/95932066?s=200&v=4",
21+
},
2422
};

0 commit comments

Comments
 (0)