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

@ -78,6 +78,7 @@ const TimelineDefault: React.FC<Props> = ({
status={actualStatus}
queryKey={queryKey}
rootQueryKey={rootQueryKey}
disabled={highlighted}
>
<Pressable
accessible={highlighted ? false : true}

View File

@ -59,7 +59,11 @@ const TimelineNotifications = React.memo(
}, [])
return (
<TimelineContextMenu status={notification.status} queryKey={queryKey}>
<TimelineContextMenu
status={notification.status}
queryKey={queryKey}
disabled={highlighted}
>
<Pressable
style={{
padding: StyleConstants.Spacing.Global.PagePadding,

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}