mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
only instantiate confirmAlert if needed
This commit is contained in:
@@ -49,24 +49,27 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmAlert = (
|
let confirmAlert = null;
|
||||||
<ConfirmAlert
|
if (showConfirmAlert) {
|
||||||
title={t("branch.delete.confirmAlert.title")}
|
confirmAlert = (
|
||||||
message={t("branch.delete.confirmAlert.message", { branch: branch.name })}
|
<ConfirmAlert
|
||||||
buttons={[
|
title={t("branch.delete.confirmAlert.title")}
|
||||||
{
|
message={t("branch.delete.confirmAlert.message", { branch: branch.name })}
|
||||||
className: "is-outlined",
|
buttons={[
|
||||||
label: t("branch.delete.confirmAlert.submit"),
|
{
|
||||||
onClick: () => deleteBranch()
|
className: "is-outlined",
|
||||||
},
|
label: t("branch.delete.confirmAlert.submit"),
|
||||||
{
|
onClick: () => deleteBranch()
|
||||||
label: t("branch.delete.confirmAlert.cancel"),
|
},
|
||||||
onClick: () => null
|
{
|
||||||
}
|
label: t("branch.delete.confirmAlert.cancel"),
|
||||||
]}
|
onClick: () => null
|
||||||
close={() => setShowConfirmAlert(false)}
|
}
|
||||||
/>
|
]}
|
||||||
);
|
close={() => setShowConfirmAlert(false)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user