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

Allowing toot to be copied when highlighted

This commit is contained in:
Zhiyuan Zheng
2022-06-16 23:34:06 +02:00
parent 8d0fc94303
commit d5104bf6f8
3 changed files with 11 additions and 2 deletions

View File

@ -14,6 +14,7 @@ export interface Props {
status?: Mastodon.Status
queryKey?: QueryKeyTimeline
rootQueryKey?: QueryKeyTimeline
disabled?: boolean // Allowing toot to be copied when highlighted
}
export const ContextMenuContext = createContext<ContextMenuAction[]>([])
@ -23,6 +24,7 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
status,
queryKey,
rootQueryKey,
disabled,
...props
}) => {
if (!status || !queryKey) {
@ -59,7 +61,9 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
rootQueryKey
})
return (
return disabled ? (
<>{children}</>
) : (
<ContextMenuContext.Provider value={actions}>
<ContextMenu
actions={actions}