refactor dialog to show dialogs impertively

This commit is contained in:
ammarahm-ed
2021-07-01 22:34:18 +05:00
parent 4957497553
commit 56e67097b3
12 changed files with 267 additions and 394 deletions

View File

@@ -0,0 +1,24 @@
import { eSendEvent } from "../../services/EventManager";
import { eCloseSimpleDialog, eOpenSimpleDialog } from "../../utils/Events";
type DialogInfo = {
title?: string,
paragraph?: string,
positiveText?: string,
negativeText?: string,
positivePress?: () => void,
onClose?: () => void,
positiveType?: "transparent" | "gray" | "grayBg" | "accent" | "inverted" | "shade" | "error" | "errorShade",
icon?: string,
paragraphColor: string
}
export function presentDialog(data: DialogInfo): void {
eSendEvent(eOpenSimpleDialog, data);
}
export function hideDialog(): void {
eSendEvent(eCloseSimpleDialog);
}