@planningcenter/chat-react-native 4.4.1-qa-staging.40 → 4.4.1-qa-1036.2

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 (95) hide show
  1. package/build/components/conversation/message_list.d.ts.map +1 -1
  2. package/build/components/conversation/message_list.js +123 -155
  3. package/build/components/conversation/message_list.js.map +1 -1
  4. package/build/components/conversations/conversations.d.ts.map +1 -1
  5. package/build/components/conversations/conversations.js +0 -1
  6. package/build/components/conversations/conversations.js.map +1 -1
  7. package/build/components/display/filter_dropdown.d.ts +0 -1
  8. package/build/components/display/filter_dropdown.d.ts.map +1 -1
  9. package/build/components/display/filter_dropdown.js.map +1 -1
  10. package/build/components/display/keyboard_scroll_view.d.ts.map +1 -1
  11. package/build/components/display/keyboard_scroll_view.js +0 -1
  12. package/build/components/display/keyboard_scroll_view.js.map +1 -1
  13. package/build/components/page/page_error_boundary.d.ts +1 -9
  14. package/build/components/page/page_error_boundary.d.ts.map +1 -1
  15. package/build/components/page/page_error_boundary.js +31 -56
  16. package/build/components/page/page_error_boundary.js.map +1 -1
  17. package/build/navigation/index.d.ts.map +1 -1
  18. package/build/navigation/index.js +3 -11
  19. package/build/navigation/index.js.map +1 -1
  20. package/build/navigation/screenLayout.d.ts.map +1 -1
  21. package/build/navigation/screenLayout.js +6 -10
  22. package/build/navigation/screenLayout.js.map +1 -1
  23. package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
  24. package/build/screens/age_check/age_check_required_screen.js +0 -1
  25. package/build/screens/age_check/age_check_required_screen.js.map +1 -1
  26. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  27. package/build/screens/conversation_details_screen.js +0 -1
  28. package/build/screens/conversation_details_screen.js.map +1 -1
  29. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
  30. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +0 -1
  31. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
  32. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
  33. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +291 -332
  34. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
  35. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
  36. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +0 -1
  37. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
  38. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
  39. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +0 -1
  40. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
  41. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
  42. package/build/screens/conversations/components/filter_dropdown_list_header_component.js +7 -22
  43. package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
  44. package/build/screens/get_help_screen.js +62 -56
  45. package/build/screens/get_help_screen.js.map +1 -1
  46. package/build/screens/group_notification_settings_screen.js +2 -3
  47. package/build/screens/group_notification_settings_screen.js.map +1 -1
  48. package/build/screens/notification_settings_screen.d.ts.map +1 -1
  49. package/build/screens/notification_settings_screen.js +0 -1
  50. package/build/screens/notification_settings_screen.js.map +1 -1
  51. package/build/screens/preferred_app_selection_screen.js +39 -45
  52. package/build/screens/preferred_app_selection_screen.js.map +1 -1
  53. package/build/screens/search/components/search_results_list.d.ts +1 -4
  54. package/build/screens/search/components/search_results_list.d.ts.map +1 -1
  55. package/build/screens/search/components/search_results_list.js +110 -136
  56. package/build/screens/search/components/search_results_list.js.map +1 -1
  57. package/build/screens/search/search_screen.d.ts.map +1 -1
  58. package/build/screens/search/search_screen.js +28 -21
  59. package/build/screens/search/search_screen.js.map +1 -1
  60. package/build/screens/settings_screen.d.ts.map +1 -1
  61. package/build/screens/settings_screen.js +6 -7
  62. package/build/screens/settings_screen.js.map +1 -1
  63. package/package.json +3 -3
  64. package/src/components/conversation/__tests__/message_list.test.tsx +0 -4
  65. package/src/components/conversation/message_list.tsx +0 -6
  66. package/src/components/conversations/conversations.tsx +0 -1
  67. package/src/components/display/filter_dropdown.tsx +0 -1
  68. package/src/components/display/keyboard_scroll_view.tsx +0 -1
  69. package/src/components/page/__tests__/page_error_boundary.test.tsx +0 -33
  70. package/src/components/page/page_error_boundary.tsx +12 -43
  71. package/src/navigation/index.tsx +2 -11
  72. package/src/navigation/screenLayout.tsx +1 -3
  73. package/src/screens/age_check/age_check_required_screen.tsx +1 -5
  74. package/src/screens/conversation_details_screen.tsx +0 -1
  75. package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +1 -4
  76. package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +68 -78
  77. package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +0 -1
  78. package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +0 -1
  79. package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +1 -59
  80. package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +9 -24
  81. package/src/screens/get_help_screen.tsx +4 -4
  82. package/src/screens/group_notification_settings_screen.tsx +3 -3
  83. package/src/screens/notification_settings_screen.tsx +0 -1
  84. package/src/screens/preferred_app_selection_screen.tsx +4 -4
  85. package/src/screens/search/__tests__/search_screen.test.tsx +7 -5
  86. package/src/screens/search/components/__tests__/search_results_list.test.tsx +2 -6
  87. package/src/screens/search/components/search_results_list.tsx +13 -34
  88. package/src/screens/search/search_screen.tsx +18 -8
  89. package/src/screens/settings_screen.tsx +25 -25
  90. package/build/navigation/page_error_fallbacks.d.ts +0 -7
  91. package/build/navigation/page_error_fallbacks.d.ts.map +0 -1
  92. package/build/navigation/page_error_fallbacks.js +0 -7
  93. package/build/navigation/page_error_fallbacks.js.map +0 -1
  94. package/src/navigation/page_error_fallbacks.ts +0 -14
  95. package/src/screens/conversation_select_recipients/__tests__/conversation_select_direct_message_recipients_screen.test.tsx +0 -100
