Skip to content

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

open actionsheet on longpress a shortcut item

ammarahm-edf00485526ab7
diff --git a/apps/mobile/src/components/Menu/TagsSection.js b/apps/mobile/src/components/Menu/TagsSection.js
index 1e7b9c24d..81eb81ae4 100644
--- a/apps/mobile/src/components/Menu/TagsSection.js
+++ b/apps/mobile/src/components/Menu/TagsSection.js
@@ -1,20 +1,21 @@
-import React, { useEffect, useRef, useState } from 'react';
-import { FlatList, View } from 'react-native';
+import React, {useEffect, useRef, useState} from 'react';
+import {FlatList, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import { useTracked } from '../../provider';
-import { useMenuStore, useNoteStore } from '../../provider/stores';
+import {useTracked} from '../../provider';
+import {useMenuStore, useNoteStore} from '../../provider/stores';
import {
eSendEvent,
eSubscribeEvent,
eUnSubscribeEvent
} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
-import { db } from '../../utils/database';
-import { eOnNewTopicAdded, refreshNotesPage } from '../../utils/Events';
-import { normalize, SIZE } from '../../utils/SizeUtils';
+import {db} from '../../utils/database';
+import {eOnNewTopicAdded, refreshNotesPage} from '../../utils/Events';
+import {normalize, SIZE} from '../../utils/SizeUtils';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
-import { Button } from '../Button';
-import { PressableButton } from '../PressableButton';
+import {Button} from '../Button';
+import {ActionSheetEvent} from '../DialogManager/recievers';
+import {PressableButton} from '../PressableButton';
import Seperator from '../Seperator';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
@@ -153,8 +154,19 @@ const PinItem = ({item, index, onPress}) => {
<PressableButton
type={headerTextState?.id === item.id ? 'grayBg' : 'gray'}
onLongPress={() => {
- setVisible(!visible);
- fwdRef.current?.show();
+ let rowItems = [];
+ if (item.type === 'tag') {
+ rowItems = ['Add Shortcut', 'Delete', 'Rename Tag'];
+ ActionSheetEvent(item, false, false, rowItems);
+ } else if (item.type === 'notebook' || item.type === 'topic') {
+ rowItems =
+ item.type === 'topic'
+ ? ['Edit Topic', 'Add Shortcut', 'Delete']
+ : ['Edit Notebook', 'Pin', 'Add Shortcut', 'Delete'];
+ ActionSheetEvent(item, false, false, rowItems, {
+ notebookID: item.notebookId
+ });
+ }
}}
onPress={() => onPress(item)}
customStyle={{