-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds the avatar component to the storybook
- Loading branch information
1 parent
4eab30d
commit e2f3a22
Showing
2 changed files
with
38 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Meta, Story } from '@storybook/react/types-6-0'; | ||
|
||
import { Avatar, AvatarProps } from '.'; | ||
|
||
export default { | ||
title: 'Components/Avatar', | ||
component: Avatar, | ||
} as Meta; | ||
|
||
const Template: Story<AvatarProps> = (args) => <Avatar {...args} />; | ||
|
||
export const DefaultAvatar = Template.bind({}); | ||
DefaultAvatar.storyName = 'Default'; | ||
DefaultAvatar.args = { | ||
img: 'https://i.pravatar.cc/100', | ||
}; |
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,22 @@ | ||
import { Meta, Story } from '@storybook/react/types-6-0'; | ||
import { AvatarGroup, AvatarGroupProps } from '../AvatarGroup'; | ||
import { Avatar } from '../Avatar'; | ||
|
||
export default { | ||
title: 'Components/AvatarGroup', | ||
component: AvatarGroup, | ||
} as Meta; | ||
|
||
const Template: Story<AvatarGroupProps> = (args) => ( | ||
<AvatarGroup {...args}> | ||
<Avatar img="https://i.pravatar.cc/100" rounded stacked /> | ||
<Avatar img="https://i.pravatar.cc/100" rounded stacked /> | ||
<Avatar img="https://i.pravatar.cc/100" rounded stacked /> | ||
<Avatar img="https://i.pravatar.cc/100" rounded stacked /> | ||
<AvatarGroup.Counter total={99} href="#" /> | ||
</AvatarGroup> | ||
); | ||
|
||
export const DefaultAvatarGroup = Template.bind({}); | ||
DefaultAvatarGroup.storyName = 'Default'; | ||
DefaultAvatarGroup.args = {}; |