1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Allow Android drop menu instead of long press

This commit is contained in:
Zhiyuan Zheng
2022-06-17 00:10:15 +02:00
parent d5104bf6f8
commit 16eaba14aa
6 changed files with 294 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import contextMenuStatus from '@components/ContextMenu/status'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import React from 'react'
import { createContext } from 'react'
import { Platform } from 'react-native'
import ContextMenu, {
ContextMenuAction,
ContextMenuProps
@ -27,7 +28,7 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
disabled,
...props
}) => {
if (!status || !queryKey) {
if (!status || !queryKey || disabled || Platform.OS === 'android') {
return <>{children}</>
}
@ -61,9 +62,7 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
rootQueryKey
})
return disabled ? (
<>{children}</>
) : (
return (
<ContextMenuContext.Provider value={actions}>
<ContextMenu
actions={actions}