mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
Modals: Add close animation.
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { useContext } from "preact/hooks";
|
||||
import { isModalClosing } from "../../components/ui/Modal";
|
||||
import { internalEmit } from "../../lib/eventEmitter";
|
||||
|
||||
import { IntermediateContext, useIntermediate } from "./Intermediate";
|
||||
import { SpecialInputModal } from "./modals/Input";
|
||||
@@ -14,7 +16,7 @@ export default function Popovers() {
|
||||
const { screen } = useContext(IntermediateContext);
|
||||
const { openScreen } = useIntermediate();
|
||||
|
||||
const onClose = () => openScreen({ id: "none" });
|
||||
const onClose = () => isModalClosing ? openScreen({ id: "none" }) : internalEmit('Modal', 'close');
|
||||
|
||||
switch (screen.id) {
|
||||
case "profile":
|
||||
|
||||
Reference in New Issue
Block a user