2021-09-13 23:04:31 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
|
|
|
import configureStore from '../../../store/store';
|
|
|
|
import testData from '../../../../.storybook/test-data';
|
|
|
|
import ContactListTab from './contact-list-tab.component';
|
|
|
|
|
|
|
|
// Using Test Data For Redux
|
|
|
|
const store = configureStore(testData);
|
|
|
|
|
|
|
|
export default {
|
2021-12-01 20:27:57 +01:00
|
|
|
title: 'Pages/Settings/ContactListTab',
|
2023-01-20 20:27:46 +01:00
|
|
|
|
2021-09-13 23:04:31 +02:00
|
|
|
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
2022-01-17 19:58:12 +01:00
|
|
|
argsTypes: {
|
|
|
|
addressBook: { control: 'object' },
|
|
|
|
hideAddressBook: { control: 'boolean' },
|
|
|
|
selectedAddress: { control: 'select' },
|
|
|
|
history: { action: 'history' },
|
|
|
|
},
|
2021-09-13 23:04:31 +02:00
|
|
|
};
|
|
|
|
|
2022-01-17 19:58:12 +01:00
|
|
|
const { metamask } = store.getState();
|
|
|
|
const { addresses } = metamask;
|
2021-09-13 23:04:31 +02:00
|
|
|
|
2022-01-17 19:58:12 +01:00
|
|
|
export const DefaultStory = (args) => {
|
2021-09-13 23:04:31 +02:00
|
|
|
return (
|
|
|
|
<div style={{ width: 300 }}>
|
2022-01-17 19:58:12 +01:00
|
|
|
<ContactListTab {...args} />
|
2021-09-13 23:04:31 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2021-12-01 20:27:57 +01:00
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default';
|
2022-01-17 19:58:12 +01:00
|
|
|
DefaultStory.args = {
|
|
|
|
addressBook: addresses,
|
|
|
|
hideAddressBook: false,
|
|
|
|
selectedAddress: addresses.map(({ address }) => address),
|
|
|
|
};
|