Files
notesnook/apps/mobile/src/components/Dialog/functions.ts

28 lines
733 B
TypeScript
Raw Normal View History

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,
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"
}
export function presentDialog(data: DialogInfo): void {
eSendEvent(eOpenSimpleDialog, data);
}
export function hideDialog(): void {
eSendEvent(eCloseSimpleDialog);
}