Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {type ChatBskyConvoDefs} from '@atproto/api'
3import {useLingui} from '@lingui/react/macro'
4
5import {atoms as a} from '#/alf'
6import {MessageContextMenu} from '#/components/dms/MessageContextMenu'
7
8export function ActionsWrapper({
9 message,
10 isFromSelf,
11 children,
12 onTap,
13}: {
14 message: ChatBskyConvoDefs.MessageView
15 hasReactions?: boolean
16 isFromSelf: boolean
17 children: React.ReactNode
18 onTap?: () => void
19}) {
20 const {t: l} = useLingui()
21
22 return (
23 <MessageContextMenu message={message} onTap={onTap}>
24 {trigger =>
25 // will always be true, since this file is platform split
26 trigger.IS_NATIVE && (
27 <View style={[a.flex_1, a.relative]}>
28 <View
29 style={[
30 {maxWidth: '80%'},
31 isFromSelf
32 ? [a.self_end, a.align_end]
33 : [a.self_start, a.align_start],
34 ]}
35 accessible={true}
36 accessibilityActions={[
37 {name: 'activate', label: l`Open message options`},
38 ]}
39 onAccessibilityAction={() => trigger.control.open('full')}>
40 {children}
41 </View>
42 </View>
43 )
44 }
45 </MessageContextMenu>
46 )
47}