diff --git a/src/components/BacklogView/Issue/DeleteButton.tsx b/src/components/BacklogView/Issue/DeleteButton.tsx index 982070ed..a1d2e2e9 100644 --- a/src/components/BacklogView/Issue/DeleteButton.tsx +++ b/src/components/BacklogView/Issue/DeleteButton.tsx @@ -68,7 +68,8 @@ export function DeleteButton({ }} /> setIssuePopoverOpened(false)} + cancelAlert={() => setIssuePopoverOpened(false)} + confirmAlert={() => setIssuePopoverOpened(false)} /> diff --git a/src/components/DetailView/Components/DeleteIssue/DeleteIssue.tsx b/src/components/DetailView/Components/DeleteIssue/DeleteIssue.tsx index dda7a57e..896afec7 100644 --- a/src/components/DetailView/Components/DeleteIssue/DeleteIssue.tsx +++ b/src/components/DetailView/Components/DeleteIssue/DeleteIssue.tsx @@ -1,5 +1,6 @@ import { Button, Popover } from "@mantine/core" import { IconTrash } from "@tabler/icons" +import {useState} from "react"; import { DeleteIssueAlert } from "./DeleteIssueAlert" export function DeleteIssue({ @@ -9,10 +10,22 @@ export function DeleteIssue({ issueKey: string closeModal: () => void }) { + const [issuePopoverOpened, setIssuePopoverOpened] = useState(false) + return ( - + - @@ -22,7 +35,11 @@ export function DeleteIssue({ theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white, })} > - + setIssuePopoverOpened(false)} + confirmAlert={closeModal} + /> ) diff --git a/src/components/DetailView/Components/DeleteIssue/DeleteIssueAlert.tsx b/src/components/DetailView/Components/DeleteIssue/DeleteIssueAlert.tsx index c366b340..d924bcd8 100644 --- a/src/components/DetailView/Components/DeleteIssue/DeleteIssueAlert.tsx +++ b/src/components/DetailView/Components/DeleteIssue/DeleteIssueAlert.tsx @@ -5,16 +5,18 @@ import { deleteIssueMutation } from "./queries" export function DeleteIssueAlert({ issueKey, - closeModal, + cancelAlert, + confirmAlert, }: { issueKey: string - closeModal: () => void + cancelAlert: () => void + confirmAlert: () => void }) { const queryClient = useQueryClient() const deleteIssue = deleteIssueMutation(queryClient) return ( - + } title="Attention!" @@ -26,7 +28,7 @@ export function DeleteIssueAlert({ onClick={(e) => { e.stopPropagation() deleteIssue.mutate(issueKey) - closeModal() + confirmAlert() }} > Confirm