2021-07-01 22:34:18 +05:00
|
|
|
import { eSendEvent } from "../../services/EventManager";
|
|
|
|
|
import { eCloseSimpleDialog, eOpenSimpleDialog } from "../../utils/Events";
|
|
|
|
|
|
|
|
|
|
type DialogInfo = {
|
|
|
|
|
title?: string,
|
|
|
|
|
paragraph?: string,
|
|
|
|
|
positiveText?: string,
|
|
|
|
|
negativeText?: string,
|
2021-07-12 10:55:10 +05:00
|
|
|
positivePress?: (value:any) => void,
|
2021-07-01 22:34:18 +05:00
|
|
|
onClose?: () => void,
|
|
|
|
|
positiveType?: "transparent" | "gray" | "grayBg" | "accent" | "inverted" | "shade" | "error" | "errorShade",
|
|
|
|
|
icon?: string,
|
2021-07-12 10:55:10 +05:00
|
|
|
paragraphColor: string,
|
|
|
|
|
input:boolean,
|
|
|
|
|
inputPlaceholder:string,
|
2021-07-24 13:15:18 +05:00
|
|
|
defaultValue:string,
|
|
|
|
|
context:"global" | "local"
|
2021-07-01 22:34:18 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function presentDialog(data: DialogInfo): void {
|
|
|
|
|
eSendEvent(eOpenSimpleDialog, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function hideDialog(): void {
|
|
|
|
|
|
|
|
|
|
eSendEvent(eCloseSimpleDialog);
|
|
|
|
|
|
|
|
|
|
}
|