@@ -1 +1 @@
1
- {"version":3,"file":"settings_screen.js","names":["PlatformPressable","useNavigation","React","useCallback","Platform","ScrollView","StyleSheet","View","useSafeAreaInsets","Heading","Icon","Text","VersionFooter","Switch","useDirectMessagesEligible","useTheme","useAppName","usePersonSettings","jsx","_jsx","jsxs","_jsxs","SettingsScreen","t0","$","_c","styles","useStyles","directMessagesDisabled","setDirectMessagesDisabled","isMutating","directMessagesEligible","appName","navigation","t1","navigate","handleNotificationSettings","t2","type","handleGetHelp","t3","Symbol","for","variant","children","t4","sectionHeader","style","t5","settingRow","settingRowText","value","onValueChange","enabled","t6","NavRow","label","t7","t8","sectionOuter","contentInsetAdjustmentBehavior","t9","t10","footer","t11","container","onPress","useNavRowStyles","chevron","OS","name","size","inner","accessibilityRole","colors","insets","borderColorDefaultBase","bottom","create","flex","paddingBottom","Math","max","paddingLeft","paddingRight","paddingTop","borderBottomWidth","borderBottomColor","flexDirection","alignItems","justifyContent","paddingVertical","gap","iconColorDefaultDisabled","color"],"sources":["../../src/screens/settings_screen.tsx"],"sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { Platform, ScrollView, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading, Icon, Text, VersionFooter } from '../components'\nimport { Switch } from '../components/display/switch'\nimport { useDirectMessagesEligible, useTheme } from '../hooks'\nimport { useAppName } from '../hooks/use_app_name'\nimport { usePersonSettings } from '../hooks/use_person_settings'\n\nexport type SettingsScreenProps = StaticScreenProps<{}>\n\nexport function SettingsScreen({}: SettingsScreenProps) {\n const styles = useStyles()\n const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings()\n const directMessagesEligible = useDirectMessagesEligible()\n const appName = useAppName()\n const navigation = useNavigation()\n\n const handleNotificationSettings = useCallback(() => {\n navigation.navigate('NotificationSettings', {})\n }, [navigation])\n\n const handleGetHelp = useCallback(() => {\n navigation.navigate('GetHelp', { type: 'chat' })\n }, [navigation])\n\n return (\n <View style={styles.container}>\n <ScrollView contentInsetAdjustmentBehavior=\"automatic\">\n <View style={styles.sectionOuter}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h2\">Messages</Heading>\n </View>\n {directMessagesEligible && (\n <View style={styles.settingRow}>\n <View style={styles.settingRowText}>\n <Text>Allow direct messages</Text>\n <Text variant=\"tertiary\">\n When off, you can't be added to new direct messages, and any you're already in\n will be turned off.\n </Text>\n </View>\n <Switch\n value={!directMessagesDisabled}\n onValueChange={enabled => setDirectMessagesDisabled(!enabled)}\n disabled={isMutating}\n />\n </View>\n )}\n <NavRow label=\"Notification settings\" onPress={handleNotificationSettings} />\n {appName !== 'services' && <NavRow label=\"Get help\" onPress={handleGetHelp} />}\n </View>\n </ScrollView>\n <View style={styles.footer}>\n <VersionFooter />\n </View>\n </View>\n )\n}\n\ninterface NavRowProps {\n label: string\n onPress: () => void\n}\n\nfunction NavRow({ label, onPress }: NavRowProps) {\n const styles = useNavRowStyles()\n return (\n <PlatformPressable\n style={styles.container}\n onPress={onPress}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n >\n <View style={styles.inner}>\n <Text>{label}</Text>\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.chevron} />\n )}\n </View>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const insets = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n flex: 1,\n },\n footer: {\n paddingBottom: Math.max(insets.bottom, 8),\n },\n sectionOuter: {\n paddingLeft: 16,\n },\n sectionHeader: {\n paddingRight: 16,\n paddingTop: 24,\n paddingBottom: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n settingRow: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n settingRowText: {\n flex: 1,\n gap: 8,\n },\n })\n}\n\nconst useNavRowStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n paddingLeft: 0,\n },\n inner: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 14,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n chevron: {\n color: colors.iconColorDefaultDisabled,\n },\n })\n}\n"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAA4BC,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACrE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,QAAQ,eAAe;AAClE,SAASC,MAAM,QAAQ,8BAA8B;AACrD,SAASC,yBAAyB,EAAEC,QAAQ,QAAQ,UAAU;AAC9D,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,iBAAiB,QAAQ,8BAA8B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAIhE,OAAO,SAAAC,eAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL,MAAAC,MAAA,GAAeC,SAAS,CAAC,CAAC;EAC1B;IAAAC,sBAAA;IAAAC,yBAAA;IAAAC;EAAA,IAA0Eb,iBAAiB,CAAC,CAAC;EAC7F,MAAAc,sBAAA,GAA+BjB,yBAAyB,CAAC,CAAC;EAC1D,MAAAkB,OAAA,GAAgBhB,UAAU,CAAC,C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EAAA,OA9BKD,EA8BL;AAAA,CACH;AAED,MAAM4C,eAAe,GAAGA,CAAA;EAAA,MAAA3C,CAAA,GAAAC,EAAA;EACtB;IAAAiD;EAAA,IAAmB3D,QAAQ,CAAC,CAAC;EAAA,IAAAQ,EAAA;EAAA,IAAAC,CAAA,QAAAkD,MAAA,CAAAE,sBAAA,IAAApD,CAAA,QAAAkD,MAAA,CAAAmB,wBAAA;IACtBtE,EAAA,GAAAjB,UAAU,CAAAwE,MAAO,CAAC;MAAAb,SAAA,EACZ;QAAAkB,WAAA,EACI;MACf,CAAC;MAAAX,KAAA,EACM;QAAAgB,aAAA,EACU,KAAK;QAAAC,UAAA,EACR,QAAQ;QAAAC,cAAA,EACJ,eAAe;QAAAN,YAAA,EACjB,EAAE;QAAAO,eAAA,EACC,EAAE;QAAAL,iBAAA,EACA,CAAC;QAAAC,iBAAA,EACDb,MAAM,CAAAE;MAC3B,CAAC;MAAAR,OAAA,EACQ;QAAA0B,KAAA,EACApB,MAAM,CAAAmB;MACf;IACF,CAAC,CAAC;IAAArE,CAAA,MAAAkD,MAAA,CAAAE,sBAAA;IAAApD,CAAA,MAAAkD,MAAA,CAAAmB,wBAAA;IAAArE,CAAA,MAAAD,EAAA;EAAA;IAAAA,EAAA,GAAAC,CAAA;EAAA;EAAA,OAhBKD,EAgBL;AAAA,CACH","ignoreList":[]}
1
+ {"version":3,"file":"settings_screen.js","names":["PlatformPressable","useNavigation","React","useCallback","Platform","StyleSheet","View","useSafeAreaInsets","Heading","Icon","Text","VersionFooter","Switch","useDirectMessagesEligible","useTheme","useAppName","usePersonSettings","jsx","_jsx","jsxs","_jsxs","SettingsScreen","t0","$","_c","styles","useStyles","directMessagesDisabled","setDirectMessagesDisabled","isMutating","directMessagesEligible","appName","navigation","t1","navigate","handleNotificationSettings","t2","type","handleGetHelp","t3","Symbol","for","variant","children","t4","sectionHeader","style","t5","settingRow","settingRowText","value","onValueChange","enabled","t6","NavRow","label","t7","t8","sectionOuter","t9","t10","footer","t11","container","onPress","useNavRowStyles","chevron","OS","name","size","inner","accessibilityRole","colors","insets","borderColorDefaultBase","bottom","create","flex","justifyContent","paddingBottom","Math","max","paddingLeft","paddingRight","paddingTop","borderBottomWidth","borderBottomColor","flexDirection","alignItems","paddingVertical","gap","iconColorDefaultDisabled","color"],"sources":["../../src/screens/settings_screen.tsx"],"sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading, Icon, Text, VersionFooter } from '../components'\nimport { Switch } from '../components/display/switch'\nimport { useDirectMessagesEligible, useTheme } from '../hooks'\nimport { useAppName } from '../hooks/use_app_name'\nimport { usePersonSettings } from '../hooks/use_person_settings'\n\nexport type SettingsScreenProps = StaticScreenProps<{}>\n\nexport function SettingsScreen({}: SettingsScreenProps) {\n const styles = useStyles()\n const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings()\n const directMessagesEligible = useDirectMessagesEligible()\n const appName = useAppName()\n const navigation = useNavigation()\n\n const handleNotificationSettings = useCallback(() => {\n navigation.navigate('NotificationSettings', {})\n }, [navigation])\n\n const handleGetHelp = useCallback(() => {\n navigation.navigate('GetHelp', { type: 'chat' })\n }, [navigation])\n\n return (\n <View style={styles.container}>\n <View style={styles.sectionOuter}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h2\">Messages</Heading>\n </View>\n {directMessagesEligible && (\n <View style={styles.settingRow}>\n <View style={styles.settingRowText}>\n <Text>Allow direct messages</Text>\n <Text variant=\"tertiary\">\n When off, you can't be added to new direct messages, and any you're already in will\n be turned off.\n </Text>\n </View>\n <Switch\n value={!directMessagesDisabled}\n onValueChange={enabled => setDirectMessagesDisabled(!enabled)}\n disabled={isMutating}\n />\n </View>\n )}\n <NavRow label=\"Notification settings\" onPress={handleNotificationSettings} />\n {appName !== 'services' && <NavRow label=\"Get help\" onPress={handleGetHelp} />}\n </View>\n <View style={styles.footer}>\n <VersionFooter />\n </View>\n </View>\n )\n}\n\ninterface NavRowProps {\n label: string\n onPress: () => void\n}\n\nfunction NavRow({ label, onPress }: NavRowProps) {\n const styles = useNavRowStyles()\n return (\n <PlatformPressable\n style={styles.container}\n onPress={onPress}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n >\n <View style={styles.inner}>\n <Text>{label}</Text>\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.chevron} />\n )}\n </View>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const insets = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n flex: 1,\n },\n footer: {\n flex: 1,\n justifyContent: 'flex-end',\n paddingBottom: Math.max(insets.bottom, 8),\n },\n sectionOuter: {\n paddingLeft: 16,\n },\n sectionHeader: {\n paddingRight: 16,\n paddingTop: 24,\n paddingBottom: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n settingRow: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n settingRowText: {\n flex: 1,\n gap: 8,\n },\n })\n}\n\nconst useNavRowStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n paddingLeft: 0,\n },\n inner: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 14,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n chevron: {\n color: colors.iconColorDefaultDisabled,\n },\n })\n}\n"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAA4BC,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC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MAAM,CAAAmB;MACf;IACF,CAAC,CAAC;IAAApE,CAAA,MAAAiD,MAAA,CAAAE,sBAAA;IAAAnD,CAAA,MAAAiD,MAAA,CAAAmB,wBAAA;IAAApE,CAAA,MAAAD,EAAA;EAAA;IAAAA,EAAA,GAAAC,CAAA;EAAA;EAAA,OAhBKD,EAgBL;AAAA,CACH","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "4.4.1-qa-staging.40",
3
+ "version": "4.4.1-qa-1036.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@fortawesome/fontawesome-svg-core": "^7.2.0",
35
35
  "@fortawesome/react-native-fontawesome": "^0.3.2",
36
- "@planningcenter/emoji-keyboard": "4.4.1-qa-staging.40",
36
+ "@planningcenter/emoji-keyboard": "4.4.1-qa-1036.2",
37
37
  "lodash-inflection": "^1.5.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -84,5 +84,5 @@
84
84
  "sf-symbols-typescript": "^2.2.0",
85
85
  "typescript": "~6.0.3"
86
86
  },
87
- "gitHead": "2f70b94610adf193b243c90cdfa4c6b20a599e13"
87
+ "gitHead": "d60eb48469e8b60f337efc8cb83c3e9cf6666fab"
88
88
  }
