@planningcenter/chat-react-native 3.42.3-qa-staging.7 → 3.43.0-rc.1

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.
Files changed (56) hide show
  1. package/build/components/conversation/messages_disabled_banners.d.ts +3 -2
  2. package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
  3. package/build/components/conversation/messages_disabled_banners.js +7 -2
  4. package/build/components/conversation/messages_disabled_banners.js.map +1 -1
  5. package/build/components/display/adult_requirement_notice.js +1 -1
  6. package/build/components/display/adult_requirement_notice.js.map +1 -1
  7. package/build/components/display/platform_modal_header_buttons.d.ts +11 -1
  8. package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
  9. package/build/components/display/platform_modal_header_buttons.js +20 -1
  10. package/build/components/display/platform_modal_header_buttons.js.map +1 -1
  11. package/build/hooks/use_conversation.d.ts.map +1 -1
  12. package/build/hooks/use_conversation.js +0 -1
  13. package/build/hooks/use_conversation.js.map +1 -1
  14. package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
  15. package/build/hooks/use_conversation_jolt_events.js +2 -10
  16. package/build/hooks/use_conversation_jolt_events.js.map +1 -1
  17. package/build/navigation/index.d.ts +1 -1
  18. package/build/navigation/index.d.ts.map +1 -1
  19. package/build/navigation/index.js +7 -10
  20. package/build/navigation/index.js.map +1 -1
  21. package/build/screens/conversation_filters/components/rows.js +1 -1
  22. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  23. package/build/screens/conversation_screen.js +1 -1
  24. package/build/screens/conversation_screen.js.map +1 -1
  25. package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +1 -1
  26. package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
  27. package/build/screens/conversation_select_recipients/components/restricted_group_row.js +1 -1
  28. package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
  29. package/build/types/jolt_events/conversation_events.d.ts +2 -2
  30. package/build/types/jolt_events/conversation_events.d.ts.map +1 -1
  31. package/build/types/jolt_events/conversation_events.js.map +1 -1
  32. package/build/types/resources/conversation.d.ts +2 -2
  33. package/build/types/resources/conversation.d.ts.map +1 -1
  34. package/build/types/resources/conversation.js.map +1 -1
  35. package/build/utils/conversation_safety_constants.d.ts +1 -1
  36. package/build/utils/conversation_safety_constants.d.ts.map +1 -1
  37. package/build/utils/conversation_safety_constants.js +1 -1
  38. package/build/utils/conversation_safety_constants.js.map +1 -1
  39. package/build/utils/request/conversation.d.ts.map +1 -1
  40. package/build/utils/request/conversation.js +0 -1
  41. package/build/utils/request/conversation.js.map +1 -1
  42. package/package.json +3 -3
  43. package/src/components/conversation/messages_disabled_banners.tsx +11 -3
  44. package/src/components/display/adult_requirement_notice.tsx +1 -1
  45. package/src/components/display/platform_modal_header_buttons.tsx +47 -2
  46. package/src/hooks/use_conversation.ts +0 -1
  47. package/src/hooks/use_conversation_jolt_events.ts +3 -16
  48. package/src/navigation/index.tsx +19 -33
  49. package/src/screens/conversation_filters/components/rows.tsx +2 -2
  50. package/src/screens/conversation_screen.tsx +1 -1
  51. package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +1 -1
  52. package/src/screens/conversation_select_recipients/components/restricted_group_row.tsx +2 -2
  53. package/src/types/jolt_events/conversation_events.ts +2 -2
  54. package/src/types/resources/conversation.ts +3 -2
  55. package/src/utils/conversation_safety_constants.ts +1 -1
  56. package/src/utils/request/conversation.ts +0 -1
@@ -9,6 +9,8 @@ import React from 'react'
9
9
  import { Platform } from 'react-native'
10
10
  import { Icon } from '../components'
11
11
  import {
12
+ composeHeaderOptions,
13
+ createMinimalHeaderBackButton,
12
14
  HeaderDoneButton,
13
15
  HeaderTextButton,
14
16
  } from '../components/display/platform_modal_header_buttons'
