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

35 lines
773 B
TypeScript
Raw Normal View History

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