1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/ui/components/component-library/avatar-base/avatar-base.stories.js
Nidhi Kumari d362dbfacb
UX Multichain: updated ethereum logo icon (#18528)
* updated ethereum logo icon

* Updating eth logo (#18631)

* Updating eth logo

* Removing border from eth logo identicon

* Removing old eth logo

* updated snapshot and lint errors

* updated eth logo from svg to png

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
2023-04-19 20:55:19 +05:30

153 lines
3.5 KiB
JavaScript

import React from 'react';
import {
AlignItems,
DISPLAY,
TextColor,
BackgroundColor,
BorderColor,
Color,
} from '../../../helpers/constants/design-system';
import Box from '../../ui/box/box';
import { Icon, IconName } from '..';
import README from './README.mdx';
import { AvatarBase } from './avatar-base';
import { AVATAR_BASE_SIZES } from './avatar-base.constants';
const marginSizeKnobOptions = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
'auto',
];
export default {
title: 'Components/ComponentLibrary/AvatarBase',
component: AvatarBase,
parameters: {
docs: {
page: README,
},
},
argTypes: {
size: {
control: 'select',
options: Object.values(AVATAR_BASE_SIZES),
},
color: {
options: Object.values(TextColor),
control: 'select',
},
backgroundColor: {
options: Object.values(BackgroundColor),
control: 'select',
},
borderColor: {
options: Object.values(BorderColor),
control: 'select',
},
display: {
options: Object.values(DISPLAY),
control: 'select',
table: { category: 'box props' },
},
marginTop: {
options: marginSizeKnobOptions,
control: 'select',
table: { category: 'box props' },
},
marginRight: {
options: marginSizeKnobOptions,
control: 'select',
table: { category: 'box props' },
},
marginBottom: {
options: marginSizeKnobOptions,
control: 'select',
table: { category: 'box props' },
},
marginLeft: {
options: marginSizeKnobOptions,
control: 'select',
table: { category: 'box props' },
},
},
args: {
size: AVATAR_BASE_SIZES.MD,
color: TextColor.textDefault,
backgroundColor: BackgroundColor.backgroundAlternative,
borderColor: BorderColor.borderDefault,
children: 'B',
},
};
export const DefaultStory = (args) => <AvatarBase {...args} />;
DefaultStory.storyName = 'Default';
export const Size = (args) => (
<Box display={DISPLAY.FLEX} alignItems={AlignItems.baseline} gap={1}>
<AvatarBase {...args} size={AVATAR_BASE_SIZES.XS} />
<AvatarBase {...args} size={AVATAR_BASE_SIZES.SM} />
<AvatarBase {...args} size={AVATAR_BASE_SIZES.MD} />
<AvatarBase {...args} size={AVATAR_BASE_SIZES.LG} />
<AvatarBase {...args} size={AVATAR_BASE_SIZES.XL} />
</Box>
);
export const Children = (args) => (
<Box display={DISPLAY.FLEX} gap={1}>
<AvatarBase {...args}>
<img src="./images/eth_logo.png" />
</AvatarBase>
<AvatarBase {...args}>
<img width="100%" src="./images/arbitrum.svg" />
</AvatarBase>
<AvatarBase {...args}>
<img width="100%" src="./images/avax-token.png" />
</AvatarBase>
<AvatarBase {...args}>A</AvatarBase>
<AvatarBase
{...args}
backgroundColor={BackgroundColor.infoMuted}
borderColor={BorderColor.infoMuted}
>
<Icon name={IconName.User} color={Color.infoDefault} />
</AvatarBase>
</Box>
);
export const ColorBackgroundColorAndBorderColor = (args) => (
<Box display={DISPLAY.FLEX} gap={1}>
<AvatarBase {...args}>B</AvatarBase>
<AvatarBase
{...args}
backgroundColor={BackgroundColor.goerli}
borderColor={BorderColor.goerli}
color={TextColor.primaryInverse}
>
G
</AvatarBase>
<AvatarBase
{...args}
backgroundColor={BackgroundColor.sepolia}
borderColor={BorderColor.sepolia}
color={TextColor.primaryInverse}
>
S
</AvatarBase>
</Box>
);