1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Add contact-list-tab to Storybook (#12079)

This commit is contained in:
Etienne Dusseault 2021-09-13 18:34:31 -02:30 committed by GitHub
parent ad182c8fa4
commit d1d01f434d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 520 additions and 476 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
import React from 'react';
import { Provider } from 'react-redux';
import { object, boolean, select } from '@storybook/addon-knobs';
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: 'ContactListTab',
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
};
export const ContactListTabComponent = () => {
const { metamask } = store.getState();
const { addresses } = metamask;
const addressBook = object('Address Book', addresses);
const hideAddressBook = boolean('Hide Address Book', false);
const selectedAddress = select(
'Selected Address',
addresses.map(({ address }) => address),
);
return (
<div style={{ width: 300 }}>
<ContactListTab
addressBook={addressBook}
history={{ push: () => undefined }}
hideAddressBook={hideAddressBook}
selectedAddress={selectedAddress}
/>
</div>
);
};