2022-10-12 20:19:12 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { AvatarAccount } from '../avatar-account';
|
2023-01-10 01:38:43 +01:00
|
|
|
import { AVATAR_ACCOUNT_TYPES } from '../avatar-account/avatar-account.constants';
|
2022-10-12 20:19:12 +02:00
|
|
|
import { AvatarNetwork } from '../avatar-network';
|
|
|
|
import Box from '../../ui/box/box';
|
|
|
|
import {
|
|
|
|
ALIGN_ITEMS,
|
|
|
|
DISPLAY,
|
|
|
|
SIZES,
|
|
|
|
} from '../../../helpers/constants/design-system';
|
2022-12-21 20:06:40 +01:00
|
|
|
import { AVATAR_WITH_BADGE_POSTIONS } from './avatar-with-badge.constants';
|
2022-10-12 20:19:12 +02:00
|
|
|
import README from './README.mdx';
|
|
|
|
import { AvatarWithBadge } from './avatar-with-badge';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ComponentLibrary/AvatarWithBadge',
|
|
|
|
id: __filename,
|
|
|
|
component: AvatarWithBadge,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
badgePosition: {
|
2022-12-21 20:06:40 +01:00
|
|
|
options: Object.values(AVATAR_WITH_BADGE_POSTIONS),
|
2022-10-12 20:19:12 +02:00
|
|
|
control: 'select',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
args: {
|
2022-12-21 20:06:40 +01:00
|
|
|
badgePosition: AVATAR_WITH_BADGE_POSTIONS.top,
|
2022-10-12 20:19:12 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const DefaultStory = (args) => (
|
|
|
|
<AvatarWithBadge
|
|
|
|
badge={
|
|
|
|
<AvatarNetwork
|
|
|
|
size={SIZES.XS}
|
2022-12-15 18:28:42 +01:00
|
|
|
name="Arbitrum One"
|
|
|
|
src="./images/arbitrum.svg"
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
{...args}
|
|
|
|
>
|
|
|
|
<AvatarAccount
|
|
|
|
address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1"
|
|
|
|
size={SIZES.MD}
|
2023-01-10 01:38:43 +01:00
|
|
|
type={AVATAR_ACCOUNT_TYPES.JAZZICON}
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
</AvatarWithBadge>
|
|
|
|
);
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
|
|
|
export const BadgePosition = () => (
|
|
|
|
<Box display={DISPLAY.FLEX} alignItems={ALIGN_ITEMS.BASELINE} gap={1}>
|
|
|
|
<AvatarWithBadge
|
2022-12-21 20:06:40 +01:00
|
|
|
badgePosition={AVATAR_WITH_BADGE_POSTIONS.BOTTOM}
|
2022-10-12 20:19:12 +02:00
|
|
|
badge={
|
|
|
|
<AvatarNetwork
|
|
|
|
size={SIZES.XS}
|
2022-12-15 18:28:42 +01:00
|
|
|
name="Arbitrum One"
|
|
|
|
src="./images/arbitrum.svg"
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<AvatarAccount
|
|
|
|
address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1"
|
|
|
|
size={SIZES.MD}
|
2023-01-10 01:38:43 +01:00
|
|
|
type={AVATAR_ACCOUNT_TYPES.JAZZICON}
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
</AvatarWithBadge>
|
|
|
|
|
|
|
|
<AvatarWithBadge
|
2022-12-21 20:06:40 +01:00
|
|
|
badgePosition={AVATAR_WITH_BADGE_POSTIONS.TOP}
|
2022-10-12 20:19:12 +02:00
|
|
|
badge={
|
|
|
|
<AvatarNetwork
|
|
|
|
size={SIZES.XS}
|
2022-12-15 18:28:42 +01:00
|
|
|
name="Arbitrum One"
|
|
|
|
src="./images/arbitrum.svg"
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<AvatarAccount
|
|
|
|
address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1"
|
|
|
|
size={SIZES.MD}
|
2023-01-10 01:38:43 +01:00
|
|
|
type={AVATAR_ACCOUNT_TYPES.JAZZICON}
|
2022-10-12 20:19:12 +02:00
|
|
|
/>
|
|
|
|
</AvatarWithBadge>
|
|
|
|
</Box>
|
|
|
|
);
|