1 |
|
2 | import React from 'react';
|
3 | import { storiesOf } from '@storybook/react';
|
4 | import { action } from '@storybook/addon-actions';
|
5 |
|
6 | import { ModalPortal } from '../src/components/modalContainer';
|
7 | import Modal from '../src/components/modal';
|
8 |
|
9 | const props = {
|
10 | element: null,
|
11 | modalContent: <Modal title="Would you like a cookie?" text="They are very tasty" />,
|
12 | onCancel: action('Cancel'),
|
13 | onConfirm: action('Confirm'),
|
14 | setModalOnClose: action('SetModalOnClose'),
|
15 | };
|
16 |
|
17 | storiesOf('ModalPortal (Confirm modal)', module)
|
18 | .add('Base props', () => <ModalPortal {...props} />)
|
19 | .add('With custom labeling', () => (
|
20 | <ModalPortal {...{ ...props, cancelText: 'Bork', confirmText: 'Bork bork bork' }} />
|
21 | ))
|
22 | .add('Without cancel', () => <ModalPortal {...{ ...props, showCancel: false }} />);
|