fix: fix workflow as a tool confirm dialog layout issue (#18494)

This commit is contained in:
Wu Tianwei
2025-04-22 09:59:14 +08:00
committed by GitHub
parent ee30497237
commit 80f5ee1eb2
17 changed files with 34 additions and 22 deletions

View File

@@ -9,6 +9,8 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
type Props = {
isShow: boolean
onHide: () => void
dialogClassName?: string
dialogBackdropClassName?: string
panelClassName?: string
maxWidthClassName?: string
contentClassName?: string
@@ -26,6 +28,8 @@ type Props = {
const DrawerPlus: FC<Props> = ({
isShow,
onHide,
dialogClassName = '',
dialogBackdropClassName = '',
panelClassName = '',
maxWidthClassName = '!max-w-[640px]',
height = 'calc(100vh - 72px)',
@@ -55,7 +59,9 @@ const DrawerPlus: FC<Props> = ({
footer={null}
mask={isMobile || isShowMask}
positionCenter={positionCenter}
panelClassname={cn('mx-2 mb-3 mt-16 rounded-xl !p-0 sm:mr-2', panelClassName, maxWidthClassName)}
dialogClassName={dialogClassName}
dialogBackdropClassName={dialogBackdropClassName}
panelClassName={cn('mx-2 mb-3 mt-16 rounded-xl !p-0 sm:mr-2', panelClassName, maxWidthClassName)}
>
<div
className={cn(contentClassName, 'flex w-full flex-col rounded-xl border-[0.5px] border-divider-subtle bg-components-panel-bg shadow-xl')}

View File

@@ -8,7 +8,9 @@ import cn from '@/utils/classnames'
export type IDrawerProps = {
title?: string
description?: string
panelClassname?: string
dialogClassName?: string
dialogBackdropClassName?: string
panelClassName?: string
children: React.ReactNode
footer?: React.ReactNode
mask?: boolean
@@ -25,7 +27,9 @@ export type IDrawerProps = {
export default function Drawer({
title = '',
description = '',
panelClassname = '',
dialogClassName = '',
dialogBackdropClassName = '',
panelClassName = '',
children,
footer,
mask = true,
@@ -44,17 +48,17 @@ export default function Drawer({
unmount={unmount}
open={isOpen}
onClose={() => !clickOutsideNotOpen && onClose()}
className="fixed inset-0 z-[80] overflow-y-auto"
className={cn('fixed inset-0 z-[30] overflow-y-auto', dialogClassName)}
>
<div className={cn('flex h-screen w-screen justify-end', positionCenter && '!justify-center')}>
{/* mask */}
<DialogBackdrop
className={cn('fixed inset-0 z-[90]', mask && 'bg-black bg-opacity-30')}
className={cn('fixed inset-0 z-[40]', mask && 'bg-black/30', dialogBackdropClassName)}
onClick={() => {
!clickOutsideNotOpen && onClose()
}}
/>
<div className={cn('relative z-[100] 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={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 && <DialogTitle