mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-11 17:44:19 -05:00
fix confirm button onclick behaviour
This commit is contained in:
@@ -167,9 +167,9 @@ export const ConfirmButton = ({
|
||||
}: {
|
||||
title: string;
|
||||
icon: ReactNode;
|
||||
onClick: () => void;
|
||||
intent?: ButtonProps["intent"];
|
||||
disabled?: boolean;
|
||||
onClick?: () => void;
|
||||
}) => {
|
||||
const [confirmed, set] = useState(false);
|
||||
|
||||
@@ -180,7 +180,14 @@ export const ConfirmButton = ({
|
||||
icon={confirmed ? <Check className="w-4 h-4" /> : icon}
|
||||
intent={intent}
|
||||
disabled={disabled}
|
||||
onClick={confirmed ? onClick : () => set(true)}
|
||||
onClick={
|
||||
confirmed
|
||||
? () => {
|
||||
onClick();
|
||||
set(false);
|
||||
}
|
||||
: () => set(true)
|
||||
}
|
||||
className={confirmed ? "z-50" : ""}
|
||||
/>
|
||||
{confirmed && (
|
||||
|
||||
Reference in New Issue
Block a user