1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00
metamask-extension/ui/pages/settings/contact-list-tab/contact-list-tab.stories.js
VSaric cb815a91ad
SendHeader, ContactListTab and AdvancedTab story: converted knobs and actions to controls / args (#13230)
* SendHeader, ContactListTab and AdvancedTab story: converted knobs and actions to controls / args

* Added the other function type props to action controls

* Requested review changes
2022-01-17 10:58:12 -08:00

40 lines
1.0 KiB
JavaScript

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 {
title: 'Pages/Settings/ContactListTab',
id: __filename,
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
argsTypes: {
addressBook: { control: 'object' },
hideAddressBook: { control: 'boolean' },
selectedAddress: { control: 'select' },
history: { action: 'history' },
},
};
const { metamask } = store.getState();
const { addresses } = metamask;
export const DefaultStory = (args) => {
return (
<div style={{ width: 300 }}>
<ContactListTab {...args} />
</div>
);
};
DefaultStory.storyName = 'Default';
DefaultStory.args = {
addressBook: addresses,
hideAddressBook: false,
selectedAddress: addresses.map(({ address }) => address),
};