@planningcenter/chat-react-native 3.12.0-rc.8 → 3.12.0
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/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +11 -5
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/display/index.d.ts +1 -0
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +1 -0
- package/build/components/display/index.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +2 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +2 -2
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/hooks/use_report_bug_action.d.ts +1 -0
- package/build/hooks/use_report_bug_action.d.ts.map +1 -1
- package/build/hooks/use_report_bug_action.js +2 -1
- package/build/hooks/use_report_bug_action.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +216 -46
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +2 -1
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +2 -1
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +2 -1
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +1 -2
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +32 -75
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +11 -6
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +1 -1
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/attachments/image_attachment.tsx +12 -6
- package/src/components/display/index.ts +1 -0
- package/src/components/primitive/form_sheet.tsx +8 -2
- package/src/hooks/use_report_bug_action.ts +3 -0
- package/src/screens/bug_report_screen.tsx +302 -80
- package/src/screens/conversation_filters/components/conversation_filters.tsx +2 -1
- package/src/screens/conversation_filters/group_filters.tsx +2 -1
- package/src/screens/conversation_filters/team_filters.tsx +2 -1
- package/src/screens/conversation_filters_screen.tsx +36 -88
- package/src/screens/conversation_new/components/groups_form.tsx +12 -5
- package/src/screens/conversation_new/components/services_form.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useLayoutEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, TextInput, Linking, ScrollView } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity, Modal, } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview, BlankState, } from '../components';
|
|
4
|
+
import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview, BlankState, Icon, KeyboardView, } from '../components';
|
|
5
5
|
import { useTheme } from '../hooks';
|
|
6
6
|
import { useUploadClient } from '../hooks/use_upload_client';
|
|
7
7
|
import { ImagePicker, platformFontWeightBold } from '../utils';
|
|
@@ -11,7 +11,17 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
11
11
|
import { DefaultLoading } from '../components/page/loading';
|
|
12
12
|
import { startsWith } from 'lodash';
|
|
13
13
|
import { VideoAttachmentPreview } from '../components/display/video_attachment_preview';
|
|
14
|
-
const MAX_DESCRIPTION_LENGTH =
|
|
14
|
+
const MAX_DESCRIPTION_LENGTH = 2000;
|
|
15
|
+
const BUG_TYPE_OPTIONS = [
|
|
16
|
+
'Issues sending or receiving messages',
|
|
17
|
+
'Trouble starting a new conversation',
|
|
18
|
+
"Notifications aren't working",
|
|
19
|
+
'Incorrect read receipts or unread counts',
|
|
20
|
+
'Problems with file attachments',
|
|
21
|
+
"Something isn't displaying properly",
|
|
22
|
+
'App is slow or crashes',
|
|
23
|
+
'Other',
|
|
24
|
+
];
|
|
15
25
|
export const BugReportScreenOptions = ({ navigation, }) => ({
|
|
16
26
|
presentation: 'modal',
|
|
17
27
|
title: 'Report a bug',
|
|
@@ -20,23 +30,50 @@ export const BugReportScreenOptions = ({ navigation, }) => ({
|
|
|
20
30
|
export function BugReportScreen() {
|
|
21
31
|
const styles = useStyles();
|
|
22
32
|
const navigation = useNavigation();
|
|
23
|
-
const [
|
|
33
|
+
const [bugType, setBugType] = useState('');
|
|
34
|
+
const [showBugTypePicker, setShowBugTypePicker] = useState(false);
|
|
35
|
+
const [whatWereDoing, setWhatWereDoing] = useState('');
|
|
36
|
+
const [whatExpected, setWhatExpected] = useState('');
|
|
37
|
+
const [stepsToResolve, setStepsToResolve] = useState('');
|
|
24
38
|
const uploadApi = useUploadClient();
|
|
25
39
|
const [uploading, setUploading] = useState(false);
|
|
26
40
|
const [attachment, setAttachment] = useState(null);
|
|
27
41
|
const [uploadError, setUploadError] = useState(null);
|
|
28
42
|
const mutation = useReportBugAction();
|
|
29
43
|
const { mutate, status } = mutation;
|
|
30
|
-
const formValid =
|
|
44
|
+
const formValid = bugType.trim().length > 0 &&
|
|
45
|
+
whatWereDoing.trim().length > 0 &&
|
|
46
|
+
whatExpected.trim().length > 0 &&
|
|
47
|
+
stepsToResolve.trim().length > 0 &&
|
|
48
|
+
status === 'idle' &&
|
|
49
|
+
!uploading;
|
|
31
50
|
const [imagePreviewURI, setImagePreviewURI] = useState('');
|
|
32
|
-
const nearMaxDescription = description.length >= MAX_DESCRIPTION_LENGTH - 100;
|
|
33
51
|
const isImageAttachment = startsWith(attachment?.type, 'image/');
|
|
34
52
|
const handleSubmit = useCallback(() => {
|
|
53
|
+
const description = `${whatWereDoing.substring(0, 100)}
|
|
54
|
+
|
|
55
|
+
## What kind of bug did you experience?
|
|
56
|
+
${bugType}
|
|
57
|
+
|
|
58
|
+
## What were you trying to do when you encountered the bug?
|
|
59
|
+
${whatWereDoing}
|
|
60
|
+
|
|
61
|
+
## What did you expect to happen? What actually happened?
|
|
62
|
+
${whatExpected}
|
|
63
|
+
|
|
64
|
+
## What steps have you tried to resolve the issue?
|
|
65
|
+
${stepsToResolve}`;
|
|
35
66
|
mutate({
|
|
36
67
|
description,
|
|
68
|
+
description_json: JSON.stringify({
|
|
69
|
+
bugType,
|
|
70
|
+
whatWereDoing,
|
|
71
|
+
whatExpected,
|
|
72
|
+
stepsToResolve,
|
|
73
|
+
}),
|
|
37
74
|
attachmentIds: attachment ? [attachment.id] : [],
|
|
38
75
|
});
|
|
39
|
-
}, [attachment,
|
|
76
|
+
}, [attachment, bugType, whatWereDoing, whatExpected, stepsToResolve, mutate]);
|
|
40
77
|
const handleRemoveAttachment = useCallback(() => {
|
|
41
78
|
setAttachment(null);
|
|
42
79
|
setImagePreviewURI('');
|
|
@@ -103,46 +140,105 @@ export function BugReportScreen() {
|
|
|
103
140
|
<Button title="Return to chat" onPress={navigation.goBack} variant="fill" size="lg"/>
|
|
104
141
|
</View>);
|
|
105
142
|
}
|
|
106
|
-
return (<
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<TextInput style={styles.textInput} multiline placeholder="Details about the problem" value={description} onChangeText={setDescription} maxLength={MAX_DESCRIPTION_LENGTH}/>
|
|
113
|
-
{nearMaxDescription && (<Text variant="footnote">
|
|
114
|
-
{description.length}/{MAX_DESCRIPTION_LENGTH}
|
|
115
|
-
</Text>)}
|
|
116
|
-
</View>
|
|
143
|
+
return (<KeyboardView>
|
|
144
|
+
<ScrollView contentContainerStyle={styles.container}>
|
|
145
|
+
<Text style={styles.description}>
|
|
146
|
+
Thanks for helping us improve chat. Please provide details about the issue you've
|
|
147
|
+
encountered. We read every submission and your feedback helps us improve the experience.
|
|
148
|
+
</Text>
|
|
117
149
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Attachment <Text style={styles.subLabel}>(optional)</Text>
|
|
150
|
+
<View style={styles.textInputContainer}>
|
|
151
|
+
<Text style={styles.fieldLabel}>
|
|
152
|
+
What kind of bug did you experience? <Text style={styles.required}>*</Text>
|
|
122
153
|
</Text>
|
|
123
|
-
{
|
|
154
|
+
<TouchableOpacity style={styles.pickerButton} onPress={() => setShowBugTypePicker(true)}>
|
|
155
|
+
<Text style={[styles.pickerText, !bugType && styles.pickerPlaceholder]}>
|
|
156
|
+
{bugType || 'Select the bug type'}
|
|
157
|
+
</Text>
|
|
158
|
+
<Icon name="general.downChevron" style={styles.pickerArrow} accessibilityElementsHidden/>
|
|
159
|
+
</TouchableOpacity>
|
|
124
160
|
</View>
|
|
125
|
-
{uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}
|
|
126
|
-
{attachment ? (<View style={styles.attachmentPreviewContainer}>
|
|
127
|
-
{isImageAttachment ? (<ImageAttachmentPreview uri={imagePreviewURI} fileName={attachment.name} onRemovePress={handleRemoveAttachment}/>) : (<VideoAttachmentPreview name={attachment.name} onRemovePress={handleRemoveAttachment}/>)}
|
|
128
|
-
</View>) : (<Button title="Attach a screenshot" accessibilityHint="Opens your device's image gallery" iconNameLeft="general.paperclip" onPress={pickImage} size="sm" variant="outline" style={styles.attachButton} disabled={uploading || Boolean(attachment)}/>)}
|
|
129
|
-
</View>
|
|
130
161
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
162
|
+
<Modal visible={showBugTypePicker} animationType="slide" presentationStyle="pageSheet" onRequestClose={() => setShowBugTypePicker(false)}>
|
|
163
|
+
<View style={styles.modalContainer}>
|
|
164
|
+
<View style={styles.modalHeader}>
|
|
165
|
+
<HeaderCancelButton title="Cancel" onPress={() => setShowBugTypePicker(false)}/>
|
|
166
|
+
<Text style={styles.modalTitle}>Select Bug Type</Text>
|
|
167
|
+
<View style={styles.modalHeaderSpacer}/>
|
|
168
|
+
</View>
|
|
169
|
+
<ScrollView style={styles.modalContent}>
|
|
170
|
+
{BUG_TYPE_OPTIONS.map(option => (<TouchableOpacity key={option} style={styles.modalOption} onPress={() => {
|
|
171
|
+
setBugType(option);
|
|
172
|
+
setShowBugTypePicker(false);
|
|
173
|
+
}}>
|
|
174
|
+
<Text style={styles.modalOptionText}>{option}</Text>
|
|
175
|
+
{bugType === option && (<Icon name="general.check" style={styles.modalCheckmark} accessibilityElementsHidden/>)}
|
|
176
|
+
</TouchableOpacity>))}
|
|
177
|
+
</ScrollView>
|
|
178
|
+
</View>
|
|
179
|
+
</Modal>
|
|
136
180
|
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</
|
|
142
|
-
.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
181
|
+
<View style={styles.textInputContainer}>
|
|
182
|
+
<Text style={styles.fieldLabel}>
|
|
183
|
+
What were you trying to do when you encountered the bug?{' '}
|
|
184
|
+
<Text style={styles.required}>*</Text>
|
|
185
|
+
</Text>
|
|
186
|
+
<TextInput style={styles.textInput} multiline placeholder="Description" value={whatWereDoing} onChangeText={setWhatWereDoing} maxLength={MAX_DESCRIPTION_LENGTH}/>
|
|
187
|
+
{whatWereDoing.length >= MAX_DESCRIPTION_LENGTH - 100 && (<Text variant="footnote">
|
|
188
|
+
{whatWereDoing.length}/{MAX_DESCRIPTION_LENGTH}
|
|
189
|
+
</Text>)}
|
|
190
|
+
</View>
|
|
191
|
+
|
|
192
|
+
<View style={styles.textInputContainer}>
|
|
193
|
+
<Text style={styles.fieldLabel}>
|
|
194
|
+
What did you expect to happen? What actually happened?{' '}
|
|
195
|
+
<Text style={styles.required}>*</Text>
|
|
196
|
+
</Text>
|
|
197
|
+
<TextInput style={styles.textInput} multiline placeholder="Description" value={whatExpected} onChangeText={setWhatExpected} maxLength={MAX_DESCRIPTION_LENGTH}/>
|
|
198
|
+
{whatExpected.length >= MAX_DESCRIPTION_LENGTH - 100 && (<Text variant="footnote">
|
|
199
|
+
{whatExpected.length}/{MAX_DESCRIPTION_LENGTH}
|
|
200
|
+
</Text>)}
|
|
201
|
+
</View>
|
|
202
|
+
|
|
203
|
+
<View style={styles.textInputContainer}>
|
|
204
|
+
<Text style={styles.fieldLabel}>
|
|
205
|
+
What steps have you tried to resolve the issue? <Text style={styles.required}>*</Text>
|
|
206
|
+
</Text>
|
|
207
|
+
<TextInput style={styles.textInput} multiline placeholder="Description" value={stepsToResolve} onChangeText={setStepsToResolve} maxLength={MAX_DESCRIPTION_LENGTH}/>
|
|
208
|
+
{stepsToResolve.length >= MAX_DESCRIPTION_LENGTH - 100 && (<Text variant="footnote">
|
|
209
|
+
{stepsToResolve.length}/{MAX_DESCRIPTION_LENGTH}
|
|
210
|
+
</Text>)}
|
|
211
|
+
</View>
|
|
212
|
+
|
|
213
|
+
<View style={styles.attachmentSection}>
|
|
214
|
+
<View style={styles.attachmentHeader}>
|
|
215
|
+
<Text style={styles.attachmentLabel}>
|
|
216
|
+
Attachment <Text style={styles.subLabel}>(optional)</Text>
|
|
217
|
+
</Text>
|
|
218
|
+
{uploading && <Spinner />}
|
|
219
|
+
</View>
|
|
220
|
+
{uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}
|
|
221
|
+
{attachment ? (<View style={styles.attachmentPreviewContainer}>
|
|
222
|
+
{isImageAttachment ? (<ImageAttachmentPreview uri={imagePreviewURI} fileName={attachment.name} onRemovePress={handleRemoveAttachment}/>) : (<VideoAttachmentPreview name={attachment.name} onRemovePress={handleRemoveAttachment}/>)}
|
|
223
|
+
</View>) : (<Button title="Attach a screenshot" accessibilityHint="Opens your device's image gallery" iconNameLeft="general.paperclip" onPress={pickImage} size="sm" variant="outline" style={styles.attachButton} disabled={uploading || Boolean(attachment)}/>)}
|
|
224
|
+
</View>
|
|
225
|
+
|
|
226
|
+
<View style={styles.footer}>
|
|
227
|
+
<Text variant="footnote">
|
|
228
|
+
We can’t respond to every submission, but we may reach out if we have additional
|
|
229
|
+
questions.
|
|
230
|
+
</Text>
|
|
231
|
+
|
|
232
|
+
<Text variant="footnote">
|
|
233
|
+
For details on how we process your data and ensure its security, please refer to our{' '}
|
|
234
|
+
<TextInlineButton accessibilityRole="link" variant="footnote" onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}>
|
|
235
|
+
Privacy Policy
|
|
236
|
+
</TextInlineButton>
|
|
237
|
+
.
|
|
238
|
+
</Text>
|
|
239
|
+
</View>
|
|
240
|
+
</ScrollView>
|
|
241
|
+
</KeyboardView>);
|
|
146
242
|
}
|
|
147
243
|
const useStyles = () => {
|
|
148
244
|
const { colors } = useTheme();
|
|
@@ -160,13 +256,81 @@ const useStyles = () => {
|
|
|
160
256
|
color: colors.textColorDefaultSecondary,
|
|
161
257
|
},
|
|
162
258
|
textInputContainer: {
|
|
163
|
-
|
|
164
|
-
|
|
259
|
+
gap: 8,
|
|
260
|
+
},
|
|
261
|
+
fieldLabel: {
|
|
262
|
+
fontSize: 16,
|
|
263
|
+
fontWeight: platformFontWeightBold,
|
|
264
|
+
color: colors.textColorDefaultPrimary,
|
|
265
|
+
},
|
|
266
|
+
required: {
|
|
267
|
+
color: colors.statusErrorText,
|
|
268
|
+
},
|
|
269
|
+
pickerButton: {
|
|
270
|
+
flexDirection: 'row',
|
|
271
|
+
alignItems: 'center',
|
|
272
|
+
justifyContent: 'space-between',
|
|
273
|
+
borderWidth: 1,
|
|
165
274
|
borderColor: colors.borderColorDefaultBase,
|
|
275
|
+
borderRadius: 8,
|
|
276
|
+
paddingHorizontal: 16,
|
|
166
277
|
paddingVertical: 12,
|
|
278
|
+
backgroundColor: colors.surfaceColor100,
|
|
279
|
+
minHeight: 48,
|
|
280
|
+
},
|
|
281
|
+
pickerText: {
|
|
282
|
+
fontSize: 16,
|
|
283
|
+
color: colors.textColorDefaultPrimary,
|
|
284
|
+
flex: 1,
|
|
285
|
+
},
|
|
286
|
+
pickerPlaceholder: {
|
|
287
|
+
color: colors.textColorDefaultSecondary,
|
|
288
|
+
},
|
|
289
|
+
pickerArrow: {
|
|
290
|
+
fontSize: 12,
|
|
291
|
+
color: colors.iconColorDefaultSecondary,
|
|
292
|
+
marginLeft: 8,
|
|
293
|
+
},
|
|
294
|
+
modalContainer: {
|
|
295
|
+
flex: 1,
|
|
296
|
+
backgroundColor: colors.surfaceColor100,
|
|
297
|
+
},
|
|
298
|
+
modalHeader: {
|
|
299
|
+
flexDirection: 'row',
|
|
300
|
+
alignItems: 'center',
|
|
301
|
+
justifyContent: 'space-between',
|
|
302
|
+
padding: 16,
|
|
303
|
+
borderBottomWidth: 1,
|
|
304
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
305
|
+
},
|
|
306
|
+
modalTitle: {
|
|
307
|
+
fontSize: 18,
|
|
308
|
+
fontWeight: platformFontWeightBold,
|
|
309
|
+
color: colors.textColorDefaultPrimary,
|
|
310
|
+
},
|
|
311
|
+
modalHeaderSpacer: {
|
|
312
|
+
width: 50, // Same width as cancel button to center title
|
|
313
|
+
},
|
|
314
|
+
modalContent: {
|
|
315
|
+
flex: 1,
|
|
316
|
+
},
|
|
317
|
+
modalOption: {
|
|
318
|
+
flexDirection: 'row',
|
|
319
|
+
alignItems: 'center',
|
|
320
|
+
justifyContent: 'space-between',
|
|
167
321
|
paddingHorizontal: 16,
|
|
168
|
-
|
|
169
|
-
|
|
322
|
+
paddingVertical: 16,
|
|
323
|
+
borderBottomWidth: 1,
|
|
324
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
325
|
+
},
|
|
326
|
+
modalOptionText: {
|
|
327
|
+
fontSize: 16,
|
|
328
|
+
color: colors.textColorDefaultPrimary,
|
|
329
|
+
flex: 1,
|
|
330
|
+
},
|
|
331
|
+
modalCheckmark: {
|
|
332
|
+
fontSize: 16,
|
|
333
|
+
color: colors.statusSuccessIcon,
|
|
170
334
|
},
|
|
171
335
|
textInput: {
|
|
172
336
|
color: colors.textColorDefaultPrimary,
|
|
@@ -174,6 +338,12 @@ const useStyles = () => {
|
|
|
174
338
|
textAlignVertical: 'top',
|
|
175
339
|
minHeight: 120,
|
|
176
340
|
maxHeight: 200,
|
|
341
|
+
borderWidth: 1,
|
|
342
|
+
borderColor: colors.borderColorDefaultBase,
|
|
343
|
+
borderRadius: 8,
|
|
344
|
+
paddingHorizontal: 16,
|
|
345
|
+
paddingVertical: 12,
|
|
346
|
+
backgroundColor: colors.surfaceColor100,
|
|
177
347
|
},
|
|
178
348
|
attachmentSection: {
|
|
179
349
|
gap: 8,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug_report_screen.js","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAK/E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAqB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EA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,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useCallback, useLayoutEffect, useState } from 'react'\nimport { View, StyleSheet, TextInput, Linking, ScrollView } from 'react-native'\nimport type {\n NativeStackNavigationOptions,\n NativeStackScreenProps,\n} from '@react-navigation/native-stack'\nimport { useNavigation } from '@react-navigation/native'\nimport {\n Button,\n Spinner,\n Text,\n TextInlineButton,\n ImageAttachmentPreview,\n BlankState,\n} from '../components'\nimport { useTheme } from '../hooks'\nimport { useUploadClient } from '../hooks/use_upload_client'\nimport { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'\nimport { useReportBugAction } from '../hooks/use_report_bug_action'\nimport {\n HeaderCancelButton,\n HeaderSubmitButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\n\nconst MAX_DESCRIPTION_LENGTH = 5000\n\nexport const BugReportScreenOptions = ({\n navigation,\n}: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({\n presentation: 'modal',\n title: 'Report a bug',\n headerLeft: () => <HeaderCancelButton title=\"Cancel\" onPress={() => navigation.goBack()} />,\n})\n\ninterface Attachment {\n id: string\n name: string\n type: string\n}\n\nexport function BugReportScreen() {\n const styles = useStyles()\n const navigation = useNavigation()\n const [description, setDescription] = useState('')\n const uploadApi = useUploadClient()\n const [uploading, setUploading] = useState(false)\n const [attachment, setAttachment] = useState<Attachment | null>(null)\n const [uploadError, setUploadError] = useState<string | null>(null)\n const mutation = useReportBugAction()\n const { mutate, status } = mutation\n const formValid = description.trim().length > 0 && status === 'idle' && !uploading\n const [imagePreviewURI, setImagePreviewURI] = useState<string>('')\n\n const nearMaxDescription = description.length >= MAX_DESCRIPTION_LENGTH - 100\n const isImageAttachment = startsWith(attachment?.type, 'image/')\n\n const handleSubmit = useCallback(() => {\n mutate({\n description,\n attachmentIds: attachment ? [attachment.id] : [],\n })\n }, [attachment, description, mutate])\n\n const handleRemoveAttachment = useCallback(() => {\n setAttachment(null)\n setImagePreviewURI('')\n }, [])\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled || result.assets.length === 0) {\n setUploading(false)\n return\n }\n\n const asset = result.assets[0]\n\n uploadApi\n ?.uploadFile({\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n })\n .then(uploadedResource => {\n setUploading(false)\n setImagePreviewURI(asset.uri)\n setAttachment({\n id: uploadedResource.id,\n name: asset.fileName || 'File',\n type: asset.mimeType as string,\n })\n })\n .catch(() => {\n setUploading(false)\n setUploadError(`Failed to upload attachment`)\n })\n }\n\n function pickImage() {\n setUploading(true)\n return ImagePicker.openImageLibraryAsync().then(result => uploadImagePickerResult(result))\n }\n\n useLayoutEffect(() => {\n navigation.setOptions({\n // eslint-disable-next-line react/no-unstable-nested-components\n headerRight: () => (\n <HeaderSubmitButton title=\"Submit\" onPress={handleSubmit} disabled={!formValid} />\n ),\n })\n }, [formValid, handleSubmit, navigation])\n\n if (status === 'pending') {\n return (\n <View style={[styles.container, styles.fullHeight]}>\n <DefaultLoading />\n </View>\n )\n }\n\n if (status === 'success') {\n return (\n <BlankState\n iconName=\"general.checkCircle\"\n iconStyle={styles.successIcon}\n title=\"Thank you!\"\n titleStyle={styles.successTitle}\n subtitle=\"We appreciate you taking the time to help improve chat! We'll take a look at the issue you reported.\"\n subtitleStyle={styles.successSubtitle}\n buttonProps={{\n title: 'Return to chat',\n onPress: navigation.goBack,\n size: 'lg',\n variant: 'fill',\n }}\n />\n )\n }\n\n if (status === 'error') {\n return (\n <View style={styles.container}>\n <Text>\n This is embarrassing, we can't submit your bug report right now. If you still need help or\n would like to submit this bug report another way please{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n onPress={() =>\n Linking.openURL('https://support.planningcenteronline.com/hc/en-us/requests/new')\n }\n >\n contact our help center\n </TextInlineButton>\n .\n </Text>\n <Button title=\"Return to chat\" onPress={navigation.goBack} variant=\"fill\" size=\"lg\" />\n </View>\n )\n }\n\n return (\n <ScrollView contentContainerStyle={styles.container}>\n <Text style={styles.description}>\n Thanks for helping us improve chat! Please provide details about the issue you’ve\n encountered. We read every submission and your feedback helps us improve the experience.\n </Text>\n <View style={styles.textInputContainer}>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Details about the problem\"\n value={description}\n onChangeText={setDescription}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {nearMaxDescription && (\n <Text variant=\"footnote\">\n {description.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.attachmentSection}>\n <View style={styles.attachmentHeader}>\n <Text style={styles.attachmentLabel}>\n Attachment <Text style={styles.subLabel}>(optional)</Text>\n </Text>\n {uploading && <Spinner />}\n </View>\n {uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}\n {attachment ? (\n <View style={styles.attachmentPreviewContainer}>\n {isImageAttachment ? (\n <ImageAttachmentPreview\n uri={imagePreviewURI}\n fileName={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n ) : (\n <VideoAttachmentPreview\n name={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n )}\n </View>\n ) : (\n <Button\n title=\"Attach a screenshot\"\n accessibilityHint=\"Opens your device's image gallery\"\n iconNameLeft=\"general.paperclip\"\n onPress={pickImage}\n size=\"sm\"\n variant=\"outline\"\n style={styles.attachButton}\n disabled={uploading || Boolean(attachment)}\n />\n )}\n </View>\n\n <View style={styles.footer}>\n <Text variant=\"footnote\">\n We can’t respond to every submission, but we may reach out if we have additional\n questions.\n </Text>\n\n <Text variant=\"footnote\">\n For details on how we process your data and ensure its security, please refer to our{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n variant=\"footnote\"\n onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}\n >\n Privacy Policy\n </TextInlineButton>\n .\n </Text>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: bottom + 16,\n gap: 24,\n },\n fullHeight: {\n flex: 1,\n },\n description: {\n color: colors.textColorDefaultSecondary,\n },\n textInputContainer: {\n borderTopWidth: 1,\n borderBottomWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingHorizontal: 16,\n marginHorizontal: -16,\n gap: 8,\n },\n textInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: 16,\n textAlignVertical: 'top',\n minHeight: 120,\n maxHeight: 200,\n },\n attachmentSection: {\n gap: 8,\n },\n attachmentHeader: {\n flexDirection: 'row',\n gap: 4,\n alignItems: 'center',\n },\n attachmentLabel: { fontWeight: platformFontWeightBold },\n subLabel: { fontWeight: 'normal', color: colors.textColorDefaultSecondary },\n attachmentPreviewContainer: {\n gap: 4,\n },\n attachmentErrorText: {\n color: colors.statusErrorText,\n },\n attachButton: {\n alignSelf: 'flex-start',\n },\n footer: { gap: 8 },\n successIcon: {\n color: colors.statusSuccessIcon,\n fontSize: 48,\n },\n successTitle: {\n fontSize: 24,\n marginBottom: 4,\n },\n successSubtitle: {\n fontSize: 16,\n marginBottom: 4,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bug_report_screen.js","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,KAAK,GACN,MAAM,cAAc,CAAA;AAKrB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,E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D,gBAAgB,EAAE;YAChB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;QACD,eAAe,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAE;QACvD,QAAQ,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,yBAAyB,EAAE;QAC3E,0BAA0B,EAAE;YAC1B,GAAG,EAAE,CAAC;SACP;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,YAAY;SACxB;QACD,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;QAClB,WAAW,EAAE;YACX,KAAK,EAAE,MAAM,CAAC,iBAAiB;YAC/B,QAAQ,EAAE,EAAE;SACb;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,CAAC;SAChB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,CAAC;SAChB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useCallback, useLayoutEffect, useState } from 'react'\nimport {\n View,\n StyleSheet,\n TextInput,\n Linking,\n ScrollView,\n TouchableOpacity,\n Modal,\n} from 'react-native'\nimport type {\n NativeStackNavigationOptions,\n NativeStackScreenProps,\n} from '@react-navigation/native-stack'\nimport { useNavigation } from '@react-navigation/native'\nimport {\n Button,\n Spinner,\n Text,\n TextInlineButton,\n ImageAttachmentPreview,\n BlankState,\n Icon,\n KeyboardView,\n} from '../components'\nimport { useTheme } from '../hooks'\nimport { useUploadClient } from '../hooks/use_upload_client'\nimport { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'\nimport { useReportBugAction } from '../hooks/use_report_bug_action'\nimport {\n HeaderCancelButton,\n HeaderSubmitButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\n\nconst MAX_DESCRIPTION_LENGTH = 2000\n\nconst BUG_TYPE_OPTIONS = [\n 'Issues sending or receiving messages',\n 'Trouble starting a new conversation',\n \"Notifications aren't working\",\n 'Incorrect read receipts or unread counts',\n 'Problems with file attachments',\n \"Something isn't displaying properly\",\n 'App is slow or crashes',\n 'Other',\n]\n\nexport const BugReportScreenOptions = ({\n navigation,\n}: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({\n presentation: 'modal',\n title: 'Report a bug',\n headerLeft: () => <HeaderCancelButton title=\"Cancel\" onPress={() => navigation.goBack()} />,\n})\n\ninterface Attachment {\n id: string\n name: string\n type: string\n}\n\nexport function BugReportScreen() {\n const styles = useStyles()\n const navigation = useNavigation()\n const [bugType, setBugType] = useState('')\n const [showBugTypePicker, setShowBugTypePicker] = useState(false)\n const [whatWereDoing, setWhatWereDoing] = useState('')\n const [whatExpected, setWhatExpected] = useState('')\n const [stepsToResolve, setStepsToResolve] = useState('')\n const uploadApi = useUploadClient()\n const [uploading, setUploading] = useState(false)\n const [attachment, setAttachment] = useState<Attachment | null>(null)\n const [uploadError, setUploadError] = useState<string | null>(null)\n const mutation = useReportBugAction()\n const { mutate, status } = mutation\n const formValid =\n bugType.trim().length > 0 &&\n whatWereDoing.trim().length > 0 &&\n whatExpected.trim().length > 0 &&\n stepsToResolve.trim().length > 0 &&\n status === 'idle' &&\n !uploading\n const [imagePreviewURI, setImagePreviewURI] = useState<string>('')\n\n const isImageAttachment = startsWith(attachment?.type, 'image/')\n\n const handleSubmit = useCallback(() => {\n const description = `${whatWereDoing.substring(0, 100)}\n\n## What kind of bug did you experience?\n${bugType}\n\n## What were you trying to do when you encountered the bug?\n${whatWereDoing}\n\n## What did you expect to happen? What actually happened?\n${whatExpected}\n\n## What steps have you tried to resolve the issue?\n${stepsToResolve}`\n\n mutate({\n description,\n description_json: JSON.stringify({\n bugType,\n whatWereDoing,\n whatExpected,\n stepsToResolve,\n }),\n attachmentIds: attachment ? [attachment.id] : [],\n })\n }, [attachment, bugType, whatWereDoing, whatExpected, stepsToResolve, mutate])\n\n const handleRemoveAttachment = useCallback(() => {\n setAttachment(null)\n setImagePreviewURI('')\n }, [])\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled || result.assets.length === 0) {\n setUploading(false)\n return\n }\n\n const asset = result.assets[0]\n\n uploadApi\n ?.uploadFile({\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n })\n .then(uploadedResource => {\n setUploading(false)\n setImagePreviewURI(asset.uri)\n setAttachment({\n id: uploadedResource.id,\n name: asset.fileName || 'File',\n type: asset.mimeType as string,\n })\n })\n .catch(() => {\n setUploading(false)\n setUploadError(`Failed to upload attachment`)\n })\n }\n\n function pickImage() {\n setUploading(true)\n return ImagePicker.openImageLibraryAsync().then(result => uploadImagePickerResult(result))\n }\n\n useLayoutEffect(() => {\n navigation.setOptions({\n // eslint-disable-next-line react/no-unstable-nested-components\n headerRight: () => (\n <HeaderSubmitButton title=\"Submit\" onPress={handleSubmit} disabled={!formValid} />\n ),\n })\n }, [formValid, handleSubmit, navigation])\n\n if (status === 'pending') {\n return (\n <View style={[styles.container, styles.fullHeight]}>\n <DefaultLoading />\n </View>\n )\n }\n\n if (status === 'success') {\n return (\n <BlankState\n iconName=\"general.checkCircle\"\n iconStyle={styles.successIcon}\n title=\"Thank you!\"\n titleStyle={styles.successTitle}\n subtitle=\"We appreciate you taking the time to help improve chat! We'll take a look at the issue you reported.\"\n subtitleStyle={styles.successSubtitle}\n buttonProps={{\n title: 'Return to chat',\n onPress: navigation.goBack,\n size: 'lg',\n variant: 'fill',\n }}\n />\n )\n }\n\n if (status === 'error') {\n return (\n <View style={styles.container}>\n <Text>\n This is embarrassing, we can't submit your bug report right now. If you still need help or\n would like to submit this bug report another way please{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n onPress={() =>\n Linking.openURL('https://support.planningcenteronline.com/hc/en-us/requests/new')\n }\n >\n contact our help center\n </TextInlineButton>\n .\n </Text>\n <Button title=\"Return to chat\" onPress={navigation.goBack} variant=\"fill\" size=\"lg\" />\n </View>\n )\n }\n\n return (\n <KeyboardView>\n <ScrollView contentContainerStyle={styles.container}>\n <Text style={styles.description}>\n Thanks for helping us improve chat. Please provide details about the issue you've\n encountered. We read every submission and your feedback helps us improve the experience.\n </Text>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What kind of bug did you experience? <Text style={styles.required}>*</Text>\n </Text>\n <TouchableOpacity style={styles.pickerButton} onPress={() => setShowBugTypePicker(true)}>\n <Text style={[styles.pickerText, !bugType && styles.pickerPlaceholder]}>\n {bugType || 'Select the bug type'}\n </Text>\n <Icon\n name=\"general.downChevron\"\n style={styles.pickerArrow}\n accessibilityElementsHidden\n />\n </TouchableOpacity>\n </View>\n\n <Modal\n visible={showBugTypePicker}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={() => setShowBugTypePicker(false)}\n >\n <View style={styles.modalContainer}>\n <View style={styles.modalHeader}>\n <HeaderCancelButton title=\"Cancel\" onPress={() => setShowBugTypePicker(false)} />\n <Text style={styles.modalTitle}>Select Bug Type</Text>\n <View style={styles.modalHeaderSpacer} />\n </View>\n <ScrollView style={styles.modalContent}>\n {BUG_TYPE_OPTIONS.map(option => (\n <TouchableOpacity\n key={option}\n style={styles.modalOption}\n onPress={() => {\n setBugType(option)\n setShowBugTypePicker(false)\n }}\n >\n <Text style={styles.modalOptionText}>{option}</Text>\n {bugType === option && (\n <Icon\n name=\"general.check\"\n style={styles.modalCheckmark}\n accessibilityElementsHidden\n />\n )}\n </TouchableOpacity>\n ))}\n </ScrollView>\n </View>\n </Modal>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What were you trying to do when you encountered the bug?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatWereDoing}\n onChangeText={setWhatWereDoing}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatWereDoing.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatWereDoing.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What did you expect to happen? What actually happened?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatExpected}\n onChangeText={setWhatExpected}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatExpected.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatExpected.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What steps have you tried to resolve the issue? <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={stepsToResolve}\n onChangeText={setStepsToResolve}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {stepsToResolve.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {stepsToResolve.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.attachmentSection}>\n <View style={styles.attachmentHeader}>\n <Text style={styles.attachmentLabel}>\n Attachment <Text style={styles.subLabel}>(optional)</Text>\n </Text>\n {uploading && <Spinner />}\n </View>\n {uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}\n {attachment ? (\n <View style={styles.attachmentPreviewContainer}>\n {isImageAttachment ? (\n <ImageAttachmentPreview\n uri={imagePreviewURI}\n fileName={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n ) : (\n <VideoAttachmentPreview\n name={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n )}\n </View>\n ) : (\n <Button\n title=\"Attach a screenshot\"\n accessibilityHint=\"Opens your device's image gallery\"\n iconNameLeft=\"general.paperclip\"\n onPress={pickImage}\n size=\"sm\"\n variant=\"outline\"\n style={styles.attachButton}\n disabled={uploading || Boolean(attachment)}\n />\n )}\n </View>\n\n <View style={styles.footer}>\n <Text variant=\"footnote\">\n We can’t respond to every submission, but we may reach out if we have additional\n questions.\n </Text>\n\n <Text variant=\"footnote\">\n For details on how we process your data and ensure its security, please refer to our{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n variant=\"footnote\"\n onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}\n >\n Privacy Policy\n </TextInlineButton>\n .\n </Text>\n </View>\n </ScrollView>\n </KeyboardView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: bottom + 16,\n gap: 24,\n },\n fullHeight: {\n flex: 1,\n },\n description: {\n color: colors.textColorDefaultSecondary,\n },\n textInputContainer: {\n gap: 8,\n },\n fieldLabel: {\n fontSize: 16,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n required: {\n color: colors.statusErrorText,\n },\n pickerButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n minHeight: 48,\n },\n pickerText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n pickerPlaceholder: {\n color: colors.textColorDefaultSecondary,\n },\n pickerArrow: {\n fontSize: 12,\n color: colors.iconColorDefaultSecondary,\n marginLeft: 8,\n },\n modalContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor100,\n },\n modalHeader: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalTitle: {\n fontSize: 18,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n modalHeaderSpacer: {\n width: 50, // Same width as cancel button to center title\n },\n modalContent: {\n flex: 1,\n },\n modalOption: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalOptionText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n modalCheckmark: {\n fontSize: 16,\n color: colors.statusSuccessIcon,\n },\n textInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: 16,\n textAlignVertical: 'top',\n minHeight: 120,\n maxHeight: 200,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n },\n attachmentSection: {\n gap: 8,\n },\n attachmentHeader: {\n flexDirection: 'row',\n gap: 4,\n alignItems: 'center',\n },\n attachmentLabel: { fontWeight: platformFontWeightBold },\n subLabel: { fontWeight: 'normal', color: colors.textColorDefaultSecondary },\n attachmentPreviewContainer: {\n gap: 4,\n },\n attachmentErrorText: {\n color: colors.statusErrorText,\n },\n attachButton: {\n alignSelf: 'flex-start',\n },\n footer: { gap: 8 },\n successIcon: {\n color: colors.statusSuccessIcon,\n fontSize: 48,\n },\n successTitle: {\n fontSize: 24,\n marginBottom: 4,\n },\n successSubtitle: {\n fontSize: 16,\n marginBottom: 4,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/conversation_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_filters.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/conversation_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAoDlD,eAAO,MAAM,mBAAmB,yBAgH/B,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { FlatList } from 'react-native-gesture-handler';
|
|
3
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
5
|
import { Heading } from '../../../components';
|
|
5
6
|
import { useTheme } from '../../../hooks';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/conversation_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAEL,SAAS,EACT,QAAQ,EAER,OAAO,EAEP,QAAQ,GAET,MAAM,QAAQ,CAAA;AAEf,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAK,YAOJ;AAPD,WAAK,YAAY;IACf,mDAAM,CAAA;IACN,mDA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AA;IAChC,CAAC;IAED,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { FlatList, Platform, StyleSheet, View, ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading } from '../../../components'\nimport { useTheme } from '../../../hooks'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'\nimport {\n FilterProps,\n FilterRow,\n GroupRow,\n GroupRowProps,\n TeamRow,\n TeamRowProps,\n ViewMore,\n ViewMoreRowProps,\n} from './rows'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n filter,\n groups,\n header,\n hidden,\n more,\n teams,\n}\n\ntype SectionListData = Array<\n | DataItem<FilterProps, SectionTypes.filter>\n | DataItem<GroupRowProps, SectionTypes.groups>\n | DataItem<HeaderProps, SectionTypes.header>\n | DataItem<any, SectionTypes.hidden>\n | DataItem<ViewMoreRowProps, SectionTypes.more>\n | DataItem<TeamRowProps, SectionTypes.teams>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport const ConversationFilters = () => {\n const styles = useStyles()\n const { setScrollOffset, params } = useContext(FilterContext)\n const { chat_group_graph_id, group_source_app_name = '' } = params\n\n const activeFilter: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const { groups = [] } = useGroupsToFilter()\n const { teams = [] } = useTeamsToFilter()\n\n const activeGroupId = chat_group_graph_id\n const isExactGroupFilter = activeFilter === FilterTypes.More\n\n const teamItems: DataItem<TeamRowProps, SectionTypes.teams>[] = teams.map(team => ({\n type: SectionTypes.teams,\n data: {\n team,\n isActive: isExactGroupFilter && team.id.toString() === activeGroupId,\n },\n }))\n\n const groupItems: DataItem<GroupRowProps, SectionTypes.groups>[] = groups.map(group => ({\n type: SectionTypes.groups,\n data: {\n group,\n isActive: isExactGroupFilter && group?.id.toString() === activeGroupId,\n },\n }))\n const groupItemData = selectActiveWithFirst(5)(groupItems)\n const teamItemData = selectActiveWithFirst(5)(teamItems)\n\n const hideAppFilters = groupItems.length < 1 || teamItems.length < 1\n\n const listData: SectionListData = [\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.header,\n data: { title: 'General Filters' },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: { filter: FilterTypes.All, isActive: activeFilter === FilterTypes.All },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Groups,\n group_source_app_name: 'groups',\n isActive: activeFilter === FilterTypes.Groups,\n },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Teams,\n group_source_app_name: 'services',\n isActive: activeFilter === FilterTypes.Teams,\n },\n },\n {\n type: groupItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Groups' },\n },\n ...groupItemData,\n {\n type: groupItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'GroupFilters' },\n },\n {\n type: teamItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n },\n ...teamItemData,\n {\n type: teamItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'TeamFilters' },\n },\n ]\n\n return (\n <FlatList\n data={listData}\n contentContainerStyle={styles.flatlistContainer}\n nestedScrollEnabled={true}\n onScroll={e => setScrollOffset(e.nativeEvent.contentOffset.y)}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return <Header {...item.data} />\n case SectionTypes.filter:\n return <FilterRow {...item.data} />\n case SectionTypes.groups:\n return <GroupRow {...item.data} />\n case SectionTypes.teams:\n return <TeamRow {...item.data} />\n case SectionTypes.more:\n return <ViewMore {...item.data} />\n default:\n return null\n }\n }}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n flatlistContainer: {\n paddingBottom: Platform.select({\n ios: 64 + bottom,\n android: 16 + bottom,\n }),\n },\n section: {},\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 24,\n paddingBottom: 8,\n paddingHorizontal: 16,\n },\n selectTeamsButton: {},\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n\ntype HeaderProps = {\n title: string\n}\n\nconst Header = ({ title }: HeaderProps) => {\n const styles = useStyles()\n\n return (\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">{title}</Heading>\n </View>\n )\n}\n\ntype GroupSectionType =\n | DataItem<TeamRowProps, SectionTypes.teams>\n | DataItem<GroupRowProps, SectionTypes.groups>\n\nconst selectActiveWithFirst =\n (number: number) =>\n <T extends GroupSectionType>(groups: T[]): T[] => {\n const activeGroupIndex = groups.findIndex(group => group.data.isActive)\n const activeGroup = groups[activeGroupIndex]\n\n if (!activeGroup || activeGroupIndex <= number) {\n return groups.slice(0, number)\n }\n\n return [activeGroup, ...groups].slice(0, number)\n }\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_filters.js","sourceRoot":"","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YACN,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAMD,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAe,EAAE,EAAE;IACxC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAChC;MAAA,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CACxC;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAMD,MAAM,qBAAqB,GACzB,CAAC,MAAc,EAAE,EAAE,CACnB,CAA6B,MAAW,EAAO,EAAE;IAC/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvE,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAE5C,IAAI,CAAC,WAAW,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { Platform, StyleSheet, View, ViewStyle } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading } from '../../../components'\nimport { useTheme } from '../../../hooks'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'\nimport {\n FilterProps,\n FilterRow,\n GroupRow,\n GroupRowProps,\n TeamRow,\n TeamRowProps,\n ViewMore,\n ViewMoreRowProps,\n} from './rows'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n filter,\n groups,\n header,\n hidden,\n more,\n teams,\n}\n\ntype SectionListData = Array<\n | DataItem<FilterProps, SectionTypes.filter>\n | DataItem<GroupRowProps, SectionTypes.groups>\n | DataItem<HeaderProps, SectionTypes.header>\n | DataItem<any, SectionTypes.hidden>\n | DataItem<ViewMoreRowProps, SectionTypes.more>\n | DataItem<TeamRowProps, SectionTypes.teams>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport const ConversationFilters = () => {\n const styles = useStyles()\n const { setScrollOffset, params } = useContext(FilterContext)\n const { chat_group_graph_id, group_source_app_name = '' } = params\n\n const activeFilter: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const { groups = [] } = useGroupsToFilter()\n const { teams = [] } = useTeamsToFilter()\n\n const activeGroupId = chat_group_graph_id\n const isExactGroupFilter = activeFilter === FilterTypes.More\n\n const teamItems: DataItem<TeamRowProps, SectionTypes.teams>[] = teams.map(team => ({\n type: SectionTypes.teams,\n data: {\n team,\n isActive: isExactGroupFilter && team.id.toString() === activeGroupId,\n },\n }))\n\n const groupItems: DataItem<GroupRowProps, SectionTypes.groups>[] = groups.map(group => ({\n type: SectionTypes.groups,\n data: {\n group,\n isActive: isExactGroupFilter && group?.id.toString() === activeGroupId,\n },\n }))\n const groupItemData = selectActiveWithFirst(5)(groupItems)\n const teamItemData = selectActiveWithFirst(5)(teamItems)\n\n const hideAppFilters = groupItems.length < 1 || teamItems.length < 1\n\n const listData: SectionListData = [\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.header,\n data: { title: 'General Filters' },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: { filter: FilterTypes.All, isActive: activeFilter === FilterTypes.All },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Groups,\n group_source_app_name: 'groups',\n isActive: activeFilter === FilterTypes.Groups,\n },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Teams,\n group_source_app_name: 'services',\n isActive: activeFilter === FilterTypes.Teams,\n },\n },\n {\n type: groupItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Groups' },\n },\n ...groupItemData,\n {\n type: groupItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'GroupFilters' },\n },\n {\n type: teamItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n },\n ...teamItemData,\n {\n type: teamItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'TeamFilters' },\n },\n ]\n\n return (\n <FlatList\n data={listData}\n contentContainerStyle={styles.flatlistContainer}\n nestedScrollEnabled={true}\n onScroll={e => setScrollOffset(e.nativeEvent.contentOffset.y)}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return <Header {...item.data} />\n case SectionTypes.filter:\n return <FilterRow {...item.data} />\n case SectionTypes.groups:\n return <GroupRow {...item.data} />\n case SectionTypes.teams:\n return <TeamRow {...item.data} />\n case SectionTypes.more:\n return <ViewMore {...item.data} />\n default:\n return null\n }\n }}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n flatlistContainer: {\n paddingBottom: Platform.select({\n ios: 64 + bottom,\n android: 16 + bottom,\n }),\n },\n section: {},\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 24,\n paddingBottom: 8,\n paddingHorizontal: 16,\n },\n selectTeamsButton: {},\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n\ntype HeaderProps = {\n title: string\n}\n\nconst Header = ({ title }: HeaderProps) => {\n const styles = useStyles()\n\n return (\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">{title}</Heading>\n </View>\n )\n}\n\ntype GroupSectionType =\n | DataItem<TeamRowProps, SectionTypes.teams>\n | DataItem<GroupRowProps, SectionTypes.groups>\n\nconst selectActiveWithFirst =\n (number: number) =>\n <T extends GroupSectionType>(groups: T[]): T[] => {\n const activeGroupIndex = groups.findIndex(group => group.data.isActive)\n const activeGroup = groups[activeGroupIndex]\n\n if (!activeGroup || activeGroupIndex <= number) {\n return groups.slice(0, number)\n }\n\n return [activeGroup, ...groups].slice(0, number)\n }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"group_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAM5D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,CAAA;AAElF,eAAO,MAAM,YAAY,yBAkBxB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { RefreshControl, StyleSheet } from 'react-native';
|
|
3
|
+
import { FlatList } from 'react-native-gesture-handler';
|
|
3
4
|
import { Text } from '../../components/display';
|
|
4
5
|
import { useGroupsToFilter } from './hooks/filters';
|
|
5
6
|
import { GroupRow } from './components/rows';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"group_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIlE,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACrC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAA;IACtC,OAAO,CACL,CAAC,QAAQ,CACP,IAAI,CAAC,CAAC,MAAM,CAAC,CACb,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACxB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC,EAAG,CACjF,CAAC,CACF,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CACrD,UAAU,CAAC,CAAC,YAAY,CAAC,CACzB,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAG,CAAC,CACjF,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CACpC,qBAAqB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EACxC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,aAAa,EAAE,MAAM,GAAG,EAAE;SAC3B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { RefreshControl, StyleSheet } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Text } from '../../components/display'\nimport { ConversationFiltersParams } from './screen_props'\nimport { StaticScreenProps } from '@react-navigation/native'\nimport { useGroupsToFilter } from './hooks/filters'\nimport { GroupRow } from './components/rows'\nimport { useFilterContext } from './context/conversation_filter_context'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\n\nexport type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>\n\nexport const GroupFilters = () => {\n const styles = useStyles()\n const { groups, fetchNextPage, isRefetching, refetch } = useGroupsToFilter()\n const { params } = useFilterContext()\n const { chat_group_graph_id } = params\n return (\n <FlatList\n data={groups}\n renderItem={({ item }) => (\n <GroupRow group={item} isActive={item?.id.toString() === chat_group_graph_id} />\n )}\n ListEmptyComponent={<Text>No groups available</Text>}\n refreshing={isRefetching}\n refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}\n onEndReached={() => fetchNextPage()}\n contentContainerStyle={styles.container}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n paddingBottom: bottom + 12,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"team_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAG1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,CAAA;AAElF,eAAO,MAAM,WAAW,yBAkBvB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { RefreshControl, StyleSheet } from 'react-native';
|
|
3
|
+
import { FlatList } from 'react-native-gesture-handler';
|
|
3
4
|
import { Text } from '../../components/display';
|
|
4
5
|
import { TeamRow } from './components/rows';
|
|
5
6
|
import { useFilterContext } from './context/conversation_filter_context';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"team_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIlE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACrC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAA;IACtC,OAAO,CACL,CAAC,QAAQ,CACP,IAAI,CAAC,CAAC,KAAK,CAAC,CACZ,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACxB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,mBAAmB,CAAC,EAAG,CAC/E,CAAC,CACF,UAAU,CAAC,CAAC,YAAY,CAAC,CACzB,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAG,CAAC,CACjF,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CACpD,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CACpC,qBAAqB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EACxC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,aAAa,EAAE,MAAM,GAAG,EAAE;SAC3B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { RefreshControl, StyleSheet } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Text } from '../../components/display'\nimport { TeamRow } from './components/rows'\nimport { useFilterContext } from './context/conversation_filter_context'\nimport { useTeamsToFilter } from './hooks/filters'\nimport { ConversationFiltersParams } from './screen_props'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\n\nexport type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>\n\nexport const TeamFilters = () => {\n const styles = useStyles()\n const { teams, fetchNextPage, isRefetching, refetch } = useTeamsToFilter()\n const { params } = useFilterContext()\n const { chat_group_graph_id } = params\n return (\n <FlatList\n data={teams}\n renderItem={({ item }) => (\n <TeamRow team={item} isActive={item?.id.toString() === chat_group_graph_id} />\n )}\n refreshing={isRefetching}\n refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}\n ListEmptyComponent={<Text>No teams available</Text>}\n onEndReached={() => fetchNextPage()}\n contentContainerStyle={styles.container}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n return StyleSheet.create({\n container: {\n paddingBottom: bottom + 12,\n },\n })\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { ConversationFiltersScreenProps } from './conversation_filters/screen_props';
|
|
4
|
-
export declare const ConversationFiltersScreenOptions: NativeStackNavigationOptions;
|
|
3
|
+
export declare const ConversationFiltersScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
5
4
|
export declare const ConversationFiltersScreen: (_props: ConversationFiltersScreenProps) => React.JSX.Element;
|
|
6
5
|
//# sourceMappingURL=conversation_filters_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AAI5C,eAAO,MAAM,gCAAgC,uEAO3C,CAAA;AAoCF,eAAO,MAAM,yBAAyB,WAAY,8BAA8B,sBAW/E,CAAA"}
|