Chore: frontend infrastructure upgrade (#16420)
Co-authored-by: NFish <douxc512@gmail.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
'use client'
|
||||
import { Dialog } from '@headlessui/react'
|
||||
import { Dialog, DialogBackdrop, DialogTitle } from '@headlessui/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { XMarkIcon } from '@heroicons/react/24/outline'
|
||||
import Button from '../button'
|
||||
@@ -44,27 +44,30 @@ export default function Drawer({
|
||||
unmount={unmount}
|
||||
open={isOpen}
|
||||
onClose={() => !clickOutsideNotOpen && onClose()}
|
||||
className="fixed z-30 inset-0 overflow-y-auto"
|
||||
className="fixed inset-0 z-30 overflow-y-auto"
|
||||
>
|
||||
<div className={cn('flex w-screen h-screen justify-end', positionCenter && '!justify-center')}>
|
||||
<div className={cn('flex h-screen w-screen justify-end', positionCenter && '!justify-center')}>
|
||||
{/* mask */}
|
||||
<Dialog.Overlay
|
||||
className={cn('z-40 fixed inset-0', mask && 'bg-black bg-opacity-30')}
|
||||
<DialogBackdrop
|
||||
className={cn('fixed inset-0 z-40', mask && 'bg-black bg-opacity-30')}
|
||||
onClick={() => {
|
||||
!clickOutsideNotOpen && onClose()
|
||||
}}
|
||||
/>
|
||||
<div className={cn('relative z-50 flex flex-col justify-between bg-components-panel-bg w-full max-w-sm p-6 overflow-hidden text-left align-middle shadow-xl', panelClassname)}>
|
||||
<div className={cn('relative z-50 flex w-full max-w-sm flex-col justify-between overflow-hidden bg-components-panel-bg p-6 text-left align-middle shadow-xl', panelClassname)}>
|
||||
<>
|
||||
<div className='flex justify-between'>
|
||||
{title && <Dialog.Title
|
||||
{title && <DialogTitle
|
||||
as="h3"
|
||||
className="text-lg font-medium leading-6 text-text-primary"
|
||||
>
|
||||
{title}
|
||||
</Dialog.Title>}
|
||||
{showClose && <Dialog.Title className="flex items-center mb-4 cursor-pointer" as="div">
|
||||
<XMarkIcon className='w-4 h-4 text-text-tertiary' onClick={onClose} />
|
||||
</Dialog.Title>}
|
||||
</DialogTitle>}
|
||||
{showClose && <DialogTitle className="mb-4 flex cursor-pointer items-center" as="div">
|
||||
<XMarkIcon className='h-4 w-4 text-text-tertiary' onClick={onClose} />
|
||||
</DialogTitle>}
|
||||
</div>
|
||||
{description && <Dialog.Description className='text-text-tertiary text-xs font-normal mt-2'>{description}</Dialog.Description>}
|
||||
{description && <div className='mt-2 text-xs font-normal text-text-tertiary'>{description}</div>}
|
||||
{children}
|
||||
</>
|
||||
{footer || (footer === null
|
||||
|
Reference in New Issue
Block a user