Add custom Modal component

This commit is contained in:
Gabe Kangas
2022-05-09 15:34:02 -07:00
parent 8c7c11cb72
commit 92a1da4df6
6 changed files with 131 additions and 57 deletions

View File

@@ -1,14 +1,6 @@
import React, { useState } from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { Modal, Button } from 'antd';
const Usage = () => (
<Modal title="Basic Modal" visible>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Modal>
);
import Modal from '../components/ui/Modal/Modal';
export default {
title: 'owncast/Modal container',
@@ -16,7 +8,21 @@ export default {
parameters: {},
} as ComponentMeta<typeof Modal>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const Template: ComponentStory<typeof Modal> = args => <Usage />;
const Template: ComponentStory<typeof Modal> = args => {
const { children } = args;
return <Modal {...args}>{children}</Modal>;
};
export const Example = Template.bind({});
Example.args = {
title: 'Modal example with content nodes',
visible: true,
children: <div>Test 123</div>,
};
export const UrlExample = Template.bind({});
UrlExample.args = {
title: 'Modal example with URL',
visible: true,
url: 'https://owncast.online',
};