Modals: Add close animation.

This commit is contained in:
Paul
2021-07-07 22:02:18 +01:00
parent 1f5bed9004
commit bd07b461ac
5 changed files with 43 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
import { isModalClosing } from "../../components/ui/Modal";
import { internalEmit } from "../../lib/eventEmitter";
import { Screen } from "./Intermediate";
import { ClipboardModal } from "./modals/Clipboard";
import { ErrorModal } from "./modals/Error";
@@ -12,7 +14,7 @@ export interface Props {
}
export default function Modals({ screen, openScreen }: Props) {
const onClose = () => openScreen({ id: "none" });
const onClose = () => isModalClosing ? openScreen({ id: "none" }) : internalEmit('Modal', 'close');
switch (screen.id) {
case "_prompt":