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

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