mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
only instantiate confirmAlert if needed
This commit is contained in:
@@ -49,7 +49,9 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmAlert = (
|
let confirmAlert = null;
|
||||||
|
if (showConfirmAlert) {
|
||||||
|
confirmAlert = (
|
||||||
<ConfirmAlert
|
<ConfirmAlert
|
||||||
title={t("branch.delete.confirmAlert.title")}
|
title={t("branch.delete.confirmAlert.title")}
|
||||||
message={t("branch.delete.confirmAlert.message", { branch: branch.name })}
|
message={t("branch.delete.confirmAlert.message", { branch: branch.name })}
|
||||||
@@ -67,6 +69,7 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
|||||||
close={() => setShowConfirmAlert(false)}
|
close={() => setShowConfirmAlert(false)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user