@planningcenter/chat-react-native 3.16.0-rc.3 → 3.16.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/message.d.ts +2 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +19 -3
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_form.d.ts +2 -1
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +38 -16
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/reply_connectors.js +1 -1
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/shadow_message.d.ts +2 -1
- package/build/components/conversation/shadow_message.d.ts.map +1 -1
- package/build/components/conversation/shadow_message.js +10 -5
- package/build/components/conversation/shadow_message.js.map +1 -1
- package/build/components/display/icon.d.ts +3 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +2 -0
- package/build/components/display/icon.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +6 -3
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +32 -25
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts +2 -1
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +6 -2
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +3 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +1 -0
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/navigation/index.d.ts +6 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +6 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +2 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +7 -5
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -0
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +16 -3
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/types/jolt_events/message_events.d.ts +2 -0
- package/build/types/jolt_events/message_events.d.ts.map +1 -1
- package/build/types/jolt_events/message_events.js.map +1 -1
- package/build/types/resources/message.d.ts +2 -0
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.js.map +1 -1
- package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_create_message.js +2 -0
- package/build/utils/cache/optimistically_create_message.js.map +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +2 -0
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/replies_local_feature_flag.d.ts +2 -0
- package/build/utils/replies_local_feature_flag.d.ts.map +1 -0
- package/build/utils/replies_local_feature_flag.js +3 -0
- package/build/utils/replies_local_feature_flag.js.map +1 -0
- package/package.json +2 -2
- package/src/components/conversation/message.tsx +30 -2
- package/src/components/conversation/message_form.tsx +85 -15
- package/src/components/conversation/reply_connectors.tsx +1 -1
- package/src/components/conversation/shadow_message.tsx +15 -7
- package/src/components/display/icon.tsx +3 -0
- package/src/hooks/use_conversation_messages.ts +45 -25
- package/src/hooks/use_message_create_or_update.ts +7 -2
- package/src/hooks/use_suspense_api.ts +3 -0
- package/src/navigation/index.tsx +6 -0
- package/src/screens/conversation_screen.tsx +9 -4
- package/src/screens/message_actions_screen.tsx +27 -1
- package/src/types/jolt_events/message_events.ts +2 -0
- package/src/types/resources/message.ts +2 -0
- package/src/utils/cache/optimistically_create_message.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +2 -0
- package/src/utils/replies_local_feature_flag.ts +2 -0
|
@@ -14,6 +14,7 @@ import { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle'
|
|
|
14
14
|
import { ReactionCountResource } from '../types/resources/reaction'
|
|
15
15
|
import { Clipboard, Haptic } from '../utils/native_adapters'
|
|
16
16
|
import { MessageResource } from '../types'
|
|
17
|
+
import { REPLIES_FEATURE_ENABLED } from '../utils'
|
|
17
18
|
|
|
18
19
|
export const MessageActionsScreenOptions = getFormSheetScreenOptions({
|
|
19
20
|
sheetAllowedDetents: [0.5],
|
|
@@ -24,10 +25,11 @@ export type MessageActionsScreenProps = StaticScreenProps<{
|
|
|
24
25
|
message_id: string
|
|
25
26
|
conversation_id: number
|
|
26
27
|
canDeleteNonAuthoredMessages?: boolean
|
|
28
|
+
inReplyScreen?: boolean
|
|
27
29
|
}>
|
|
28
30
|
|
|
29
31
|
export function MessageActionsScreen({ route }: MessageActionsScreenProps) {
|
|
30
|
-
const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params
|
|
32
|
+
const { conversation_id, message_id, canDeleteNonAuthoredMessages, inReplyScreen } = route.params
|
|
31
33
|
|
|
32
34
|
const { messages, refetch } = useConversationMessages(
|
|
33
35
|
{ conversation_id },
|
|
@@ -43,6 +45,7 @@ export function MessageActionsScreen({ route }: MessageActionsScreenProps) {
|
|
|
43
45
|
conversation_id={conversation_id}
|
|
44
46
|
canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages || false}
|
|
45
47
|
refetchMessages={refetch}
|
|
48
|
+
inReplyScreen={inReplyScreen}
|
|
46
49
|
/>
|
|
47
50
|
)
|
|
48
51
|
}
|
|
@@ -52,11 +55,13 @@ function MessageActionsScreenContent({
|
|
|
52
55
|
conversation_id,
|
|
53
56
|
canDeleteNonAuthoredMessages,
|
|
54
57
|
refetchMessages,
|
|
58
|
+
inReplyScreen,
|
|
55
59
|
}: {
|
|
56
60
|
message: MessageResource
|
|
57
61
|
conversation_id: number
|
|
58
62
|
canDeleteNonAuthoredMessages: boolean
|
|
59
63
|
refetchMessages: () => void
|
|
64
|
+
inReplyScreen?: boolean
|
|
60
65
|
}) {
|
|
61
66
|
const navigation = useNavigation()
|
|
62
67
|
const apiClient = useApiClient()
|
|
@@ -83,6 +88,18 @@ function MessageActionsScreenContent({
|
|
|
83
88
|
return ''
|
|
84
89
|
}
|
|
85
90
|
|
|
91
|
+
const handleReplyPress = useCallback(() => {
|
|
92
|
+
navigation.goBack()
|
|
93
|
+
// Waits for the modal to be dismissed before pushing the reply screen
|
|
94
|
+
requestAnimationFrame(() => {
|
|
95
|
+
navigation.navigate('ConversationReply', {
|
|
96
|
+
conversation_id,
|
|
97
|
+
reply_root_id: message.replyRootId || message.id,
|
|
98
|
+
// TODO: Update title param with reply root author
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
}, [navigation, conversation_id, message.id, message.replyRootId])
|
|
102
|
+
|
|
86
103
|
const handleCopyPress = () => {
|
|
87
104
|
Clipboard.setStringAsync(message?.text || attachmentForCopy() || '')
|
|
88
105
|
navigation.goBack()
|
|
@@ -163,6 +180,15 @@ function MessageActionsScreenContent({
|
|
|
163
180
|
))}
|
|
164
181
|
</View>
|
|
165
182
|
<View style={styles.actions}>
|
|
183
|
+
{REPLIES_FEATURE_ENABLED && !inReplyScreen && (
|
|
184
|
+
<FormSheet.Action
|
|
185
|
+
onPress={handleReplyPress}
|
|
186
|
+
title="Reply to message"
|
|
187
|
+
iconName="registrations.undo"
|
|
188
|
+
accessibilityHint="Navigates to the reply screen"
|
|
189
|
+
accessibilityRole="link"
|
|
190
|
+
/>
|
|
191
|
+
)}
|
|
166
192
|
<FormSheet.Action
|
|
167
193
|
onPress={handleCopyPress}
|
|
168
194
|
title="Copy text"
|
|
@@ -15,6 +15,8 @@ export interface MessageResource {
|
|
|
15
15
|
attachments: DenormalizedAttachmentResource[]
|
|
16
16
|
author: PersonResource
|
|
17
17
|
reactionCounts: ReactionCountResource[]
|
|
18
|
+
replyCount: number
|
|
19
|
+
replyRootId?: string | null
|
|
18
20
|
|
|
19
21
|
// Custom Local Properties we set for rendering
|
|
20
22
|
renderAuthor?: boolean
|
package/src/utils/index.ts
CHANGED