mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
73add90685
* AvatarFavicon to TS * documentation updates * fix types import * Some doc updates --------- Co-authored-by: Garrett Bear <gwhisten@gmail.com> Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
|
|
|
|
import { AvatarBase } from '../';
|
|
|
|
import { AvatarFavicon } from './avatar-favicon';
|
|
|
|
# AvatarFavicon
|
|
|
|
The `AvatarFavicon` is an image component that represents a dapp or third party service
|
|
|
|
<Canvas>
|
|
<Story id="components-componentlibrary-avatarfavicon--default-story" />
|
|
</Canvas>
|
|
|
|
## Props
|
|
|
|
<ArgsTable of={AvatarFavicon} />
|
|
|
|
### Size
|
|
|
|
Use the `size` prop and the `AvatarFaviconSize` enum from `../../component-library` to change the size of `AvatarFavicon`
|
|
|
|
Possible sizes include:
|
|
|
|
- `AvatarFaviconSize.Xs` 16px
|
|
- `AvatarFaviconSize.Sm` 24px
|
|
- `AvatarFaviconSize.Md` 32px
|
|
- `AvatarFaviconSize.Lg` 40px
|
|
- `AvatarFaviconSize.Xl` 48px
|
|
|
|
Defaults to `AvatarFaviconSize.MD`
|
|
|
|
<Canvas>
|
|
<Story id="components-componentlibrary-avatarfavicon--size-story" />
|
|
</Canvas>
|
|
|
|
```jsx
|
|
import { AvatarFavicon, AvatarFaviconSize } from '../../component-library';
|
|
|
|
<AvatarFavicon size={AvatarFaviconSize.Xs} />
|
|
<AvatarFavicon size={AvatarFaviconSize.Sm} />
|
|
<AvatarFavicon size={AvatarFaviconSize.Md} />
|
|
<AvatarFavicon size={AvatarFaviconSize.Lg} />
|
|
<AvatarFavicon size={AvatarFaviconSize.Xl} />
|
|
```
|
|
|
|
### Src
|
|
|
|
Use the `src` prop to set the image to be rendered of the `AvatarFavicon`.
|
|
|
|
<Canvas>
|
|
<Story id="components-componentlibrary-avatarfavicon--src" />
|
|
</Canvas>
|
|
|
|
```jsx
|
|
import { AvatarFavicon } from '../../component-library';
|
|
|
|
<AvatarFavicon src="https://uniswap.org/favicon.ico" />
|
|
<AvatarFavicon src="https://1inch.exchange/assets/favicon/favicon-32x32.png" />
|
|
```
|
|
|
|
### Fallback Icon Props
|
|
|
|
If there is no `src` then in that case an [icon](/docs/components-componentlibrary-icon--default-story) will be used as the fallback display and it can be customised via `fallbackIconProps`.
|