2022-08-18 20:54:10 +02:00
|
|
|
import React from 'react';
|
|
|
|
import {
|
2023-02-02 21:15:26 +01:00
|
|
|
Size,
|
2022-08-18 20:54:10 +02:00
|
|
|
DISPLAY,
|
2023-02-02 21:15:26 +01:00
|
|
|
TextColor,
|
|
|
|
BackgroundColor,
|
|
|
|
BorderColor,
|
|
|
|
Color,
|
|
|
|
AlignItems,
|
2022-08-18 20:54:10 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
|
|
|
|
import Box from '../../ui/box/box';
|
|
|
|
|
|
|
|
import README from './README.mdx';
|
2023-03-17 18:06:59 +01:00
|
|
|
|
2022-08-18 20:54:10 +02:00
|
|
|
import { AvatarNetwork } from './avatar-network';
|
2022-12-15 18:28:42 +01:00
|
|
|
import { AVATAR_NETWORK_SIZES } from './avatar-network.constants';
|
2022-08-18 20:54:10 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/ComponentLibrary/AvatarNetwork',
|
|
|
|
component: AvatarNetwork,
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
page: README,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
argTypes: {
|
|
|
|
size: {
|
|
|
|
control: 'select',
|
2022-12-15 18:28:42 +01:00
|
|
|
options: Object.values(AVATAR_NETWORK_SIZES),
|
2022-08-18 20:54:10 +02:00
|
|
|
},
|
|
|
|
color: {
|
2023-02-02 21:15:26 +01:00
|
|
|
options: Object.values(TextColor),
|
2022-08-18 20:54:10 +02:00
|
|
|
control: 'select',
|
|
|
|
},
|
|
|
|
backgroundColor: {
|
2023-02-02 21:15:26 +01:00
|
|
|
options: Object.values(BackgroundColor),
|
2022-08-18 20:54:10 +02:00
|
|
|
control: 'select',
|
|
|
|
},
|
|
|
|
borderColor: {
|
2023-02-02 21:15:26 +01:00
|
|
|
options: Object.values(BorderColor),
|
2022-08-18 20:54:10 +02:00
|
|
|
control: 'select',
|
|
|
|
},
|
2022-12-15 18:28:42 +01:00
|
|
|
name: {
|
2022-08-18 20:54:10 +02:00
|
|
|
control: 'text',
|
|
|
|
},
|
2022-12-15 18:28:42 +01:00
|
|
|
src: {
|
2022-08-18 20:54:10 +02:00
|
|
|
control: 'text',
|
|
|
|
},
|
|
|
|
showHalo: {
|
|
|
|
control: 'boolean',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
args: {
|
2022-12-15 18:28:42 +01:00
|
|
|
name: 'Arbitrum One',
|
|
|
|
src: './images/arbitrum.svg',
|
2023-02-02 21:15:26 +01:00
|
|
|
size: Size.MD,
|
2022-08-18 20:54:10 +02:00
|
|
|
showHalo: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const Template = (args) => {
|
|
|
|
return <AvatarNetwork {...args} />;
|
|
|
|
};
|
2022-09-12 17:32:09 +02:00
|
|
|
|
2022-08-18 20:54:10 +02:00
|
|
|
export const DefaultStory = Template.bind({});
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
|
2023-02-02 21:15:26 +01:00
|
|
|
export const SizeStory = (args) => (
|
2023-03-17 18:06:59 +01:00
|
|
|
<>
|
|
|
|
<Box
|
|
|
|
display={DISPLAY.FLEX}
|
|
|
|
alignItems={AlignItems.flexEnd}
|
|
|
|
gap={1}
|
|
|
|
marginBottom={4}
|
|
|
|
>
|
|
|
|
<AvatarNetwork {...args} size={Size.XS} />
|
|
|
|
<AvatarNetwork {...args} size={Size.SM} />
|
|
|
|
<AvatarNetwork {...args} size={Size.MD} />
|
|
|
|
<AvatarNetwork {...args} size={Size.LG} />
|
|
|
|
<AvatarNetwork {...args} size={Size.XL} />
|
|
|
|
</Box>
|
|
|
|
<Box display={DISPLAY.FLEX} alignItems={AlignItems.flexEnd} gap={1}>
|
|
|
|
<AvatarNetwork {...args} src="" size={Size.XS} />
|
|
|
|
<AvatarNetwork {...args} src="" size={Size.SM} />
|
|
|
|
<AvatarNetwork {...args} src="" size={Size.MD} />
|
|
|
|
<AvatarNetwork {...args} src="" size={Size.LG} />
|
|
|
|
<AvatarNetwork {...args} src="" size={Size.XL} />
|
|
|
|
</Box>
|
|
|
|
</>
|
2022-08-18 20:54:10 +02:00
|
|
|
);
|
2023-02-02 21:15:26 +01:00
|
|
|
SizeStory.storyName = 'Size';
|
2022-08-18 20:54:10 +02:00
|
|
|
|
2022-12-15 18:28:42 +01:00
|
|
|
export const Name = Template.bind({});
|
|
|
|
Name.args = {
|
|
|
|
src: '',
|
2022-08-18 20:54:10 +02:00
|
|
|
};
|
|
|
|
|
2022-12-15 18:28:42 +01:00
|
|
|
export const Src = (args) => (
|
|
|
|
<Box display={DISPLAY.FLEX} gap={1}>
|
|
|
|
<AvatarNetwork {...args} src="./images/matic-token.png" />
|
|
|
|
<AvatarNetwork {...args} src="./images/arbitrum.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/optimism.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/avax-token.png" />
|
|
|
|
<AvatarNetwork {...args} src="./images/palm.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/bsc-filled.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/fantom-opera.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/harmony-one.svg" />
|
|
|
|
<AvatarNetwork {...args} src="./images/aurora.png" />
|
|
|
|
</Box>
|
|
|
|
);
|
2022-08-18 20:54:10 +02:00
|
|
|
|
2022-09-12 17:32:09 +02:00
|
|
|
export const ShowHalo = Template.bind({});
|
|
|
|
ShowHalo.args = {
|
2022-08-18 20:54:10 +02:00
|
|
|
showHalo: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const ColorBackgroundColorAndBorderColor = (args) => (
|
|
|
|
<Box display={DISPLAY.FLEX} gap={1}>
|
|
|
|
<AvatarNetwork
|
|
|
|
{...args}
|
2023-02-02 21:15:26 +01:00
|
|
|
backgroundColor={BackgroundColor.goerli}
|
|
|
|
borderColor={BorderColor.goerli}
|
2022-12-15 18:28:42 +01:00
|
|
|
name="G"
|
2023-02-02 21:15:26 +01:00
|
|
|
color={Color.goerliInverse}
|
2022-08-18 20:54:10 +02:00
|
|
|
/>
|
2022-09-14 20:26:45 +02:00
|
|
|
<AvatarNetwork
|
|
|
|
{...args}
|
2023-02-02 21:15:26 +01:00
|
|
|
backgroundColor={BackgroundColor.sepolia}
|
|
|
|
borderColor={BorderColor.sepolia}
|
2022-12-15 18:28:42 +01:00
|
|
|
name="S"
|
2023-02-02 21:15:26 +01:00
|
|
|
color={Color.goerliInverse}
|
2022-09-14 20:26:45 +02:00
|
|
|
/>
|
2022-08-18 20:54:10 +02:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
ColorBackgroundColorAndBorderColor.args = {
|
2022-12-15 18:28:42 +01:00
|
|
|
src: '',
|
2022-08-18 20:54:10 +02:00
|
|
|
};
|