diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index 2487cd8685..5ec91f0e1d 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -242,7 +242,7 @@ const SettingsModal: FC = ({ onChange={e => onDesChange(e.target.value)} placeholder={t(`${prefixSettings}.webDescPlaceholder`) as string} /> - {isChatBot && ( + {isChat && (
{t('app.answerIcon.title')}
diff --git a/web/app/components/base/dialog/index.tsx b/web/app/components/base/dialog/index.tsx index 6554ef9009..829d3f0c04 100644 --- a/web/app/components/base/dialog/index.tsx +++ b/web/app/components/base/dialog/index.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback } from 'react' import type { ElementType, ReactNode } from 'react' -import { Dialog, DialogPanel, DialogTitle, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react' import classNames from '@/utils/classnames' // https://headlessui.com/react/dialog @@ -34,32 +34,25 @@ const CustomDialog = ({ return ( - {/* -
- */} - {/* TODO: to new Transition */} -
+ +
+
- {/* - + + {Boolean(title) && ( )} - */} - {/* TODO: to new Transition */} - - {Boolean(title) && ( - - {title} - - )} -
- {children} -
- {Boolean(footer) && ( -
- {footer} -
- )} -
+
diff --git a/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx b/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx index c61a325858..e6dc4e2139 100644 --- a/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx +++ b/web/app/components/base/features/new-feature-panel/dialog-wrapper.tsx @@ -1,6 +1,6 @@ import { Fragment, useCallback } from 'react' import type { ReactNode } from 'react' -import { Dialog, DialogPanel, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' import cn from '@/utils/classnames' type DialogProps = { @@ -22,39 +22,29 @@ const DialogWrapper = ({ return ( - {/* -
- */} - {/* TODO: to new Transition */} -
+ +
+
- {/* - + + {children} - */} - {/* TODO: to new Transition */} - - {children} - +
diff --git a/web/app/components/base/fullscreen-modal/index.tsx b/web/app/components/base/fullscreen-modal/index.tsx index f53ebc5b29..9d99e280ec 100644 --- a/web/app/components/base/fullscreen-modal/index.tsx +++ b/web/app/components/base/fullscreen-modal/index.tsx @@ -1,7 +1,7 @@ -import { Dialog, DialogPanel, Transition } from '@headlessui/react' +import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' +import { Fragment } from 'react' import { RiCloseLargeLine } from '@remixicon/react' import classNames from '@/utils/classnames' -import { useEffect, useState } from 'react' type IModal = { className?: string @@ -24,59 +24,51 @@ export default function FullScreenModal({ closable = false, overflowVisible = false, }: IModal) { - const [showTransition, setShowTransition] = useState(false) - useEffect(() => { - if (!open) { - setShowTransition(false) - return - } - setTimeout(() => { - setShowTransition(true) - }, 100) - }, [open]) return ( - - -
- + + + +
+ -
{ - e.preventDefault() - e.stopPropagation() - }} - > -
- - - {closable - &&
+ {closable + &&
{ - e.stopPropagation() - onClose() - }}> - -
} - {children} - - + onClick={(e) => { + e.stopPropagation() + onClose() + }}> + +
} + {children} +
+ +
-
-
+
+
) } diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsx index 4d586add57..04bc11b2c8 100644 --- a/web/app/components/base/modal/index.tsx +++ b/web/app/components/base/modal/index.tsx @@ -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 { RiCloseLine } from '@remixicon/react' import classNames from '@/utils/classnames' @@ -30,19 +30,14 @@ export default function Modal({ return ( - {/* -
- */} - {/* TODO: to new Transition */} -
+ +
+
- {/* + {title && } {children} - */} - {/* TODO: to new Transition */} - - {title && - {title} - } - {description &&
- {description} -
} - {closable - &&
- { - e.stopPropagation() - onClose() - } - } /> -
} - {children} -
+
diff --git a/web/app/components/header/account-setting/menu-dialog.tsx b/web/app/components/header/account-setting/menu-dialog.tsx index c6e1fd8ba8..c1d0c46d4d 100644 --- a/web/app/components/header/account-setting/menu-dialog.tsx +++ b/web/app/components/header/account-setting/menu-dialog.tsx @@ -35,22 +35,13 @@ const MenuDialog = ({ { }}>
- {/* - -
- {children} - - */} - {/* TODO: to new Transition */} - +
{children}