1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/component-library/picker-network
Nidhi Kumari 4fcbaae32f
housekeeping for avatar network (#16663)
* added housekeeping for avatar network

* fixed alt

* updated story in Readme

* fixed indentation and added network src

* updated SIZES for avatar network

* updated snapshot

* updated docs and props

* updated name of avatar

* removed comments

* updated avatar network component

* updated readme

* updated story for badge

* added constants to the root
2022-12-15 22:58:42 +05:30
..
__snapshots__ housekeeping for avatar network (#16663) 2022-12-15 22:58:42 +05:30
index.js Added Picker Network Component (#16340) 2022-11-09 16:31:51 -08:00
picker-network.js housekeeping for avatar network (#16663) 2022-12-15 22:58:42 +05:30
picker-network.scss updated background color for picker network (#16466) 2022-11-18 22:29:25 +05:30
picker-network.stories.js Added Picker Network Component (#16340) 2022-11-09 16:31:51 -08:00
picker-network.test.js Added Picker Network Component (#16340) 2022-11-09 16:31:51 -08:00
README.mdx Added Picker Network Component (#16340) 2022-11-09 16:31:51 -08:00

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';

import { PickerNetwork } from './picker-network';

# PickerNetwork

The `PickerNetwork` is used for the action of changing a network.

<Canvas>
  <Story id="ui-components-component-library-picker-network-picker-network-stories-js--default-story" />
</Canvas>

## Props

The `PickerNetwork` accepts all props below as well as all [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props.

<ArgsTable of={PickerNetwork} />

### Src

Use the `src` prop with an image url to render the `AvatarNetwork`.

<Canvas>
  <Story id="ui-components-component-library-picker-network-picker-network-stories-js--src" />
</Canvas>

```jsx
import { PickerNetwork } from '../../ui/component-library/picker-network';
  <PickerNetwork src="./images/arbitrum.svg" />
  <PickerNetwork src="./images/matic-token.png" />
  <PickerNetwork src="./images/optimism.svg" />
```

### Label

Use the `label` prop for the text content of the `PickerNetwork` component

<Canvas>
  <Story id="ui-components-component-library-picker-network-picker-network-stories-js--label" />
</Canvas>

```jsx
import { PickerNetwork } from '../../ui/component-library/picker-network';
  <PickerNetwork label="Arbitrum One" />
  <PickerNetwork label="Polygon Mainnet" />
  <PickerNetwork label="Optimism" />
```