1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2022-08-09 00:44:56 +02:00
parent a68ed6ea1b
commit 9f17f95a98
12 changed files with 333 additions and 277 deletions

View File

@ -12,23 +12,26 @@ import ContextMenu, {
} from 'react-native-context-menu-view'
export interface Props {
copiableContent: React.MutableRefObject<{
content: string
complete: boolean
}>
status?: Mastodon.Status
queryKey?: QueryKeyTimeline
rootQueryKey?: QueryKeyTimeline
disabled?: boolean // Allowing toot to be copied when highlighted
}
export const ContextMenuContext = createContext<ContextMenuAction[]>([])
const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
children,
copiableContent,
status,
queryKey,
rootQueryKey,
disabled,
...props
}) => {
if (!status || !queryKey || disabled || Platform.OS === 'android') {
if (!status || !queryKey || Platform.OS === 'android') {
return <>{children}</>
}
@ -37,6 +40,7 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
const shareOnPress =
status.visibility !== 'direct'
? contextMenuShare({
copiableContent,
actions,
type: 'status',
url: status.url || status.uri