Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/ui/src/modals/alert-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { LucideIcon } from "lucide-react";
import { AlertTriangle, Info } from "lucide-react";
import React from "react";
// components
import type { TButtonVariant } from "../button";
import { Button } from "../button";
import type { TButtonVariant } from "@plane/propel/button";
import { Button } from "@plane/propel/button";
import { cn } from "../utils";
import { EModalPosition, EModalWidth } from "./constants";
import { ModalCore } from "./modal-core";
Expand All @@ -28,6 +28,7 @@ type Props = {
title: string;
variant?: TModalVariant;
width?: EModalWidth;
customIcon?: React.ReactNode;
};

const VARIANT_ICONS: Record<TModalVariant, LucideIcon> = {
Expand All @@ -36,7 +37,7 @@ const VARIANT_ICONS: Record<TModalVariant, LucideIcon> = {
};

const BUTTON_VARIANTS: Record<TModalVariant, TButtonVariant> = {
danger: "danger",
danger: "error-fill",
primary: "primary",
};

Expand All @@ -62,6 +63,7 @@ export function AlertModalCore(props: Props) {
title,
variant = "danger",
width = EModalWidth.XL,
customIcon,
} = props;

const Icon = VARIANT_ICONS[variant];
Expand All @@ -76,7 +78,7 @@ export function AlertModalCore(props: Props) {
VARIANT_CLASSES[variant]
)}
>
<Icon className="size-5" aria-hidden="true" />
{customIcon ? <>{customIcon}</> : <Icon className="size-5" aria-hidden="true" />}
</span>
)}
<div className="text-center sm:text-left">
Expand All @@ -85,7 +87,7 @@ export function AlertModalCore(props: Props) {
</div>
</div>
<div className="px-5 py-4 flex flex-col-reverse sm:flex-row sm:justify-end gap-2 border-t-[0.5px] border-subtle">
<Button variant="neutral-primary" onClick={handleClose}>
<Button variant="secondary" onClick={handleClose}>
{secondaryButtonText}
</Button>
<Button variant={BUTTON_VARIANTS[variant]} tabIndex={1} onClick={handleSubmit} loading={isSubmitting}>
Expand Down
Loading