2022-10-07 17:53:40 +02:00
|
|
|
import React from 'react';
|
|
|
|
import Box from '../../ui/box/box';
|
|
|
|
import {
|
2023-02-02 21:15:26 +01:00
|
|
|
AlignItems,
|
2022-10-07 17:53:40 +02:00
|
|
|
DISPLAY,
|
2023-02-02 21:15:26 +01:00
|
|
|
Size,
|
2022-10-07 17:53:40 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
import { AvatarAccount } from './avatar-account';
|
2023-01-10 01:38:43 +01:00
|
|
|
import {
|
|
|
|
AVATAR_ACCOUNT_TYPES,
|
|
|
|
AVATAR_ACCOUNT_SIZES,
|
|
|
|
} from './avatar-account.constants';
|
2022-10-07 17:53:40 +02:00
|
|
|
|
|
|
|
import README from './README.mdx';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ComponentLibrary/AvatarAccount',
|
2023-01-20 20:27:46 +01:00
|
|
|
|
2022-10-07 17:53:40 +02:00
|
|
|
component: AvatarAccount,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
size: {
|
|
|
|
control: 'select',
|
2023-01-10 01:38:43 +01:00
|
|
|
options: Object.values(AVATAR_ACCOUNT_SIZES),
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
|
|
|
address: { control: 'text' },
|
|
|
|
type: {
|
|
|
|
control: 'select',
|
2023-01-10 01:38:43 +01:00
|
|
|
options: Object.values(AVATAR_ACCOUNT_TYPES),
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
args: {
|
|
|
|
address: '0x5CfE73b6021E818B776b421B1c4Db2474086a7e1',
|
2023-02-02 21:15:26 +01:00
|
|
|
size: Size.MD,
|
2023-01-10 01:38:43 +01:00
|
|
|
type: AVATAR_ACCOUNT_TYPES.JAZZICON,
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const DefaultStory = (args) => <AvatarAccount {...args} />;
|
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
2023-02-02 21:15:26 +01:00
|
|
|
export const SizeStory = (args) => (
|
|
|
|
<Box display={DISPLAY.FLEX} alignItems={AlignItems.baseline} gap={1}>
|
|
|
|
<AvatarAccount {...args} size={Size.XS} />
|
|
|
|
<AvatarAccount {...args} size={Size.SM} />
|
|
|
|
<AvatarAccount {...args} size={Size.MD} />
|
|
|
|
<AvatarAccount {...args} size={Size.LG} />
|
|
|
|
<AvatarAccount {...args} size={Size.XL} />
|
2022-10-07 17:53:40 +02:00
|
|
|
</Box>
|
|
|
|
);
|
2023-02-02 21:15:26 +01:00
|
|
|
SizeStory.storyName = 'Size';
|
2022-10-07 17:53:40 +02:00
|
|
|
|
|
|
|
export const Type = (args) => (
|
2023-02-02 21:15:26 +01:00
|
|
|
<Box display={DISPLAY.FLEX} alignItems={AlignItems.baseline} gap={1}>
|
2023-01-10 01:38:43 +01:00
|
|
|
<AvatarAccount {...args} type={AVATAR_ACCOUNT_TYPES.JAZZICON} />
|
|
|
|
<AvatarAccount {...args} type={AVATAR_ACCOUNT_TYPES.BLOCKIES} />
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const Address = (args) => (
|
2023-02-02 21:15:26 +01:00
|
|
|
<Box display={DISPLAY.FLEX} alignItems={AlignItems.BASELINE} gap={1}>
|
2023-01-10 01:38:43 +01:00
|
|
|
<AvatarAccount
|
|
|
|
{...args}
|
|
|
|
type={AVATAR_ACCOUNT_TYPES.JAZZICON}
|
|
|
|
address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1"
|
|
|
|
/>
|
|
|
|
<AvatarAccount
|
|
|
|
{...args}
|
|
|
|
type={AVATAR_ACCOUNT_TYPES.BLOCKIES}
|
|
|
|
address="0x0"
|
|
|
|
/>
|
2022-10-07 17:53:40 +02:00
|
|
|
</Box>
|
|
|
|
);
|