@@ -27,10 +27,6 @@ import { addRecordInPagesData, deleteRecordInPagesData } from '../../../utils/ca
27
27
  import { getMessagesQueryKey } from '../../../utils/request/get_messages'
28
28
  import { MessageList } from '../message_list'
29
29
 
30
- jest.mock('@react-navigation/elements', () => ({
31
- ...jest.requireActual('@react-navigation/elements'),
32
- useHeaderHeight: () => 0,
33
- }))
34
30
  jest.mock('../../../hooks/use_api_client')
35
31
  const mockFlash = jest.fn()
36
32
  jest.mock('../../../hooks/use_animated_message_background_color', () => ({
@@ -1,5 +1,4 @@
1
1
  import { date as formatDate } from '@planningcenter/datetime-fmt'
2
- import { useHeaderHeight } from '@react-navigation/elements'
3
2
  import { noop } from 'lodash'
4
3
  import React, { RefObject, useCallback, useEffect, useRef, useState } from 'react'
5
4
  import { FlatList, FlatListProps, StyleSheet, View } from 'react-native'
@@ -8,7 +7,6 @@ import { ConversationResource } from '../../types/resources/conversation'
8
7
  import { MessageResource } from '../../types/resources/message'
9
8
  import { getRelativeDateStatus } from '../../utils/date'
10
9
  import { groupMessages, type DateSeparator, type EnrichedMessage } from '../../utils/group_messages'
11
- import { isLiquidGlassEnabled } from '../../utils/liquid_glass'
12
10
  import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../../utils/styles'
13
11
  import { isSystemMessage } from '../../utils/system_messages'
14
12
  import { Text } from '../display'
@@ -71,8 +69,6 @@ export function MessageList({
71
69
  onMomentumScrollEnd,
72
70
  }: MessageListProps) {
73
71
  const styles = useStyles()
74
- const headerHeight = useHeaderHeight()
75
- const glassHeaderInset = isLiquidGlassEnabled() ? headerHeight : 0
76
72
  const inReplyScreen = !!replyRootId
77
73
  const canDeleteNonAuthoredMessages =
78
74
  conversation.memberAbility?.canDeleteNonAuthoredMessages ?? false
@@ -159,8 +155,6 @@ export function MessageList({
159
155
  inverted
160
156
  ref={listRef}
161
157
  contentContainerStyle={styles.listContainer}
162
- contentInset={{ bottom: glassHeaderInset }}
163
- scrollIndicatorInsets={{ bottom: glassHeaderInset }}
164
158
  data={messagesWithSeparators}
165
159
  keyExtractor={item => item.id}
166
160
  onScroll={onScroll}
@@ -79,7 +79,6 @@ export const Conversations = ({ ListHeaderComponent }: ConversationsProps) => {
79
79
  data={data}
80
80
  keyExtractor={item => item.id.toString()}
81
81
  contentContainerStyle={styles.contentContainer}
82
- contentInsetAdjustmentBehavior="automatic"
83
82
  onRefresh={refetch}
84
83
  refreshing={!isFetched && isRefetching}
85
84
  ListHeaderComponent={ListHeaderComponent}
@@ -102,7 +102,6 @@ export interface FilterDropdownTriggerProps {
102
102
  accessibilityElementsHidden?: boolean
103
103
  importantForAccessibility?: 'no-hide-descendants'
104
104
  onLayout?: (event: LayoutChangeEvent) => void
105
- testID?: string
106
105
  }
107
106
 
108
107
  /**
@@ -43,7 +43,6 @@ export function KeyboardScrollView({ children, contentContainerStyle }: Keyboard
43
43
  <KeyboardView>
44
44
  <ScrollView
45
45
  ref={scrollViewRef}
46
- contentInsetAdjustmentBehavior="automatic"
47
46
  contentContainerStyle={contentContainerStyle}
48
47
  onLayout={scrollFocusedInputIntoView}
49
48
  onContentSizeChange={scrollFocusedInputIntoView}
@@ -4,7 +4,6 @@ import { render } from '@testing-library/react-native'
4
4
  import React from 'react'
5
5
  import { buildTestQueryClient } from '../../../__utils__/query_client'
6
6
  import { Log } from '../../../utils/native_adapters/configuration'
7
- import { ResponseError } from '../../../utils/response_error'
8
7
  import { PageErrorBoundary } from '../page_error_boundary'
9
8
 
10
9
  jest.mock('../../primitive/blank_state_primitive', () => {
@@ -75,36 +74,4 @@ describe('PageErrorBoundary', () => {
75
74
  expect(getByText('Oops!')).toBeTruthy()
76
75
  expect(getByText('Something unexpected happened.')).toBeTruthy()
77
76
  })
78
-
79
- describe('with a generic fallback override', () => {
80
- const genericFallback = { heading: 'Nothing here', body: 'Come back later.' }
81
- const responseError = (status: number) =>
82
- new ResponseError({ status, statusText: 'x', errors: [] } as never)
83
-
84
- it.each([
85
- ['a plain error', new Error('boom')],
86
- ['an unhandled status', responseError(500)],
87
- ])('replaces the Oops copy for %s', (_label, thrown) => {
88
- const { getByText, queryByText } = renderWithProviders(
89
- <PageErrorBoundary genericFallback={genericFallback}>
90
- <Boom thrown={thrown} />
91
- </PageErrorBoundary>
92
- )
93
-
94
- expect(getByText('Nothing here')).toBeTruthy()
95
- expect(getByText('Come back later.')).toBeTruthy()
96
- expect(queryByText('Oops!')).toBeNull()
97
- })
98
-
99
- it('leaves a known status alone', () => {
100
- const { getByText, queryByText } = renderWithProviders(
101
- <PageErrorBoundary genericFallback={genericFallback}>
102
- <Boom thrown={responseError(403)} />
103
- </PageErrorBoundary>
104
- )
105
-
106
- expect(getByText('Permission required')).toBeTruthy()
107
- expect(queryByText('Nothing here')).toBeNull()
108
- })
109
- })
110
77
  })
@@ -6,26 +6,11 @@ import { ResponseError } from '../../utils/response_error'
6
6
  import BlankState from '../primitive/blank_state_primitive'
7
7
  import { ErrorBoundary, ErrorBoundaryFallback, ErrorBoundaryProps } from './error_boundary'
8
8
 
9
- export type PageErrorFallback = { heading: string; body: string }
10
-
11
- const GENERIC_FALLBACK: PageErrorFallback = {
12
- heading: 'Oops!',
13
- body: 'Something unexpected happened.',
14
- }
15
-
16
- type PageErrorBoundaryProps = PropsWithChildren<
17
- ErrorBoundaryProps & { genericFallback?: PageErrorFallback }
18
- >
19
-
20
- export function PageErrorBoundary({
21
- children,
22
- genericFallback = GENERIC_FALLBACK,
23
- ...props
24
- }: PageErrorBoundaryProps) {
25
- const renderPageFallback: ErrorBoundaryFallback = (error, reset) => (
26
- <ErrorView error={error} reset={reset} generic={genericFallback} />
27
- )
9
+ const renderPageFallback: ErrorBoundaryFallback = (error, reset) => (
10
+ <ErrorView error={error} reset={reset} />
11
+ )
28
12
 
13
+ export function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>) {
29
14
  return (
30
15
  <ErrorBoundary scope="screen" fallback={renderPageFallback} {...props}>
31
16
  {children}
@@ -33,15 +18,7 @@ export function PageErrorBoundary({
33
18
  )
34
19
  }
35
20
 
36
- function ErrorView({
37
- error,
38
- reset,
39
- generic,
40
- }: {
41
- error: Error
42
- reset: () => void
43
- generic: PageErrorFallback
44
- }) {
21
+ function ErrorView({ error, reset }: { error: Error; reset: () => void }) {
45
22
  const { reset: resetQueries } = useQueryErrorResetBoundary()
46
23
 
47
24
  const handleReset = useCallback(() => {
@@ -52,7 +29,7 @@ function ErrorView({
52
29
  useEffect(() => handleReset, [handleReset])
53
30
 
54
31
  if (error instanceof ResponseError) {
55
- return <ResponseErrorView response={error.response} onReset={handleReset} generic={generic} />
32
+ return <ResponseErrorView response={error.response} onReset={handleReset} />
56
33
  }
57
34
 
58
35
  if (isNetworkError(error)) {
@@ -64,7 +41,7 @@ function ErrorView({
64
41
  )
65
42
  }
66
43
 
67
- return <ErrorContent heading={generic.heading} body={generic.body} />
44
+ return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'} />
68
45
  }
69
46
 
70
47
  function isNetworkError(error: Error) {
@@ -77,15 +54,7 @@ function isNetworkError(error: Error) {
77
54
  return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message)
78
55
  }
79
56
 
80
- function ResponseErrorView({
81
- response,
82
- onReset,
83
- generic,
84
- }: {
85
- response: Response
86
- onReset: () => void
87
- generic: PageErrorFallback
88
- }) {
57
+ function ResponseErrorView({ response, onReset }: { response: Response; onReset: () => void }) {
89
58
  const { status } = response
90
59
 
91
60
  const heading = useMemo(() => {
@@ -95,9 +64,9 @@ function ResponseErrorView({
95
64
  case 404:
96
65
  return 'Content not found'
97
66
  default:
98
- return generic.heading
67
+ return 'Oops!'
99
68
  }
100
- }, [status, generic.heading])
69
+ }, [status])
101
70
 
102
71
  const body = useMemo(() => {
103
72
  switch (status) {
@@ -106,9 +75,9 @@ function ResponseErrorView({
106
75
  case 404:
107
76
  return 'If you believe something should be here, please reach out to your administrator.'
108
77
  default:
109
- return generic.body
78
+ return 'Something unexpected happened.'
110
79
  }
111
- }, [status, generic.body])
80
+ }, [status])
112
81
 
113
82
  useEffect(() => {
114
83
  if (status !== 401) return
@@ -83,12 +83,9 @@ import { TeamConversationScreen } from '../screens/team_conversation_screen'
83
83
  import { isLiquidGlassEnabled } from '../utils/liquid_glass'
84
84
  import { ScreenLayoutWithChatAccessGate } from './screenLayout'
85
85
 
86
- const conversationGlassHeader = (): NativeStackNavigationOptions =>
87
- isLiquidGlassEnabled() ? { headerBlurEffect: 'systemChromeMaterial' } : {}
88
-
89
86
  const globalScreenOptions: () => NativeStackNavigationOptions = () => ({
90
87
  headerBackButtonDisplayMode: 'minimal',
91
- ...(isLiquidGlassEnabled() ? { headerShadowVisible: false, headerTransparent: true } : {}),
88
+ ...(isLiquidGlassEnabled() ? { headerShadowVisible: false } : {}),
92
89
  })
93
90
 
94
91
  export const NewConversationStack = createNativeStackNavigator({
@@ -154,7 +151,6 @@ export const NewConversationStack = createNativeStackNavigator({
154
151
  {
155
152
  title: 'New conversation',
156
153
  headerLeft: () => null,
157
- headerTransparent: false,
158
154
  },
159
155
  withRightClose({
160
156
  onPress: () => {
@@ -200,7 +196,6 @@ export const ChatStack = createNativeStackNavigator({
200
196
  options: ({ route, navigation }) =>
201
197
  composeOptions(
202
198
  {
203
- ...conversationGlassHeader(),
204
199
  headerTitle: (props: NativeStackHeaderRightProps) => {
205
200
  const { conversation_id, title, badge, deleted, muted } =
206
201
  route.params as ConversationRouteProps
@@ -237,10 +232,7 @@ export const ChatStack = createNativeStackNavigator({
237
232
  screen: ConversationScreen,
238
233
  options: ({ route, navigation }) =>
239
234
  composeOptions(
240
- {
241
- ...conversationGlassHeader(),
242
- title: (route.params as ConversationRouteProps)?.title ?? 'Reply',
243
- },
235
+ { title: (route.params as ConversationRouteProps)?.title ?? 'Reply' },
244
236
  withMinimalBack({ onPress: navigation.goBack })
245
237
  ),
246
238
  },
@@ -333,7 +325,6 @@ export const ChatStack = createNativeStackNavigator({
333
325
  {
334
326
  title: 'New conversation',
335
327
  headerLeft: () => null,
336
- headerTransparent: false,
337
328
  },
338
329
  withRightClose({ onPress: () => navigation.getParent()?.goBack() })
339
330
  ),
@@ -6,15 +6,13 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
6
6
  import { DefaultLoading } from '../components/page/loading'
7
7
  import { PageErrorBoundary } from '../components/page/page_error_boundary'
8
8
  import { ChatAccessGate } from './chat_access_gate'
9
- import { PAGE_ERROR_FALLBACKS } from './page_error_fallbacks'
10
9
 
11
10
  export function ScreenLayout({ children }: { children: React.ReactElement }) {
12
11
  const route = useRoute()
13
- const genericFallback = PAGE_ERROR_FALLBACKS[route.name as keyof typeof PAGE_ERROR_FALLBACKS]
14
12
  const styles = useStyles()
15
13
 
16
14
  return (
17
- <PageErrorBoundary screenName={route.name} genericFallback={genericFallback}>
15
+ <PageErrorBoundary screenName={route.name}>
18
16
  <View style={styles.screen}>
19
17
  <Suspense fallback={<DefaultLoading />}>{children}</Suspense>
20
18
  </View>
@@ -58,11 +58,7 @@ export function AgeCheckRequiredScreen() {
58
58
 
59
59
  return (
60
60
  <>
61
- <ScrollView
62
- contentInsetAdjustmentBehavior="automatic"
63
- style={styles.scrollView}
64
- contentContainerStyle={styles.container}
65
- >
61
+ <ScrollView style={styles.scrollView} contentContainerStyle={styles.container}>
66
62
  <View style={styles.header}>
67
63
  <View style={styles.heading}>
68
64
  <Icon name="general.exclamationTriangle" size={20} style={styles.warningIcon} />
@@ -427,7 +427,6 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
427
427
  return (
428
428
  <View style={styles.listContainer}>
429
429
  <FlatList
430
- contentInsetAdjustmentBehavior="automatic"
431
430
  data={listData as SectionListData}
432
431
  contentContainerStyle={styles.contentContainer}
433
432
  renderItem={({ item, index }) => {
@@ -59,10 +59,7 @@ export const ConversationNewEntryScreen = ({ route }: ConversationSelectRecipien
59
59
  }
60
60
 
61
61
  return (
62
- <ScrollView
63
- contentInsetAdjustmentBehavior="automatic"
64
- contentContainerStyle={styles.contentContainer}
65
- >
62
+ <ScrollView contentContainerStyle={styles.contentContainer}>
66
63
  <View style={styles.header}>
67
64
  <Heading variant="h2">Start a conversation by</Heading>
68
65
  </View>
@@ -1,10 +1,11 @@
1
1
  import { PlatformPressable } from '@react-navigation/elements'
2
2
  import { StackActions, useNavigation } from '@react-navigation/native'
3
- import { ReactElement, RefObject, useRef, useState } from 'react'
3
+ import { RefObject, useRef, useState } from 'react'
4
4
  import { FlatList, Pressable, StyleSheet, TextInput, View } from 'react-native'
5
5
  import { Avatar, Badge, Banner, Icon, KeyboardView, Spinner, Text } from '../../components'
6
6
  import { ActionButton } from '../../components/display/action_button'
7
7
  import { AutoFocusAwareTextInput } from '../../components/display/text_input'
8
+ import { ComponentErrorBoundary } from '../../components/page/component_error_boundary'
8
9
  import { useTheme } from '../../hooks'
9
10
  import { useDirectMessageAffiliations } from '../../hooks/direct_messages/use_direct_message_affiliations'
10
11
  import { useDirectMessageCandidates } from '../../hooks/direct_messages/use_direct_message_candidates'
@@ -91,31 +92,38 @@ export function ConversationSelectDirectMessageRecipientsScreen({
91
92
 
92
93
  return (
93
94
  <KeyboardView>
95
+ {isError && (
96
+ <Banner
97
+ appearance="error"
98
+ description="There was an issue starting the conversation. Please try again."
99
+ style={styles.errorBanner}
100
+ />
101
+ )}
102
+ <ToField
103
+ selectedPeople={selectedPeople}
104
+ searchTerm={searchTerm}
105
+ onSearchChange={setSearchTerm}
106
+ onRemove={removePerson}
107
+ onClear={() => setSelectedPeople(new Map())}
108
+ searchInputRef={searchInputRef}
109
+ />
94
110
  <View style={styles.candidateResultsContainer}>
95
- <CandidateResults
96
- term={debouncedTerm}
97
- selectedPeople={selectedPeople}
98
- onSelect={selectPerson}
99
- header={
100
- <>
101
- {isError && (
102
- <Banner
103
- appearance="error"
104
- description="There was an issue starting the conversation. Please try again."
105
- style={styles.errorBanner}
106
- />
107
- )}
108
- <ToField
109
- selectedPeople={selectedPeople}
110
- searchTerm={searchTerm}
111
- onSearchChange={setSearchTerm}
112
- onRemove={removePerson}
113
- onClear={() => setSelectedPeople(new Map())}
114
- searchInputRef={searchInputRef}
115
- />
116
- </>
111
+ <ComponentErrorBoundary
112
+ key={debouncedTerm}
113
+ fallback={
114
+ <Banner
115
+ appearance="error"
116
+ description="Couldn't load people right now. Try again."
117
+ style={styles.errorBanner}
118
+ />
117
119
  }
118
- />
120
+ >
121
+ <CandidateResults
122
+ term={debouncedTerm}
123
+ selectedPeople={selectedPeople}
124
+ onSelect={selectPerson}
125
+ />
126
+ </ComponentErrorBoundary>
119
127
  </View>
120
128
  <ActionButton
121
129
  title={buttonText}
@@ -206,57 +214,53 @@ function CandidateResults({
206
214
  term,
207
215
  selectedPeople,
208
216
  onSelect,
209
- header,
210
217
  }: {
211
218
  term: string
212
219
  selectedPeople: Map<string, DirectMessageCandidateResource>
213
220
  onSelect: (candidate: DirectMessageCandidateResource) => void
214
- header: ReactElement
215
221
  }) {
216
222
  const styles = useStyles()
217
223
  const { data, isFetching } = useDirectMessageCandidates(term)
218
224
  const { groups, teams, resultsDescription } = useDirectMessageAffiliations()
219
225
 
220
- const unselectedCandidates = (data?.data ?? []).filter(c => !selectedPeople.has(c.id))
221
- const hasTruncated = (data?.meta.totalCount ?? 0) > (data?.data.length ?? 0)
222
- const isAtLimit = selectedPeople.size >= MAX_RECIPIENTS
223
- const showsResults = term.length >= 1 && !isAtLimit && unselectedCandidates.length > 0
226
+ if (term.length < 1) {
227
+ if (selectedPeople.size > 0) return null
224
228
 
225
- const emptyState = (() => {
226
- if (showsResults) return null
229
+ return (
230
+ <View style={styles.emptyState}>
231
+ <Icon name="churchCenter.people" size={40} style={styles.emptyStateIcon} />
232
+ <Text style={styles.emptyStateTitle}>Search for people to direct message</Text>
233
+ <Text variant="secondary" style={styles.emptyStateSubtitle}>
234
+ Start a conversation with people in your groups and teams.
235
+ </Text>
236
+ </View>
237
+ )
238
+ }
227
239
 
228
- if (term.length < 1) {
229
- if (selectedPeople.size > 0) return null
240
+ const isAtLimit = selectedPeople.size >= MAX_RECIPIENTS
230
241
 
231
- return (
232
- <View style={styles.emptyState}>
233
- <Icon name="churchCenter.people" size={40} style={styles.emptyStateIcon} />
234
- <Text style={styles.emptyStateTitle}>Search for people to direct message</Text>
235
- <Text variant="secondary" style={styles.emptyStateSubtitle}>
236
- Start a conversation with people in your groups and teams.
237
- </Text>
238
- </View>
239
- )
240
- }
242
+ if (isAtLimit) {
243
+ return (
244
+ <View style={styles.emptyState}>
245
+ <Text variant="secondary" style={styles.emptyStateSubtitle}>
246
+ You can add up to {MAX_RECIPIENTS} people to a direct message.
247
+ </Text>
248
+ </View>
249
+ )
250
+ }
241
251
 
242
- if (isAtLimit) {
243
- return (
244
- <View style={styles.emptyState}>
245
- <Text variant="secondary" style={styles.emptyStateSubtitle}>
246
- You can add up to {MAX_RECIPIENTS} people to a direct message.
247
- </Text>
248
- </View>
249
- )
250
- }
252
+ const unselectedCandidates = (data?.data ?? []).filter(c => !selectedPeople.has(c.id))
253
+ const hasTruncated = (data?.meta.totalCount ?? 0) > (data?.data.length ?? 0)
251
254
 
252
- if (isFetching) {
253
- return (
254
- <View style={styles.emptyState}>
255
- <Spinner />
256
- </View>
257
- )
258
- }
255
+ if (isFetching && unselectedCandidates.length === 0) {
256
+ return (
257
+ <View style={styles.emptyState}>
258
+ <Spinner />
259
+ </View>
260
+ )
261
+ }
259
262
 
263
+ if (!isFetching && unselectedCandidates.length === 0) {
260
264
  return (
261
265
  <View style={styles.emptyState}>
262
266
  <Icon name="general.search" size={32} style={styles.emptyStateIcon} />
@@ -266,15 +270,13 @@ function CandidateResults({
266
270
  </Text>
267
271
  </View>
268
272
  )
269
- })()
273
+ }
270
274
 
271
275
  return (
272
276
  <CandidateList
273
- header={header}
274
- candidates={showsResults ? unselectedCandidates : []}
277
+ candidates={unselectedCandidates}
275
278
  hasTruncated={hasTruncated}
276
279
  description={resultsDescription}
277
- emptyState={emptyState}
278
280
  groups={groups}
279
281
  teams={teams}
280
282
  onSelect={onSelect}
@@ -307,33 +309,27 @@ function candidateAffiliationNames(
307
309
  }
308
310
 
309
311
  function CandidateList({
310
- header,
311
312
  candidates,
312
313
  hasTruncated,
313
314
  description,
314
- emptyState,
315
315
  groups,
316
316
  teams,
317
317
  onSelect,
318
318
  }: {
319
- header: ReactElement
320
319
  candidates: DirectMessageCandidateResource[]
321
320
  hasTruncated: boolean
322
321
  description: string | null
323
- emptyState: ReactElement | null
324
322
  groups: Map<number, string>
325
323
  teams: Map<number, string>
326
324
  onSelect: (candidate: DirectMessageCandidateResource) => void
327
325
  }) {
328
326
  const styles = useStyles()
329
- const hasCandidates = candidates.length > 0
330
327
  const available = candidates.filter(c => !c.directMessagesDisabled)
331
328
  const dmDisabled = candidates.filter(c => c.directMessagesDisabled)
332
329
 
333
330
  return (
334
331
  <FlatList<DirectMessageCandidateResource>
335
332
  data={available}
336
- contentInsetAdjustmentBehavior="automatic"
337
333
  keyboardShouldPersistTaps="handled"
338
334
  keyExtractor={item => item.id}
339
335
  renderItem={({ item }) => (
@@ -344,13 +340,7 @@ function CandidateList({
344
340
  onSelect={() => onSelect(item)}
345
341
  />
346
342
  )}
347
- ListHeaderComponent={
348
- <>
349
- {header}
350
- {hasCandidates && <ResultsHeading description={description} />}
351
- </>
352
- }
353
- ListEmptyComponent={emptyState}
343
+ ListHeaderComponent={<ResultsHeading description={description} />}
354
344
  ListFooterComponent={
355
345
  <>
356
346
  {dmDisabled.length > 0 && (
@@ -371,7 +361,7 @@ function CandidateList({
371
361
  ))}
372
362
  </>
373
363
  )}
374
- {hasCandidates && hasTruncated && (
364
+ {hasTruncated && (
375
365
  <View style={styles.truncatedFooter}>
376
366
  <Text variant="secondary" style={styles.truncatedText}>
377
367
  Keep typing to narrow your results.