From f5489463fedf7fdc3d417120c90def0bade19656 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 9 Sep 2020 22:09:57 +0500 Subject: [PATCH] add unpin from pinned note --- .../components/DialogManager/dialogActions.js | 1 + .../src/components/DialogManager/index.js | 4 +- .../src/components/DialogManager/templates.js | 9 +++ .../src/components/ExportDialog/index.js | 33 ++++++---- apps/mobile/src/components/NoteItem/index.js | 40 ++---------- .../src/components/NotebookItem/index.js | 18 +++-- .../src/components/PressableButton/index.js | 3 +- .../src/components/SelectionWrapper/index.js | 65 ++++++++++++++----- .../components/SimpleList/NoteItemWrapper.js | 1 + .../src/components/header/HeaderTitle.js | 35 +++++----- apps/mobile/src/components/header/index.js | 1 + 11 files changed, 115 insertions(+), 95 deletions(-) diff --git a/apps/mobile/src/components/DialogManager/dialogActions.js b/apps/mobile/src/components/DialogManager/dialogActions.js index b02bbd054..3fc9915c2 100644 --- a/apps/mobile/src/components/DialogManager/dialogActions.js +++ b/apps/mobile/src/components/DialogManager/dialogActions.js @@ -6,4 +6,5 @@ export const dialogActions = { ACTION_TRASH: 515, ACTION_PERMANANT_DELETE: 516, ACTION_APPLY_CHANGES: 517, + ACTION_UPIN:518 }; diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js index 4e88dd4e0..c9a3c8001 100644 --- a/apps/mobile/src/components/DialogManager/index.js +++ b/apps/mobile/src/components/DialogManager/index.js @@ -299,9 +299,7 @@ export class DialogManager extends Component { } : null } - initialOffsetFromBottom={ - DDS.isTab || item?.type !== 'note' || item.dateDeleted ? 1 : 0.5 - } + initialOffsetFromBottom={1} bounceOnOpen={true} gestureEnabled={true} onClose={() => { diff --git a/apps/mobile/src/components/DialogManager/templates.js b/apps/mobile/src/components/DialogManager/templates.js index 7e1f696a2..7ade59cb2 100644 --- a/apps/mobile/src/components/DialogManager/templates.js +++ b/apps/mobile/src/components/DialogManager/templates.js @@ -84,3 +84,12 @@ export const TEMPLATE_EMPTY_TRASH = { negativeText: 'Cancel', action: dialogActions.ACTION_EMPTY_TRASH, }; + +export const TEMPLATE_UNPIN = (type) => { return { + title: 'Unpin' + type, + paragraph: 'Are you sure you want to unpin this ' + type + '?', + icon: 'pin-off-outline', + positiveText: 'Unpin', + negativeText: 'Cancel', + action: dialogActions.ACTION_UPIN +}}; diff --git a/apps/mobile/src/components/ExportDialog/index.js b/apps/mobile/src/components/ExportDialog/index.js index bdd5df28a..9f9fec6bc 100644 --- a/apps/mobile/src/components/ExportDialog/index.js +++ b/apps/mobile/src/components/ExportDialog/index.js @@ -21,6 +21,7 @@ const { eCloseExportDialog, } = require('../../services/events'); import {Button} from '../Button/index'; +import Seperator from '../Seperator'; const ExportDialog = () => { const [state, dispatch] = useTracked(); @@ -102,7 +103,10 @@ const ExportDialog = () => { Note - + + Export your note in any of the following formats. + + {exporting ? ( { ) : ( {actions.map((item) => ( -