UNPKG

824 BJavaScriptView Raw
1/* @flow */
2import React from 'react';
3import { storiesOf } from '@storybook/react';
4import { action } from '@storybook/addon-actions';
5
6import { ModalPortal } from '../src/components/modalContainer';
7import Modal from '../src/components/modal';
8
9const 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
17storiesOf('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 }} />);