Skip to content

Commit

Permalink
feat: adds the avatar component to the storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
mouracamila committed Apr 14, 2022
1 parent 4eab30d commit e2f3a22
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/Avatar/Avatar.stories.tsx
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',
};
22 changes: 22 additions & 0 deletions src/components/AvatarGroup/AvatarGroup.stories.tsx
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 = {};

0 comments on commit e2f3a22

Please sign in to comment.