fix: 添加发送邮件弹窗
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from '@workspace/airo-ui/components/alert-dialog';
|
||||
import CloseSvg from '@workspace/airo-ui/components/close.svg';
|
||||
import { cn } from '@workspace/airo-ui/lib/utils';
|
||||
import { Ref, useImperativeHandle, useState } from 'react';
|
||||
|
||||
interface AlertDialogComponentProps {
|
||||
@@ -20,6 +21,9 @@ interface AlertDialogComponentProps {
|
||||
cancelText?: string;
|
||||
confirmText?: string;
|
||||
onConfirm?: () => void;
|
||||
footerClassName?: string;
|
||||
wrapClassName?: string;
|
||||
descriptionClassName?: string;
|
||||
}
|
||||
|
||||
// 定义ref可以访问的方法类型
|
||||
@@ -35,6 +39,9 @@ const AlertDialogComponent: React.FC<AlertDialogComponentProps> = ({
|
||||
cancelText = 'Cancel',
|
||||
confirmText = 'Confirm',
|
||||
onConfirm,
|
||||
footerClassName,
|
||||
wrapClassName,
|
||||
descriptionClassName,
|
||||
}) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -52,17 +59,17 @@ const AlertDialogComponent: React.FC<AlertDialogComponentProps> = ({
|
||||
return (
|
||||
<AlertDialog open={open} onOpenChange={setOpen}>
|
||||
<AlertDialogPortal>
|
||||
<AlertDialogContent className={'py-[30px] sm:rounded-[25px]'}>
|
||||
<AlertDialogContent className={cn('py-[30px] sm:rounded-[25px]', wrapClassName)}>
|
||||
<div className={'absolute right-4 top-6'} onClick={() => setOpen(false)}>
|
||||
<CloseSvg />
|
||||
</div>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle className={'text-[#E22C2E]'}>{title}</AlertDialogTitle>
|
||||
<AlertDialogDescription className={'text-base font-light'}>
|
||||
<AlertDialogDescription className={cn('text-base font-light', descriptionClassName)}>
|
||||
{description}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter className={'sm:justify-center'}>
|
||||
<AlertDialogFooter className={cn('sm:justify-center', footerClassName)}>
|
||||
<AlertDialogAction asChild className={buttonVariants({ variant: 'primary' })}>
|
||||
<AiroButton variant={'primary'} onClick={onConfirm}>
|
||||
{confirmText}
|
||||
|
||||
Reference in New Issue
Block a user