2021-08-17 07:33:46 +02:00
|
|
|
/* eslint-disable react/prop-types */
|
2023-04-19 11:03:29 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
2022-02-01 16:30:15 +01:00
|
|
|
import { suggestedAssets as mockSuggestedAssets } from '../../../.storybook/initial-states/approval-screens/add-suggested-token';
|
2023-01-20 20:27:46 +01:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
import configureStore from '../../store/store';
|
2021-08-17 07:33:46 +02:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
import mockState from '../../../.storybook/test-data';
|
2022-02-01 16:30:15 +01:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
import ConfirmAddSuggestedToken from '.';
|
2022-02-01 16:30:15 +01:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
const store = configureStore({
|
|
|
|
metamask: {
|
|
|
|
...mockState.metamask,
|
|
|
|
suggestedAssets: [...mockSuggestedAssets],
|
|
|
|
tokens: [],
|
|
|
|
},
|
|
|
|
});
|
2021-08-17 07:33:46 +02:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
export default {
|
|
|
|
title: 'Pages/ConfirmAddSuggestedToken',
|
|
|
|
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
2021-08-17 07:33:46 +02:00
|
|
|
};
|
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
export const DefaultStory = () => <ConfirmAddSuggestedToken />;
|
2022-02-01 16:30:15 +01:00
|
|
|
DefaultStory.storyName = 'Default';
|
2021-09-08 01:51:41 +02:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
export const WithDuplicateAddress = () => <ConfirmAddSuggestedToken />;
|
|
|
|
const WithDuplicateAddressStore = configureStore({
|
|
|
|
metamask: {
|
|
|
|
...mockState.metamask,
|
|
|
|
suggestedAssets: [...mockSuggestedAssets],
|
|
|
|
tokens: [
|
|
|
|
{
|
|
|
|
...mockSuggestedAssets[0].asset,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
WithDuplicateAddress.decorators = [
|
|
|
|
(story) => <Provider store={WithDuplicateAddressStore}>{story()}</Provider>,
|
|
|
|
];
|
2021-12-01 20:27:57 +01:00
|
|
|
|
2023-04-19 11:03:29 +02:00
|
|
|
export const WithDuplicateSymbolAndDifferentAddress = () => (
|
|
|
|
<ConfirmAddSuggestedToken />
|
|
|
|
);
|
|
|
|
const WithDuplicateSymbolAndDifferentAddressStore = configureStore({
|
|
|
|
metamask: {
|
|
|
|
...mockState.metamask,
|
|
|
|
suggestedAssets: [...mockSuggestedAssets],
|
|
|
|
tokens: [
|
|
|
|
{
|
|
|
|
...mockSuggestedAssets[0].asset,
|
|
|
|
address: '0xNonSuggestedAddress',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
WithDuplicateSymbolAndDifferentAddress.decorators = [
|
|
|
|
(story) => (
|
|
|
|
<Provider store={WithDuplicateSymbolAndDifferentAddressStore}>
|
|
|
|
{story()}
|
|
|
|
</Provider>
|
|
|
|
),
|
|
|
|
];
|