mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
feat: apply prettier and rename variable
This commit is contained in:
parent
bcd961b791
commit
608ffa7ce5
1 changed files with 5 additions and 3 deletions
|
@ -41,7 +41,9 @@ export function Modal({
|
||||||
|
|
||||||
const isTopMostModal = () => {
|
const isTopMostModal = () => {
|
||||||
const openModals = document.getElementsByClassName("modal-container");
|
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(() => {
|
useEffect(() => {
|
||||||
|
@ -63,9 +65,9 @@ export function Modal({
|
||||||
"modal-content-" + componentId
|
"modal-content-" + componentId
|
||||||
);
|
);
|
||||||
|
|
||||||
const clickInsideContent = modalContent.contains(e.target as Node);
|
const clickedOutsideContent = !modalContent.contains(e.target as Node);
|
||||||
|
|
||||||
if (!clickInsideContent) {
|
if (clickedOutsideContent) {
|
||||||
handleCloseClick();
|
handleCloseClick();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue