Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Fix stories for Send, SignMessage and Toaster #680

Merged
merged 1 commit into from Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/send/stories.js
@@ -1,15 +1,24 @@
import React from 'react';

import { Provider } from 'react-redux';
import { storiesOf } from '@storybook/react';

import Send from './send';

import store from '../../store';

const account = {
passphrase: 'wagon stock borrow episode laundry kitten salute link globe zero feed marble',
address: '16313739661670634666L',
balance: 1000e8,
};

storiesOf('Send', module)
.addDecorator(getStory => (
<Provider store={store}>
{getStory()}
</Provider>
))
.add('pre-filled recipient and amount', () => (
<Send recipient='11004588490103196952L' amount='100' account={account} activePeer={{}} />
))
Expand Down
13 changes: 11 additions & 2 deletions src/components/signVerify/stories.js
@@ -1,9 +1,13 @@
import React from 'react';

import { storiesOf } from '@storybook/react';
import { Provider } from 'react-redux';
import { action } from '@storybook/addon-actions';
import VerifyMessage from './verifyMessage';
import { storiesOf } from '@storybook/react';

import SignMessageComponent from './signMessageComponent';
import VerifyMessage from './verifyMessage';

import store from '../../store';


const publicKey = 'c094ebee7ec0c50ebee32918655e089f6e1a604b83bcaa760293c61e0f18ab6f';
Expand All @@ -18,6 +22,11 @@ storiesOf('VerifyMessage', module)
));

storiesOf('SignMessage', module)
.addDecorator(getStory => (
<Provider store={store}>
{getStory()}
</Provider>
))
.add('default', () => (
<SignMessageComponent
account={account}
Expand Down
19 changes: 14 additions & 5 deletions src/components/toaster/stories.js
Expand Up @@ -8,21 +8,30 @@ import Toaster from './toasterComponent';
storiesOf('Toaster', module)
.add('default', () => (
<Toaster
label='Test toast'
toasts={[{
label: 'Test toast',
index: 0,
}]}
hideToast={ action('onHide') }
/>
))
.add('success', () => (
<Toaster
label='Success toast'
type='success'
toasts={[{
label: 'Success toast',
type: 'success',
index: 0,
}]}
hideToast={ action('onHide') }
/>
))
.add('error', () => (
<Toaster
label='Error toast'
type='error'
toasts={[{
label: 'Success toast',
type: 'error',
index: 0,
}]}
hideToast={ action('onHide') }
/>
));