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

Add add-recipient to Storybook ()

This commit is contained in:
Etienne Dusseault 2021-09-20 16:05:58 -03:00 committed by GitHub
parent 3edd544274
commit 6b7444c257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 668 additions and 615 deletions
.storybook
ui/pages/send/send-content/add-recipient

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 { text } from '@storybook/addon-knobs';
import configureStore from '../../../../store/store';
import testData from '../../../../../.storybook/test-data';
import AddRecipient from './add-recipient.component';
const store = configureStore(testData);
export default {
title: 'AddRecipient',
id: __filename,
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
};
export const AddRecipientComponent = () => {
const { metamask } = store.getState();
const { addressBook, recipient } = metamask;
return (
<div style={{ width: 300 }}>
<AddRecipient
contacts={[addressBook]}
recipient={recipient}
updateRecipient={() => undefined}
nonContacts={[addressBook]}
ownedAccounts={[addressBook]}
addressBook={[addressBook]}
updateGas={() => undefined}
// ToError and ToWarning wording must match on translation
ensError={text('To Error', 'loading')}
ensWarning={text('To Warning', 'loading')}
/>
</div>
);
};