Skip to content

Commit 900622e

Browse files
committed
Add storybook for Avatar
1 parent 1cb58da commit 900622e

File tree

2 files changed

+58
-10
lines changed

2 files changed

+58
-10
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Story } from "@storybook/react"
2+
import { Avatar, AvatarProps } from "./Avatar"
3+
import PauseIcon from "@material-ui/icons/PauseOutlined"
4+
5+
export default {
6+
title: "components/Avatar",
7+
component: Avatar,
8+
}
9+
10+
const Template: Story<AvatarProps> = (args: AvatarProps) => <Avatar {...args} />
11+
12+
export const Letter = Template.bind({})
13+
Letter.args = {
14+
children: "Coder",
15+
}
16+
17+
export const LetterXL = Template.bind({})
18+
LetterXL.args = {
19+
children: "Coder",
20+
size: "xl",
21+
}
22+
23+
export const LetterDarken = Template.bind({})
24+
LetterDarken.args = {
25+
children: "Coder",
26+
colorScheme: "darken",
27+
}
28+
29+
export const Image = Template.bind({})
30+
Image.args = {
31+
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
32+
}
33+
34+
export const ImageXL = Template.bind({})
35+
ImageXL.args = {
36+
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
37+
size: "xl",
38+
}
39+
40+
export const MuiIcon = Template.bind({})
41+
MuiIcon.args = {
42+
children: <PauseIcon />,
43+
}
44+
45+
export const MuiIconDarken = Template.bind({})
46+
MuiIconDarken.args = {
47+
children: <PauseIcon />,
48+
colorScheme: "darken",
49+
}
50+
51+
export const MuiIconXL = Template.bind({})
52+
MuiIconXL.args = {
53+
children: <PauseIcon />,
54+
size: "xl",
55+
}

site/src/components/AvatarData/AvatarData.stories.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@ Example.args = {
1616
subtitle: "coder@coder.com",
1717
}
1818

19-
export const WithHighlightTitle = Template.bind({})
20-
WithHighlightTitle.args = {
19+
export const WithImage = Template.bind({})
20+
WithImage.args = {
2121
title: "coder",
2222
subtitle: "coder@coder.com",
23-
highlightTitle: true,
24-
}
25-
26-
export const WithLink = Template.bind({})
27-
WithLink.args = {
28-
title: "coder",
29-
subtitle: "coder@coder.com",
30-
link: "/users/coder",
23+
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
3124
}

0 commit comments

Comments
 (0)