1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/settings/contact-list-tab/contact-list-tab.stories.js
George Marshall 854fc71ae7
Organizing storybook to echo app folder structure (#12796)
* Organizing storybook to echo app folder structure

* Updating new stories to follow new convention from develop
2021-12-01 11:27:57 -08:00

41 lines
1.1 KiB
JavaScript

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: 'Pages/Settings/ContactListTab',
id: __filename,
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
};
export const DefaultStory = () => {
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>
);
};
DefaultStory.storyName = 'Default';