diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js index 18f9c031d..fe926fefb 100644 --- a/apps/mobile/src/components/SelectionWrapper/index.js +++ b/apps/mobile/src/components/SelectionWrapper/index.js @@ -1,5 +1,5 @@ import React, {useEffect, useRef, useState} from 'react'; -import {TouchableOpacity, View, UIManager} from 'react-native'; +import {TouchableOpacity, View, UIManager, ViewBase} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {useTracked} from '../../provider'; import {Actions} from '../../provider/Actions'; @@ -89,8 +89,6 @@ const ActionStrip = ({note, setActionStrip}) => { const [state, dispatch] = useTracked(); const {colors, selectionMode} = state; const [isPinnedToMenu, setIsPinnedToMenu] = useState(false); - const toolTipTarget = useRef(); - const toolTipParent = useRef(); useEffect(() => { if (note.type === 'note') return; setIsPinnedToMenu(db.settings.isPinned(note.id)); @@ -248,7 +246,6 @@ const ActionStrip = ({note, setActionStrip}) => { return ( { (item) => item.visible && ( { if (selectionMode) { setActionStrip(false); @@ -339,14 +336,16 @@ const SelectionWrapper = ({ } }, [selectedItemsList]); + onLong = () => { + if (selectionMode) return; + setActionStrip(!actionStrip); + }; + return ( { - if (selectionMode) return; - setActionStrip(!actionStrip); - }} + onLongPress={onLong} onPress={onPress} customSelectedColor={colors.nav} customAlpha={!colors.night ? -0.02 : 0.02} @@ -372,37 +371,40 @@ const SelectionWrapper = ({ {item.type === 'note' && } - - {item.title !== 'General' && ( - - - - )} - + {selectionMode && ( + + {item.type !== 'topic' || + (item.type === 'topic' && item.title !== 'General') ? ( + + + + ) : null} + + )} {children}