2019-06-27 12:47:32 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { storiesOf } from '@storybook/react';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
2019-06-28 08:14:58 +00:00
|
|
|
import { BooleanValue } from 'react-values'
|
2019-06-27 12:47:32 +00:00
|
|
|
import withReadme from 'storybook-readme/with-readme';
|
|
|
|
import Readme from './README.md';
|
|
|
|
import Section from '../../.storybook/decorators/section';
|
|
|
|
import { ModalDialog, Button } from 'asc-web-components';
|
|
|
|
|
|
|
|
|
|
|
|
storiesOf('Components|ModalDialog', module)
|
|
|
|
.addDecorator(withReadme(Readme))
|
|
|
|
.add('Modal dialog', () => (
|
|
|
|
<Section>
|
2019-06-28 08:24:06 +00:00
|
|
|
<BooleanValue>
|
2019-06-28 08:14:58 +00:00
|
|
|
{({ value, toggle }) => (
|
|
|
|
<div>
|
2019-06-28 08:24:06 +00:00
|
|
|
<Button
|
|
|
|
label="Show"
|
|
|
|
primary={true}
|
|
|
|
onClick={(e) => {
|
|
|
|
action('onShow')(e);
|
|
|
|
toggle(true);
|
|
|
|
}}
|
|
|
|
/>
|
2019-06-28 08:14:58 +00:00
|
|
|
<ModalDialog
|
2019-07-11 15:02:48 +00:00
|
|
|
visible={value}
|
2019-09-05 09:00:48 +00:00
|
|
|
headerContent="Change password"
|
2019-06-28 08:24:06 +00:00
|
|
|
bodyContent={
|
2019-09-05 09:00:48 +00:00
|
|
|
<div>Send the password change instruction to the <a href="mailto:asc@story.book">asc@story.book</a> email address</div>
|
2019-06-28 08:24:06 +00:00
|
|
|
}
|
2019-06-28 08:14:58 +00:00
|
|
|
footerContent={[
|
2019-06-28 08:24:06 +00:00
|
|
|
<Button
|
2019-09-05 09:00:48 +00:00
|
|
|
key="SendBtn"
|
|
|
|
label="Send"
|
2019-06-28 08:24:06 +00:00
|
|
|
primary={true}
|
2019-09-05 09:00:48 +00:00
|
|
|
size="medium"
|
2019-06-28 08:24:06 +00:00
|
|
|
onClick={(e) => {
|
|
|
|
action('onOk')(e);
|
|
|
|
toggle(false);
|
|
|
|
}}
|
|
|
|
/>
|
2019-06-28 08:14:58 +00:00
|
|
|
]}
|
2019-06-28 08:24:06 +00:00
|
|
|
onClose={e => {
|
|
|
|
action('onClose')(e);
|
|
|
|
toggle(false);
|
|
|
|
}}
|
2019-06-28 08:14:58 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2019-06-27 12:47:32 +00:00
|
|
|
)}
|
2019-06-28 08:14:58 +00:00
|
|
|
</BooleanValue>
|
2019-06-27 12:47:32 +00:00
|
|
|
</Section>
|
|
|
|
));
|