import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import Modal from './Modal'; import { Icon } from '../Icon'; import { iconTypes } from '../Icon'; import colors from '../../styles/colors'; import { Input } from '../Input'; import { useArgs } from '@storybook/addons'; import { Button } from '../Button'; import Dropdown from '../Dropdown/Dropdown'; import { Typography } from '../Typography'; import color from '../../styles/colors'; const hasPositionAbsoluteFix = { transform: 'scale(1)', height: '90vh', }; export default { title: '5.Popup/Modal', component: Modal, decorators: [ (storyFn) =>
{storyFn()}
, ], } as ComponentMeta; const Template: ComponentStory = (args) => { const [{}, updateArgs] = useArgs(); return (
{ console.log('canceled'); updateArgs({ isVisible: false }); }} onOk={() => { console.log('pressed ok'); updateArgs({ isVisible: false }); }} onCloseButtonPressed={() => { console.log('pressed close'); updateArgs({ isVisible: false }); }} />
); }; export const Regular = Template.bind({}); Regular.args = { id: 'regular', title: (
Edit Nickname
), okText: 'Save Changes', cancelText: 'Discard Changes', isVisible: true, children: [
, ], }; export const VerticalCenter = Template.bind({}); VerticalCenter.args = { id: 'v-center', title: (
Edit Nickname
), okText: 'Save Changes', cancelText: 'Discard Changes', isCentered: true, isVisible: true, children: [], }; export const BorderedHeader = Template.bind({}); BorderedHeader.args = { id: 'regular', title: 'Bordered Header', isVisible: true, headerHasBottomBorder: true, children: [

This is a demo on how to use headerHasBottomBorder{' '} props?

, ], }; export const ButtonsDisabled = Template.bind({}); ButtonsDisabled.args = { id: 'disabled', title: 'Confirm', okText: 'Download', cancelText: 'Abort', isVisible: true, isOkDisabled: true, isCancelDisabled: true, children: [

Wait until the file is ready to be downloaded

, ], }; export const OneButtonDisabled = Template.bind({}); OneButtonDisabled.args = { id: 'disabled', title: 'Newsletter', okText: 'Disabled', cancelText: 'Cancel', isVisible: true, onCancel: () => { console.log('cancel button clicked'); }, onOk: () => { console.log('ok button clicked'); }, isOkDisabled: true, children: [
console.log(e.target.value)} placeholder={'E-Mail Address'} type={'email'} />
, ], }; export const NoFooter = Template.bind({}); NoFooter.args = { title: 'Recover Password', hasFooter: false, children: [

Send instruction to reset password

, ], }; export const NoCancel = Template.bind({}); NoCancel.args = { title: 'Recover Password', okText: 'Send E-Mail', hasCancel: false, children: [

Send instruction to reset password

, ], }; export const CustomOkColor = Template.bind({}); CustomOkColor.args = { title: 'Delete Account', okText: 'Yes! I am 100% sure!', okButtonColor: 'red', hasCancel: false, children: [

Are you sure you want to delete your account?

, ], }; export const MaxHeight = Template.bind({}); MaxHeight.args = { id: 'height', title: 'If the modal wont fix in view it becomes scrollable', isVisible: true, children: [

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

Moralis web3uiKit will be PAMP!

, ], }; export const CustomWidth = Template.bind({}); CustomWidth.args = { id: 'width', title: 'You can pass any valid CSS value as width', isVisible: true, children: [

this Modal is 900px width (and will scale down with screen size)

, ], width: '900px', }; export const CustomFooter = Template.bind({}); CustomFooter.args = { title: 'This is a custom Footer Modal', children: [

Modal Body!

, ], hasCancel: false, customFooter: , }; export const CustomCloseButton = Template.bind({}); CustomCloseButton.args = { id: 'regular', title: 'Confirm', isVisible: true, closeButton: (