|
|
|
@ -1,4 +1,4 @@
|
|
|
|
import { Dialog, DialogPanel, DialogTitle, Transition } from '@headlessui/react'
|
|
|
|
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react'
|
|
|
|
import { Fragment } from 'react'
|
|
|
|
import { Fragment } from 'react'
|
|
|
|
import { RiCloseLine } from '@remixicon/react'
|
|
|
|
import { RiCloseLine } from '@remixicon/react'
|
|
|
|
import classNames from '@/utils/classnames'
|
|
|
|
import classNames from '@/utils/classnames'
|
|
|
|
@ -30,19 +30,14 @@ export default function Modal({
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Transition appear show={isShow} as={Fragment}>
|
|
|
|
<Transition appear show={isShow} as={Fragment}>
|
|
|
|
<Dialog as="div" className={classNames('relative z-[60]', wrapperClassName)} onClose={onClose}>
|
|
|
|
<Dialog as="div" className={classNames('relative z-[60]', wrapperClassName)} onClose={onClose}>
|
|
|
|
{/* <Transition.Child
|
|
|
|
<TransitionChild>
|
|
|
|
as={Fragment}
|
|
|
|
<div className={classNames(
|
|
|
|
enter="ease-out duration-300"
|
|
|
|
'fixed inset-0 bg-background-overlay',
|
|
|
|
enterFrom="opacity-0"
|
|
|
|
'data-[closed]:opacity-0',
|
|
|
|
enterTo="opacity-100"
|
|
|
|
'data-[enter]:ease-out data-[enter]:duration-300 data-[enter]:opacity-100',
|
|
|
|
leave="ease-in duration-200"
|
|
|
|
'data-[leave]:ease-in data-[leave]:duration-200 data-[leave]:opacity-0',
|
|
|
|
leaveFrom="opacity-100"
|
|
|
|
)} />
|
|
|
|
leaveTo="opacity-0"
|
|
|
|
</TransitionChild>
|
|
|
|
>
|
|
|
|
|
|
|
|
<div className="fixed inset-0 bg-background-overlay" />
|
|
|
|
|
|
|
|
</Transition.Child> */}
|
|
|
|
|
|
|
|
{/* TODO: to new Transition */}
|
|
|
|
|
|
|
|
<div className="fixed inset-0 bg-background-overlay" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
className="fixed inset-0 overflow-y-auto"
|
|
|
|
className="fixed inset-0 overflow-y-auto"
|
|
|
|
@ -52,18 +47,13 @@ export default function Modal({
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div className="flex min-h-full items-center justify-center p-4 text-center">
|
|
|
|
<div className="flex min-h-full items-center justify-center p-4 text-center">
|
|
|
|
{/* <Transition.Child
|
|
|
|
<TransitionChild>
|
|
|
|
as={Fragment}
|
|
|
|
|
|
|
|
enter="ease-out duration-300"
|
|
|
|
|
|
|
|
enterFrom="opacity-0 scale-95"
|
|
|
|
|
|
|
|
enterTo="opacity-100 scale-100"
|
|
|
|
|
|
|
|
leave="ease-in duration-200"
|
|
|
|
|
|
|
|
leaveFrom="opacity-100 scale-100"
|
|
|
|
|
|
|
|
leaveTo="opacity-0 scale-95"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<DialogPanel className={classNames(
|
|
|
|
<DialogPanel className={classNames(
|
|
|
|
'w-full max-w-[480px] transform rounded-2xl bg-components-panel-bg p-6 text-left align-middle shadow-xl transition-all',
|
|
|
|
'w-full max-w-[480px] transform rounded-2xl bg-components-panel-bg p-6 text-left align-middle shadow-xl transition-all',
|
|
|
|
overflowVisible ? 'overflow-visible' : 'overflow-hidden',
|
|
|
|
overflowVisible ? 'overflow-visible' : 'overflow-hidden',
|
|
|
|
|
|
|
|
'data-[closed]:opacity-0',
|
|
|
|
|
|
|
|
'data-[enter]:ease-out data-[enter]:duration-300 data-[enter]:opacity-100',
|
|
|
|
|
|
|
|
'data-[leave]:ease-in data-[leave]:duration-200 data-[leave]:opacity-0',
|
|
|
|
className,
|
|
|
|
className,
|
|
|
|
)}>
|
|
|
|
)}>
|
|
|
|
{title && <DialogTitle
|
|
|
|
{title && <DialogTitle
|
|
|
|
@ -86,33 +76,7 @@ export default function Modal({
|
|
|
|
</div>}
|
|
|
|
</div>}
|
|
|
|
{children}
|
|
|
|
{children}
|
|
|
|
</DialogPanel>
|
|
|
|
</DialogPanel>
|
|
|
|
</Transition.Child> */}
|
|
|
|
</TransitionChild>
|
|
|
|
{/* TODO: to new Transition */}
|
|
|
|
|
|
|
|
<DialogPanel className={classNames(
|
|
|
|
|
|
|
|
'w-full max-w-[480px] transform rounded-2xl bg-components-panel-bg p-6 text-left align-middle shadow-xl transition-all',
|
|
|
|
|
|
|
|
overflowVisible ? 'overflow-visible' : 'overflow-hidden',
|
|
|
|
|
|
|
|
className,
|
|
|
|
|
|
|
|
)}>
|
|
|
|
|
|
|
|
{title && <DialogTitle
|
|
|
|
|
|
|
|
as="h3"
|
|
|
|
|
|
|
|
className="title-2xl-semi-bold text-text-primary"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{title}
|
|
|
|
|
|
|
|
</DialogTitle>}
|
|
|
|
|
|
|
|
{description && <div className='text-text-secondary body-md-regular mt-2'>
|
|
|
|
|
|
|
|
{description}
|
|
|
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
{closable
|
|
|
|
|
|
|
|
&& <div className='absolute z-10 top-6 right-6 w-5 h-5 rounded-2xl flex items-center justify-center hover:cursor-pointer hover:bg-state-base-hover'>
|
|
|
|
|
|
|
|
<RiCloseLine className='w-4 h-4 text-text-tertiary' onClick={
|
|
|
|
|
|
|
|
(e) => {
|
|
|
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
|
|
|
onClose()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} />
|
|
|
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
{children}
|
|
|
|
|
|
|
|
</DialogPanel>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Dialog>
|
|
|
|
</Dialog>
|
|
|
|
|