@planningcenter/chat-react-native 4.4.1-qa-1036.2 → 4.4.1-qa-staging.41
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_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +155 -123
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +1 -0
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/display/filter_dropdown.d.ts +1 -0
- package/build/components/display/filter_dropdown.d.ts.map +1 -1
- package/build/components/display/filter_dropdown.js.map +1 -1
- package/build/components/display/keyboard_scroll_view.d.ts.map +1 -1
- package/build/components/display/keyboard_scroll_view.js +1 -0
- package/build/components/display/keyboard_scroll_view.js.map +1 -1
- package/build/components/page/page_error_boundary.d.ts +9 -1
- package/build/components/page/page_error_boundary.d.ts.map +1 -1
- package/build/components/page/page_error_boundary.js +56 -31
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +11 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/page_error_fallbacks.d.ts +7 -0
- package/build/navigation/page_error_fallbacks.d.ts.map +1 -0
- package/build/navigation/page_error_fallbacks.js +7 -0
- package/build/navigation/page_error_fallbacks.js.map +1 -0
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +21 -13
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +1 -0
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +1 -0
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +1 -0
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +332 -291
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js +22 -7
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
- package/build/screens/get_help_screen.js +56 -62
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.js +3 -2
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +1 -0
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +45 -39
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/search/components/search_results_list.d.ts +4 -1
- package/build/screens/search/components/search_results_list.d.ts.map +1 -1
- package/build/screens/search/components/search_results_list.js +136 -110
- package/build/screens/search/components/search_results_list.js.map +1 -1
- package/build/screens/search/search_screen.d.ts.map +1 -1
- package/build/screens/search/search_screen.js +21 -28
- package/build/screens/search/search_screen.js.map +1 -1
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +7 -6
- package/build/screens/settings_screen.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/navigation/screen_layout.test.tsx +55 -0
- package/src/components/conversation/__tests__/message_list.test.tsx +4 -0
- package/src/components/conversation/message_list.tsx +6 -0
- package/src/components/conversations/conversations.tsx +1 -0
- package/src/components/display/filter_dropdown.tsx +1 -0
- package/src/components/display/keyboard_scroll_view.tsx +1 -0
- package/src/components/page/__tests__/page_error_boundary.test.tsx +33 -0
- package/src/components/page/page_error_boundary.tsx +43 -12
- package/src/navigation/index.tsx +11 -2
- package/src/navigation/page_error_fallbacks.ts +14 -0
- package/src/navigation/screenLayout.tsx +6 -3
- package/src/screens/age_check/age_check_required_screen.tsx +5 -1
- package/src/screens/conversation_details_screen.tsx +1 -0
- package/src/screens/conversation_select_recipients/__tests__/conversation_select_direct_message_recipients_screen.test.tsx +100 -0
- package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +4 -1
- package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +78 -68
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +1 -0
- package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +1 -0
- package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +59 -1
- package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +24 -9
- package/src/screens/get_help_screen.tsx +4 -4
- package/src/screens/group_notification_settings_screen.tsx +3 -3
- package/src/screens/notification_settings_screen.tsx +1 -0
- package/src/screens/preferred_app_selection_screen.tsx +4 -4
- package/src/screens/search/__tests__/search_screen.test.tsx +5 -7
- package/src/screens/search/components/__tests__/search_results_list.test.tsx +6 -2
- package/src/screens/search/components/search_results_list.tsx +34 -13
- package/src/screens/search/search_screen.tsx +8 -18
- package/src/screens/settings_screen.tsx +25 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react'
|
|
1
|
+
import React, { ReactElement, useEffect, useRef } from 'react'
|
|
2
2
|
import { FlatList, StyleSheet, View } from 'react-native'
|
|
3
3
|
import { Banner, Spinner, Text, TextButton } from '../../../components'
|
|
4
4
|
import { useSearchResults } from '../../../hooks/use_search_results'
|
|
@@ -23,9 +23,17 @@ interface SearchResultsListProps {
|
|
|
23
23
|
term: string
|
|
24
24
|
onSelect: (result: SearchResultResource, position: number) => void
|
|
25
25
|
onSettled: (term: string, counts: SearchResultCounts) => void
|
|
26
|
+
header: ReactElement
|
|
27
|
+
prompt: ReactElement
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
export function SearchResultsList({
|
|
30
|
+
export function SearchResultsList({
|
|
31
|
+
term,
|
|
32
|
+
onSelect,
|
|
33
|
+
onSettled,
|
|
34
|
+
header,
|
|
35
|
+
prompt,
|
|
36
|
+
}: SearchResultsListProps) {
|
|
29
37
|
const {
|
|
30
38
|
results,
|
|
31
39
|
failedTypes,
|
|
@@ -36,9 +44,10 @@ export function SearchResultsList({ term, onSelect, onSettled }: SearchResultsLi
|
|
|
36
44
|
hasNextPage,
|
|
37
45
|
isFetchingNextPage,
|
|
38
46
|
} = useSearchResults(term)
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
47
|
+
const searching = term.trim().length > 0
|
|
48
|
+
const conversationResults = searching ? results.filter(isConversationResult) : []
|
|
49
|
+
const messageResults = searching ? results.filter(isMessageResult) : []
|
|
50
|
+
const settled = searching && !isPending && !isError
|
|
42
51
|
|
|
43
52
|
const settledTermRef = useRef<string | undefined>(undefined)
|
|
44
53
|
|
|
@@ -56,6 +65,7 @@ export function SearchResultsList({ term, onSelect, onSettled }: SearchResultsLi
|
|
|
56
65
|
<FlatList
|
|
57
66
|
data={messageResults}
|
|
58
67
|
keyExtractor={item => item.id}
|
|
68
|
+
contentInsetAdjustmentBehavior="automatic"
|
|
59
69
|
keyboardShouldPersistTaps="handled"
|
|
60
70
|
keyboardDismissMode="on-drag"
|
|
61
71
|
contentContainerStyle={styles.content}
|
|
@@ -64,20 +74,27 @@ export function SearchResultsList({ term, onSelect, onSettled }: SearchResultsLi
|
|
|
64
74
|
)}
|
|
65
75
|
ListHeaderComponent={
|
|
66
76
|
<>
|
|
77
|
+
{header}
|
|
67
78
|
{conversationResults.length > 0 && (
|
|
68
79
|
<ConversationResults results={conversationResults} onSelect={onSelect} />
|
|
69
80
|
)}
|
|
70
|
-
{failedTypes.includes('conversation') &&
|
|
81
|
+
{searching && failedTypes.includes('conversation') && (
|
|
82
|
+
<SectionFailure type="conversation" />
|
|
83
|
+
)}
|
|
71
84
|
{messageResults.length > 0 && <ResultsSection title="Messages" />}
|
|
72
85
|
</>
|
|
73
86
|
}
|
|
74
87
|
ListEmptyComponent={
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
searching ? (
|
|
89
|
+
<ListEmpty
|
|
90
|
+
term={term}
|
|
91
|
+
isError={isError}
|
|
92
|
+
isPending={isPending}
|
|
93
|
+
noResults={results.length === 0 && failedTypes.length === 0}
|
|
94
|
+
/>
|
|
95
|
+
) : (
|
|
96
|
+
<View style={styles.prompt}>{prompt}</View>
|
|
97
|
+
)
|
|
81
98
|
}
|
|
82
99
|
ListFooterComponent={
|
|
83
100
|
<>
|
|
@@ -91,7 +108,7 @@ export function SearchResultsList({ term, onSelect, onSettled }: SearchResultsLi
|
|
|
91
108
|
Try again
|
|
92
109
|
</TextButton>
|
|
93
110
|
)}
|
|
94
|
-
{failedTypes.includes('message') && <SectionFailure type="message" />}
|
|
111
|
+
{searching && failedTypes.includes('message') && <SectionFailure type="message" />}
|
|
95
112
|
</>
|
|
96
113
|
}
|
|
97
114
|
onEndReached={() => {
|
|
@@ -149,6 +166,10 @@ const styles = StyleSheet.create({
|
|
|
149
166
|
content: {
|
|
150
167
|
flexGrow: 1,
|
|
151
168
|
},
|
|
169
|
+
prompt: {
|
|
170
|
+
flexGrow: 1,
|
|
171
|
+
justifyContent: 'center',
|
|
172
|
+
},
|
|
152
173
|
banner: {
|
|
153
174
|
margin: 16,
|
|
154
175
|
},
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
NativeStackScreenProps,
|
|
5
5
|
} from '@react-navigation/native-stack'
|
|
6
6
|
import React, { useRef, useState } from 'react'
|
|
7
|
-
import { Keyboard,
|
|
7
|
+
import { Keyboard, StyleSheet, View } from 'react-native'
|
|
8
8
|
import { KeyboardView } from '../../components'
|
|
9
9
|
import {
|
|
10
10
|
composeOptions,
|
|
@@ -64,19 +64,13 @@ export function SearchScreen() {
|
|
|
64
64
|
return (
|
|
65
65
|
<KeyboardView>
|
|
66
66
|
<View style={styles.container} testID="search-screen">
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/>
|
|
75
|
-
) : (
|
|
76
|
-
<ScrollView contentContainerStyle={styles.prompt} keyboardShouldPersistTaps="handled">
|
|
77
|
-
<SearchPromptBlankState />
|
|
78
|
-
</ScrollView>
|
|
79
|
-
)}
|
|
67
|
+
<SearchResultsList
|
|
68
|
+
term={debouncedTerm}
|
|
69
|
+
onSelect={openResult}
|
|
70
|
+
onSettled={publishSearch}
|
|
71
|
+
header={<SearchField term={term} onChange={setTerm} />}
|
|
72
|
+
prompt={<SearchPromptBlankState />}
|
|
73
|
+
/>
|
|
80
74
|
</View>
|
|
81
75
|
</KeyboardView>
|
|
82
76
|
)
|
|
@@ -86,8 +80,4 @@ const styles = StyleSheet.create({
|
|
|
86
80
|
container: {
|
|
87
81
|
flex: 1,
|
|
88
82
|
},
|
|
89
|
-
prompt: {
|
|
90
|
-
flexGrow: 1,
|
|
91
|
-
justifyContent: 'center',
|
|
92
|
-
},
|
|
93
83
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlatformPressable } from '@react-navigation/elements'
|
|
2
2
|
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
3
3
|
import React, { useCallback } from 'react'
|
|
4
|
-
import { Platform, StyleSheet, View } from 'react-native'
|
|
4
|
+
import { Platform, ScrollView, StyleSheet, View } from 'react-native'
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
6
|
import { Heading, Icon, Text, VersionFooter } from '../components'
|
|
7
7
|
import { Switch } from '../components/display/switch'
|
|
@@ -28,29 +28,31 @@ export function SettingsScreen({}: SettingsScreenProps) {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<View style={styles.container}>
|
|
31
|
-
<
|
|
32
|
-
<View style={styles.
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
{directMessagesEligible && (
|
|
36
|
-
<View style={styles.settingRow}>
|
|
37
|
-
<View style={styles.settingRowText}>
|
|
38
|
-
<Text>Allow direct messages</Text>
|
|
39
|
-
<Text variant="tertiary">
|
|
40
|
-
When off, you can't be added to new direct messages, and any you're already in will
|
|
41
|
-
be turned off.
|
|
42
|
-
</Text>
|
|
43
|
-
</View>
|
|
44
|
-
<Switch
|
|
45
|
-
value={!directMessagesDisabled}
|
|
46
|
-
onValueChange={enabled => setDirectMessagesDisabled(!enabled)}
|
|
47
|
-
disabled={isMutating}
|
|
48
|
-
/>
|
|
31
|
+
<ScrollView contentInsetAdjustmentBehavior="automatic">
|
|
32
|
+
<View style={styles.sectionOuter}>
|
|
33
|
+
<View style={styles.sectionHeader}>
|
|
34
|
+
<Heading variant="h2">Messages</Heading>
|
|
49
35
|
</View>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
{directMessagesEligible && (
|
|
37
|
+
<View style={styles.settingRow}>
|
|
38
|
+
<View style={styles.settingRowText}>
|
|
39
|
+
<Text>Allow direct messages</Text>
|
|
40
|
+
<Text variant="tertiary">
|
|
41
|
+
When off, you can't be added to new direct messages, and any you're already in
|
|
42
|
+
will be turned off.
|
|
43
|
+
</Text>
|
|
44
|
+
</View>
|
|
45
|
+
<Switch
|
|
46
|
+
value={!directMessagesDisabled}
|
|
47
|
+
onValueChange={enabled => setDirectMessagesDisabled(!enabled)}
|
|
48
|
+
disabled={isMutating}
|
|
49
|
+
/>
|
|
50
|
+
</View>
|
|
51
|
+
)}
|
|
52
|
+
<NavRow label="Notification settings" onPress={handleNotificationSettings} />
|
|
53
|
+
{appName !== 'services' && <NavRow label="Get help" onPress={handleGetHelp} />}
|
|
54
|
+
</View>
|
|
55
|
+
</ScrollView>
|
|
54
56
|
<View style={styles.footer}>
|
|
55
57
|
<VersionFooter />
|
|
56
58
|
</View>
|
|
@@ -90,8 +92,6 @@ const useStyles = () => {
|
|
|
90
92
|
flex: 1,
|
|
91
93
|
},
|
|
92
94
|
footer: {
|
|
93
|
-
flex: 1,
|
|
94
|
-
justifyContent: 'flex-end',
|
|
95
95
|
paddingBottom: Math.max(insets.bottom, 8),
|
|
96
96
|
},
|
|
97
97
|
sectionOuter: {
|