2022-10-07 17:53:40 +02:00
|
|
|
import React from 'react';
|
2023-08-01 23:19:32 +02:00
|
|
|
import { StoryFn, Meta } from '@storybook/react';
|
|
|
|
import { Box } from '../box';
|
|
|
|
import { AlignItems, Display } from '../../../helpers/constants/design-system';
|
2022-10-07 17:53:40 +02:00
|
|
|
import { AvatarAccount } from './avatar-account';
|
2023-01-10 01:38:43 +01:00
|
|
|
import {
|
2023-03-10 21:12:55 +01:00
|
|
|
AvatarAccountVariant,
|
|
|
|
AvatarAccountSize,
|
|
|
|
} from './avatar-account.types';
|
2022-10-07 17:53:40 +02:00
|
|
|
|
|
|
|
import README from './README.mdx';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ComponentLibrary/AvatarAccount',
|
|
|
|
component: AvatarAccount,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
size: {
|
|
|
|
control: 'select',
|
2023-08-01 23:19:32 +02:00
|
|
|
options: Object.values(AvatarAccountSize),
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
|
|
|
address: { control: 'text' },
|
2023-03-10 21:12:55 +01:00
|
|
|
variant: {
|
2022-10-07 17:53:40 +02:00
|
|
|
control: 'select',
|
2023-03-10 21:12:55 +01:00
|
|
|
options: Object.values(AvatarAccountVariant),
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
args: {
|
|
|
|
address: '0x5CfE73b6021E818B776b421B1c4Db2474086a7e1',
|
2023-03-10 21:12:55 +01:00
|
|
|
size: AvatarAccountSize.Md,
|
|
|
|
variant: AvatarAccountVariant.Jazzicon,
|
2022-10-07 17:53:40 +02:00
|
|
|
},
|
2023-08-01 23:19:32 +02:00
|
|
|
} as Meta<typeof AvatarAccount>;
|
2022-10-07 17:53:40 +02:00
|
|
|
|
|
|
|
export const DefaultStory = (args) => <AvatarAccount {...args} />;
|
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
2023-08-01 23:19:32 +02:00
|
|
|
export const Size: StoryFn<typeof AvatarAccount> = (args) => (
|
|
|
|
<Box display={Display.Flex} alignItems={AlignItems.baseline} gap={1}>
|
2023-03-10 21:12:55 +01:00
|
|
|
<AvatarAccount {...args} size={AvatarAccountSize.Xs} />
|
|
|
|
<AvatarAccount {...args} size={AvatarAccountSize.Sm} />
|
|
|
|
<AvatarAccount {...args} size={AvatarAccountSize.Md} />
|
|
|
|
<AvatarAccount {...args} size={AvatarAccountSize.Lg} />
|
|
|
|
<AvatarAccount {...args} size={AvatarAccountSize.Xl} />
|
2022-10-07 17:53:40 +02:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
|
2023-08-01 23:19:32 +02:00
|
|
|
export const Variant: StoryFn<typeof AvatarAccount> = (args) => (
|
|
|
|
<Box display={Display.Flex} alignItems={AlignItems.baseline} gap={1}>
|
2023-03-10 21:12:55 +01:00
|
|
|
<AvatarAccount {...args} variant={AvatarAccountVariant.Jazzicon} />
|
|
|
|
<AvatarAccount {...args} variant={AvatarAccountVariant.Blockies} />
|
2023-01-10 01:38:43 +01:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
|
2023-08-01 23:19:32 +02:00
|
|
|
export const Address: StoryFn<typeof AvatarAccount> = (args) => (
|
|
|
|
<Box display={Display.Flex} alignItems={AlignItems.baseline} gap={1}>
|
2023-01-10 01:38:43 +01:00
|
|
|
<AvatarAccount
|
|
|
|
{...args}
|
2023-03-10 21:12:55 +01:00
|
|
|
variant={AvatarAccountVariant.Jazzicon}
|
2023-01-10 01:38:43 +01:00
|
|
|
address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1"
|
|
|
|
/>
|
|
|
|
<AvatarAccount
|
|
|
|
{...args}
|
2023-03-10 21:12:55 +01:00
|
|
|
variant={AvatarAccountVariant.Blockies}
|
2023-01-10 01:38:43 +01:00
|
|
|
address="0x0"
|
|
|
|
/>
|
2022-10-07 17:53:40 +02:00
|
|
|
</Box>
|
|
|
|
);
|