721965e67c
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import {View} from 'react-native'
|
|
import {type ChatBskyConvoDefs, type ModerationOpts} from '@atproto/api'
|
|
import {useLingui} from '@lingui/react/macro'
|
|
|
|
import {MessageContextMenu} from '#/components/dms/MessageContextMenu'
|
|
import {useMessageReplies} from '#/components/dms/MessageReplies'
|
|
import {SwipeToReply} from '#/components/dms/SwipeToReply'
|
|
import type * as bsky from '#/types/bsky'
|
|
|
|
export function ActionsWrapper({
|
|
message,
|
|
isFromSelf,
|
|
senderProfile,
|
|
moderationOpts,
|
|
children,
|
|
}: {
|
|
message: ChatBskyConvoDefs.MessageView
|
|
isFromSelf: boolean
|
|
senderProfile?: bsky.profile.AnyProfileView
|
|
moderationOpts: ModerationOpts | undefined
|
|
children: React.ReactNode
|
|
}) {
|
|
const {t: l} = useLingui()
|
|
const {setReply} = useMessageReplies()
|
|
|
|
return (
|
|
<SwipeToReply isFromSelf={isFromSelf} onReply={() => setReply(message)}>
|
|
{swipeGesture => (
|
|
<MessageContextMenu
|
|
message={message}
|
|
senderProfile={senderProfile}
|
|
moderationOpts={moderationOpts}
|
|
swipeGesture={swipeGesture}>
|
|
{trigger =>
|
|
// will always be true, since this file is platform split
|
|
trigger.IS_NATIVE && (
|
|
<View
|
|
accessible={true}
|
|
accessibilityActions={[
|
|
{name: 'activate', label: l`Open message options`},
|
|
]}
|
|
onAccessibilityAction={() => trigger.control.open('full')}>
|
|
{children}
|
|
</View>
|
|
)
|
|
}
|
|
</MessageContextMenu>
|
|
)}
|
|
</SwipeToReply>
|
|
)
|
|
}
|