feat: re-work modal behaviour to be more natural

This commit is contained in:
Paul Makles
2022-06-18 11:22:37 +01:00
parent 12217ae2a8
commit bfd9439f27
11 changed files with 72 additions and 12 deletions

View File

@@ -13,6 +13,8 @@ import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
import { useApplicationState } from "../../mobx/State";
import { modalController } from "../../context/modals";
import ButtonItem from "../../components/navigation/items/ButtonItem";
interface Props {
@@ -61,6 +63,8 @@ export function GenericSettings({
useEffect(() => {
function keyDown(e: KeyboardEvent) {
if (e.key === "Escape") {
if (modalController.isVisible) return;
exitSettings();
}
}