2022-03-30 00:20:19 +02:00
|
|
|
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
|
|
|
|
|
|
|
|
import ImportToken from './import-token.component';
|
|
|
|
|
|
|
|
import testData from '../../../.storybook/test-data';
|
|
|
|
import configureStore from '../../store/store';
|
|
|
|
|
2023-05-18 04:07:42 +02:00
|
|
|
export const PersonalAddress = () => <code>{configureStore(testData).getState().metamask.selectedAddress}</code>;
|
2022-03-30 00:20:19 +02:00
|
|
|
|
|
|
|
# ImportToken
|
|
|
|
|
|
|
|
The `ImportToken` component allows a user to import custom tokens in one of two ways:
|
2022-08-08 21:01:38 +02:00
|
|
|
|
2022-03-30 00:20:19 +02:00
|
|
|
1. By searching for one
|
|
|
|
2. By importing one by `Token Contract Address`
|
|
|
|
|
|
|
|
<Canvas>
|
2023-01-20 20:27:46 +01:00
|
|
|
<Story id="pages-swaps-importtoken--default-story" />
|
2022-03-30 00:20:19 +02:00
|
|
|
</Canvas>
|
|
|
|
|
|
|
|
## Example inputs
|
|
|
|
|
2022-08-08 21:01:38 +02:00
|
|
|
An example input that works, to enable the `Add custom token` button is `0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`.
|
2022-03-30 00:20:19 +02:00
|
|
|
|
|
|
|
### Personal address error
|
2022-08-08 21:01:38 +02:00
|
|
|
|
2022-03-30 00:20:19 +02:00
|
|
|
To show the personal address detected error, input the address <PersonalAddress/> in the `Token Contract Address` field.
|
|
|
|
|
2022-07-26 20:52:40 +02:00
|
|
|
## Props
|
2022-03-30 00:20:19 +02:00
|
|
|
|
|
|
|
<ArgsTable of={ImportToken} />
|