mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-18 04:37:51 +01:00
24 lines
627 B
TypeScript
24 lines
627 B
TypeScript
|
|
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);
|
||
|
|
|
||
|
|
}
|