Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

add new Dialog for loading a new note

ammarahm-ed937bea37c3f5
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index 42a4582f4..342712091 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -8,7 +8,7 @@ import {
eClearEditor,
eCloseFullscreenEditor,
eOnNewTopicAdded,
- eApplyChanges,
+ eApplyChanges, eOnLoadNote
} from '../../services/events';
import NavigationService from '../../services/NavigationService';
import {db, DDS, getElevation, history, ToastEvent} from '../../utils/utils';
@@ -134,6 +134,11 @@ export class Dialog extends Component {
this.hide();
break;
}
+ case dialogActions.ACTION_NEW_NOTE: {
+ eSendEvent(eOnLoadNote, {type:"new"});
+ this.hide();
+ break;
+ }
case dialogActions.ACTION_EMPTY_TRASH: {
await db.trash.clear();
updateEvent({type: ACTIONS.TRASH});
diff --git a/apps/mobile/src/components/DialogManager/dialogActions.js b/apps/mobile/src/components/DialogManager/dialogActions.js
index 3fc9915c2..66a66a03b 100644
--- a/apps/mobile/src/components/DialogManager/dialogActions.js
+++ b/apps/mobile/src/components/DialogManager/dialogActions.js
@@ -6,5 +6,6 @@ export const dialogActions = {
ACTION_TRASH: 515,
ACTION_PERMANANT_DELETE: 516,
ACTION_APPLY_CHANGES: 517,
- ACTION_UPIN:518
+ ACTION_UPIN:518,
+ ACTION_NEW_NOTE:519
};
diff --git a/apps/mobile/src/components/DialogManager/templates.js b/apps/mobile/src/components/DialogManager/templates.js
index 7ade59cb2..9a81aa67e 100644
--- a/apps/mobile/src/components/DialogManager/templates.js
+++ b/apps/mobile/src/components/DialogManager/templates.js
@@ -84,6 +84,14 @@ export const TEMPLATE_EMPTY_TRASH = {
negativeText: 'Cancel',
action: dialogActions.ACTION_EMPTY_TRASH,
};
+export const TEMPLATE_NEW_NOTE = {
+ title: 'Close Note',
+ paragraph: 'Are you sure you want to close this note?',
+ icon: 'close',
+ positiveText: 'Yes',
+ negativeText: 'Cancel',
+ action: dialogActions.ACTION_NEW_NOTE,
+};
export const TEMPLATE_UNPIN = (type) => { return {
title: 'Unpin' + type,