@planningcenter/chat-react-native 3.42.1-qa-staging.3 → 3.42.1-qa-staging.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/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +46 -12
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts +2 -1
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +5 -4
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/keyboard_view.d.ts +1 -0
- package/build/components/display/keyboard_view.d.ts.map +1 -1
- package/build/components/display/keyboard_view.js +23 -4
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/text_input.d.ts.map +1 -1
- package/build/components/display/text_input.js +5 -4
- package/build/components/display/text_input.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +2 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +4 -19
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +3 -1
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +3 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +2 -1
- package/build/screens/settings_screen.js.map +1 -1
- package/build/types/resources/conversation.d.ts +10 -1
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +2 -0
- package/build/utils/request/conversation.js.map +1 -1
- package/package.json +3 -3
- package/src/components/conversations/conversation_preview.tsx +58 -23
- package/src/components/conversations/unread_count_badge.tsx +13 -4
- package/src/components/display/keyboard_view.tsx +34 -9
- package/src/components/display/text_input.tsx +5 -5
- package/src/hooks/use_conversation.ts +2 -0
- package/src/hooks/use_conversation_jolt_events.ts +3 -19
- package/src/hooks/use_conversations_actions.ts +3 -1
- package/src/hooks/use_mark_latest_message_read.ts +3 -4
- package/src/screens/settings_screen.tsx +2 -1
- package/src/types/resources/conversation.ts +11 -1
- package/src/utils/request/conversation.ts +2 -0
|
@@ -17,9 +17,9 @@ export function useMarkLatestMessageRead({ conversation }: Props) {
|
|
|
17
17
|
[markRead]
|
|
18
18
|
)
|
|
19
19
|
const unreadCount = conversation.unreadCount
|
|
20
|
-
const
|
|
20
|
+
const unreadReaction = conversation.unreadReaction
|
|
21
21
|
|
|
22
|
-
const shouldMarkRead = Boolean(unreadCount >= 1 ||
|
|
22
|
+
const shouldMarkRead = Boolean(unreadCount >= 1 || unreadReaction || !firedOnce.current)
|
|
23
23
|
const appState = useAppState()
|
|
24
24
|
const isActive = appState === 'active'
|
|
25
25
|
|
|
@@ -29,6 +29,5 @@ export function useMarkLatestMessageRead({ conversation }: Props) {
|
|
|
29
29
|
firedOnce.current = true
|
|
30
30
|
|
|
31
31
|
debouncedMarkRead(true)
|
|
32
|
-
|
|
33
|
-
}, [debouncedMarkRead, isActive, shouldMarkRead, unreadReactionCount])
|
|
32
|
+
}, [debouncedMarkRead, isActive, shouldMarkRead, unreadReaction])
|
|
34
33
|
}
|
|
@@ -36,7 +36,8 @@ export function SettingsScreen({}: SettingsScreenProps) {
|
|
|
36
36
|
<View style={styles.settingRowText}>
|
|
37
37
|
<Text>Allow direct messages</Text>
|
|
38
38
|
<Text variant="tertiary">
|
|
39
|
-
When
|
|
39
|
+
When off, you can't be added to new direct messages, and any you're already in will
|
|
40
|
+
be turned off.
|
|
40
41
|
</Text>
|
|
41
42
|
</View>
|
|
42
43
|
<Switch
|
|
@@ -3,15 +3,25 @@ import { ConversationBadgeResource } from './conversation_badge'
|
|
|
3
3
|
import { ConversationMembershipResource } from './conversation_membership'
|
|
4
4
|
import { GroupResource } from './group_resource'
|
|
5
5
|
import { MemberAbilityResource } from './member_ability'
|
|
6
|
+
import { ReactionCountResource } from './reaction'
|
|
6
7
|
|
|
7
8
|
export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'
|
|
8
9
|
|
|
10
|
+
export interface ConversationPreviewData {
|
|
11
|
+
kind: 'reaction' | 'message'
|
|
12
|
+
authorName: string
|
|
13
|
+
value: ReactionCountResource['value'] | null
|
|
14
|
+
text: string
|
|
15
|
+
createdAt: string
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
export interface ConversationResource {
|
|
10
19
|
type: 'Conversation'
|
|
11
20
|
id: number
|
|
12
21
|
badges?: ConversationBadgeResource[]
|
|
13
22
|
analyticsMetadata?: AnalyticsMetadataResource
|
|
14
23
|
conversationMembership?: Partial<ConversationMembershipResource>
|
|
24
|
+
conversationPreview: ConversationPreviewData | null
|
|
15
25
|
createdAt: string
|
|
16
26
|
deleted?: boolean
|
|
17
27
|
directMessage?: boolean
|
|
@@ -34,6 +44,6 @@ export interface ConversationResource {
|
|
|
34
44
|
repliesDisabled: boolean
|
|
35
45
|
title: string
|
|
36
46
|
unreadCount: number
|
|
37
|
-
|
|
47
|
+
unreadReaction: boolean
|
|
38
48
|
updatedAt: string
|
|
39
49
|
}
|
|
@@ -38,6 +38,7 @@ export const getConversationsRequestArgs = ({
|
|
|
38
38
|
Conversation: [
|
|
39
39
|
'created_at',
|
|
40
40
|
'badges',
|
|
41
|
+
'conversation_preview',
|
|
41
42
|
'disabled',
|
|
42
43
|
'disabled_reason',
|
|
43
44
|
'groups',
|
|
@@ -55,6 +56,7 @@ export const getConversationsRequestArgs = ({
|
|
|
55
56
|
'replies_disabled',
|
|
56
57
|
'title',
|
|
57
58
|
'unread_count',
|
|
59
|
+
'unread_reaction',
|
|
58
60
|
'updated_at',
|
|
59
61
|
],
|
|
60
62
|
AnalyticsMetadata: ['metadata'],
|