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) => (
-
)}
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js
index afb3d11f3..5c1d81828 100644
--- a/apps/mobile/src/components/NoteItem/index.js
+++ b/apps/mobile/src/components/NoteItem/index.js
@@ -1,13 +1,9 @@
import React from 'react';
-import {Dimensions, Text, TouchableOpacity, View} from 'react-native';
+import { Dimensions, Text, TouchableOpacity, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import {ph, pv, SIZE, WEIGHT} from '../../common/common';
-import {eSendEvent, openVault} from '../../services/eventManager';
-import {eOnLoadNote, eShowMergeDialog} from '../../services/events';
-import {openEditorAnimation} from '../../utils/animations';
-import {DDS, timeSince} from '../../utils/utils';
-import {ActionSheetEvent, simpleDialogEvent} from '../DialogManager/recievers';
-import {TEMPLATE_TRASH} from '../DialogManager/templates';
+import { ph, SIZE, WEIGHT } from '../../common/common';
+import { timeSince } from '../../utils/utils';
+import { ActionSheetEvent } from '../DialogManager/recievers';
const w = Dimensions.get('window').width;
const h = Dimensions.get('window').height;
@@ -54,30 +50,6 @@ export default class NoteItem extends React.Component {
}
}
- _onPress = async () => {
- if (item.conflicted) {
- eSendEvent(eShowMergeDialog, item);
-
- return;
- }
- if (this.props.selectionMode) {
- this.props.onLongPress();
- return;
- } else if (item.locked) {
- openVault(item, true, true, false, true, false);
-
- return;
- }
- if (DDS.isTab) {
- eSendEvent(eOnLoadNote, item);
- } else if (isTrash) {
- simpleDialogEvent(TEMPLATE_TRASH(item.type));
- } else {
- eSendEvent(eOnLoadNote, item);
- openEditorAnimation();
- }
- };
-
render() {
let {colors, item, customStyle, isTrash} = this.props;
return (
@@ -105,7 +77,7 @@ export default class NoteItem extends React.Component {
numberOfLines={1}
style={{
color: colors.heading,
- fontSize: SIZE.sm + 1,
+ fontSize: SIZE.md,
fontFamily: WEIGHT.bold,
maxWidth: '100%',
}}>
@@ -120,7 +92,7 @@ export default class NoteItem extends React.Component {
{isTopic || !item.description ? null : (
{item.description}
diff --git a/apps/mobile/src/components/PressableButton/index.js b/apps/mobile/src/components/PressableButton/index.js
index df1c19956..900847613 100644
--- a/apps/mobile/src/components/PressableButton/index.js
+++ b/apps/mobile/src/components/PressableButton/index.js
@@ -10,7 +10,8 @@ export const PressableButton = ({
radius,
children,
onPress,
- customStyle,alpha=-0.1,
+ customStyle,
+ alpha=-0.1,
opacity=1,
onLongPress
}) => {
diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js
index d281a03b8..f03bbe769 100644
--- a/apps/mobile/src/components/SelectionWrapper/index.js
+++ b/apps/mobile/src/components/SelectionWrapper/index.js
@@ -4,7 +4,7 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { SIZE } from '../../common/common';
import { useTracked } from '../../provider';
import { ACTIONS } from '../../provider/actions';
-import { getElevation } from '../../utils/utils';
+import { db, getElevation, ToastEvent } from '../../utils/utils';
import { PressableButton } from '../PressableButton';
const SelectionWrapper = ({
@@ -15,7 +15,7 @@ const SelectionWrapper = ({
background,
pinned,
onLongPress,
- onPress
+ onPress,
}) => {
const [state, dispatch] = useTracked();
const {colors, selectionMode, selectedItemsList} = state;
@@ -36,24 +36,51 @@ const SelectionWrapper = ({
}
}, [selectedItemsList]);
-
-
-
-
+ const onPressPin = async () => {
+ let func = async () => {
+ if (!item.id) return;
+ if (item.type === 'note') {
+ await db.notes.note(note.id).pin();
+ dispatch({type: ACTIONS.PINNED});
+ dispatch({type: ACTIONS.NOTES});
+ } else {
+ await db.notebooks.notebook(note.id).pin();
+ dispatch({type: ACTIONS.PINNED});
+ dispatch({type: ACTIONS.NOTEBOOKS});
+ }
+ };
+ func();
+ ToastEvent.show(
+ item.type + ' has been unpinned.',
+ 'success',
+ 'global',
+ 6000,
+ () => {
+ func();
+ ToastEvent.hide('unpin');
+ },
+ 'Undo',
+ );
+ };
return (
{pinned ? (
-
-
+
) : null}
{
let headerTextState = root ? state.headerTextState : state.indHeaderTextState;
return (
-
+ <>
- {headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
-
+
+ {headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
+
- {headerTextState.heading.slice(0, 1) === '#'
- ? headerTextState.heading.slice(1)
- : headerTextState.heading}
-
+ {headerTextState.heading.slice(0, 1) === '#'
+ ? headerTextState.heading.slice(1)
+ : headerTextState.heading}
+
+ >
);
};
diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js
index a9ea05f73..a3e7d1ac3 100644
--- a/apps/mobile/src/components/header/index.js
+++ b/apps/mobile/src/components/header/index.js
@@ -94,6 +94,7 @@ export const Header = ({showSearch, root}) => {
? 0
: insets.top,
backgroundColor: colors.bg,
+ overflow:"hidden"
},
]}>