From 608ffa7ce534f71dff3e8983da666eabdac01aac Mon Sep 17 00:00:00 2001 From: Fernando Zanutto Date: Tue, 23 Apr 2024 15:04:22 -0300 Subject: [PATCH] feat: apply prettier and rename variable --- src/renderer/components/modal/modal.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/modal/modal.tsx b/src/renderer/components/modal/modal.tsx index 38236fb6..e6ab2973 100644 --- a/src/renderer/components/modal/modal.tsx +++ b/src/renderer/components/modal/modal.tsx @@ -41,7 +41,9 @@ export function Modal({ const isTopMostModal = () => { const openModals = document.getElementsByClassName("modal-container"); - return openModals.length && openModals[openModals.length - 1].id === componentId; + return ( + openModals.length && openModals[openModals.length - 1].id === componentId + ); }; useEffect(() => { @@ -63,9 +65,9 @@ export function Modal({ "modal-content-" + componentId ); - const clickInsideContent = modalContent.contains(e.target as Node); + const clickedOutsideContent = !modalContent.contains(e.target as Node); - if (!clickInsideContent) { + if (clickedOutsideContent) { handleCloseClick(); } };