mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 22:24:27 +01:00
f2514c88cf
* added avatar network component * reset showFallback if networkUrl changes * updated changed to avatar network * updated test cases for avatar network * updated story url in README * added avatar network class Name * updated readme for AvatarNetwork * updated avatar network * updated text changes to avatar Network and Avatar Token component * updated space between useState and useEffect * updated scss files in alphabetic order |
||
---|---|---|
.. | ||
avatar-token.js | ||
avatar-token.scss | ||
avatar-token.stories.js | ||
avatar-token.test.js | ||
index.js | ||
README.mdx |
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { AvatarToken } from './avatar-token'; # AvatarToken The `AvatarToken` is a component responsible for display of the image of a given token <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--default-story" /> </Canvas> ## Props The `AvatarToken` accepts all props below as well as all [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props <ArgsTable of={AvatarToken} /> ### Size Use the `size` prop to set the size of the `AvatarToken`. Possible sizes include: - `xs` 16px - `sm` 24px - `md` 32px - `lg` 40px - `xl` 48px Defaults to `md` <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--size" /> </Canvas> ### Token Name Use the `tokenName` prop to set the initial letter of the `AvatarToken`. This will be used as the fallback display if no image url is passed to the `tokenImageUrl` prop. <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--token-name" /> </Canvas> ### Token Image Url Use the `tokenImageUrl` prop to set the image to be rendered of the `AvatarToken`. <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--token-image-url" /> </Canvas> ### Show Halo If we want to display the component with halo effect. Only works if an image url is supplied to `tokenImageUrl` <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--show-halo" /> </Canvas> ### Color, Background Color And Border Color Use the `color`, `backgroundColor` and `borderColor` props to set the text color, background-color and border-color of the `AvatarToken`. <Canvas> <Story id="ui-components-component-library-avatar-token-avatar-token-stories-js--color-background-color-and-border-color" /> </Canvas>