2022-01-22 12:57:05 +05:00
|
|
|
import { eSendEvent } from '../../services/EventManager';
|
|
|
|
|
import { eCloseSimpleDialog, eOpenSimpleDialog } from '../../utils/Events';
|
2021-07-01 22:34:18 +05:00
|
|
|
|
|
|
|
|
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';
|
|
|
|
|
};
|
2021-07-01 22:34:18 +05:00
|
|
|
|
|
|
|
|
export function presentDialog(data: DialogInfo): void {
|
|
|
|
|
eSendEvent(eOpenSimpleDialog, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function hideDialog(): void {
|
|
|
|
|
eSendEvent(eCloseSimpleDialog);
|
2022-01-22 12:57:05 +05:00
|
|
|
}
|