@@ -81,11 +83,6 @@ import {
81
83
  import { TeamConversationScreen } from '../screens/team_conversation_screen'
82
84
  import { ScreenLayoutWithChatAccessGate } from './screenLayout'
83
85
 
84
- const HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {
85
- marginLeft: Platform.select({ ios: -8, default: -3 }),
86
- marginRight: Platform.select({ ios: 0, default: 30 }),
87
- }
88
-
89
86
  export const NewConversationStack = createNativeStackNavigator({
90
87
  initialRouteName: 'ConversationNewEntry',
91
88
  screenOptions: {
@@ -221,38 +218,27 @@ export const ChatStack = createNativeStackNavigator({
221
218
  onPress={() => navigation.getParent()?.goBack()}
222
219
  />
223
220
  ),
224
- headerLeft: props => (
225
- <HeaderBackButton
226
- style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}
227
- displayMode="minimal"
228
- onPress={() => {
229
- const params = route.params as ConversationRouteProps
230
- if ((params as ConversationFiltersParams)?.chat_group_graph_id) {
231
- // Ensure that conversations with a graph id pass them back to the conversation list
232
- const { chat_group_graph_id } = params
233
- navigation.popTo('Conversations', { chat_group_graph_id })
234
- } else {
235
- navigation.goBack()
236
- }
237
- }}
238
- {...props}
239
- />
240
- ),
221
+ headerLeft: createMinimalHeaderBackButton({
222
+ onPress: () => {
223
+ const params = route.params as ConversationRouteProps
224
+ if ((params as ConversationFiltersParams)?.chat_group_graph_id) {
225
+ // Ensure that conversations with a graph id pass them back to the conversation list
226
+ const { chat_group_graph_id } = params
227
+ navigation.popTo('Conversations', { chat_group_graph_id })
228
+ } else {
229
+ navigation.goBack()
230
+ }
231
+ },
232
+ }),
241
233
  }),
242
234
  },
243
235
  ConversationReply: {
244
236
  screen: ConversationScreen,
245
- options: ({ route, navigation }) => ({
246
- title: (route.params as ConversationRouteProps)?.title ?? 'Reply',
247
- headerLeft: props => (
248
- <HeaderBackButton
249
- style={HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES}
250
- displayMode="minimal"
251
- onPress={() => navigation.goBack()}
252
- {...props}
253
- />
254
- ),
255
- }),
237
+ options: ({ route, navigation }) =>
238
+ composeHeaderOptions({
239
+ title: (route.params as ConversationRouteProps)?.title ?? 'Reply',
240
+ onPress: navigation.goBack,
241
+ }),
256
242
  },
257
243
  TeamConversation: {
258
244
  screen: TeamConversationScreen,
@@ -59,9 +59,9 @@ export const GroupRow = ({ group, isActive }: GroupRowProps) => {
59
59
 
60
60
  return (
61
61
  <PressableRow onPress={handleFilterByGroup} isActive={isActive}>
62
- {headerImage?.medium && (
62
+ {headerImage?.thumbnail && (
63
63
  <Image
64
- source={{ uri: headerImage?.medium }}
64
+ source={{ uri: headerImage?.thumbnail }}
65
65
  resizeMode="cover"
66
66
  style={styles.rowImage}
67
67
  alt=""
@@ -257,7 +257,7 @@ function ConversationBottomBar({
257
257
  if (conversation.disabled)
258
258
  return (
259
259
  <ConversationDisabledBanner
260
- message={conversation.disabledMessage ?? null}
260
+ disabledReason={conversation.disabledReason}
261
261
  messageLink={messageLink}
262
262
  />
263
263
  )
@@ -12,7 +12,7 @@ export const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps)
12
12
 
13
13
  return (
14
14
  <RecipientLinkRow
15
- imageUri={group.headerImage?.medium}
15
+ imageUri={group.headerImage?.thumbnail}
16
16
  title={group.name}
17
17
  subtitle={`${group.membershipsCount} members`}
18
18
  onPress={() => onPress(group)}
@@ -29,9 +29,9 @@ export const RestrictedGroupRow = ({ group }: RestrictedGroupRowProps) => {
29
29
  accessibilityLabel={`${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`}
30
30
  >
31
31
  <View style={styles.innerContainer}>
32
- {group.headerImage?.medium && (
32
+ {group.headerImage?.thumbnail && (
33
33
  <Image
34
- source={{ uri: group.headerImage.medium }}
34
+ source={{ uri: group.headerImage.thumbnail }}
35
35
  resizeMode="cover"
36
36
  style={styles.image}
37
37
  alt=""
@@ -1,4 +1,5 @@
1
1
  import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'
2
+ import type { ConversationDisabledReason } from '../resources/conversation'
2
3
 
3
4
  type DateString = string
4
5
  interface BaseConversationEventData extends Record<string, unknown> {
@@ -15,8 +16,7 @@ interface BaseConversationEventData extends Record<string, unknown> {
15
16
  latest_read_message_sort_key?: string
16
17
  organization_id: number
17
18
  disabled: boolean
18
- disabled_reason: string | null
19
- disabled_message: string | null
19
+ disabled_reason?: ConversationDisabledReason
20
20
  replies_disabled: boolean
21
21
  subtitle?: string
22
22
  title: string
@@ -5,6 +5,8 @@ import { GroupResource } from './group_resource'
5
5
  import { MemberAbilityResource } from './member_ability'
6
6
  import { ReactionCountResource } from './reaction'
7
7
 
8
+ export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'
9
+
8
10
  export interface ConversationPreviewData {
9
11
  kind: 'reaction' | 'message'
10
12
  authorName: string
@@ -24,8 +26,7 @@ export interface ConversationResource {
24
26
  deleted?: boolean
25
27
  directMessage?: boolean
26
28
  disabled?: boolean
27
- disabledReason?: string | null
28
- disabledMessage?: string | null
29
+ disabledReason?: ConversationDisabledReason
29
30
  genderOption?: string | null
30
31
  groups?: GroupResource[]
31
32
  previewAvatarUrls?: string[]
@@ -1,2 +1,2 @@
1
1
  export const ADULT_REQUIREMENT_BODY =
2
- 'Conversations with minors require at least two adults. This chat is paused until more adults are added.'
2
+ 'Conversations with teens require at least 2 adults. This chat is paused until another adult is added.'
@@ -41,7 +41,6 @@ export const getConversationsRequestArgs = ({
41
41
  'conversation_preview',
42
42
  'disabled',
43
43
  'disabled_reason',
44
- 'disabled_message',
45
44
  'groups',
46
45
  'last_message_author_id',
47
46
  'last_message_author_name',