@planningcenter/chat-react-native 3.14.0-rc.4 → 3.14.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/empty_conversation_blank_state.d.ts.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +10 -2
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +7 -2
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +2 -1
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/badge.js +5 -5
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/index.d.ts +0 -1
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +0 -1
- package/build/components/display/index.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +4 -4
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +2 -2
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/text.d.ts +10 -2
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +0 -3
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +2 -2
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/page/error_boundary.d.ts.map +1 -1
- package/build/components/page/error_boundary.js +11 -46
- package/build/components/page/error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +14 -6
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts +41 -0
- package/build/components/primitive/blank_state_primitive.d.ts.map +1 -0
- package/build/components/primitive/blank_state_primitive.js +93 -0
- package/build/components/primitive/blank_state_primitive.js.map +1 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +6 -6
- package/build/navigation/index.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +17 -11
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +3 -3
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +8 -2
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +2 -2
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +8 -7
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +13 -3
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +2 -1
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +2 -2
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.js +13 -8
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +10 -5
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/utils/styles.d.ts +1 -0
- package/build/utils/styles.d.ts.map +1 -1
- package/build/utils/styles.js +1 -0
- package/build/utils/styles.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/empty_conversation_blank_state.tsx +10 -6
- package/src/components/conversations/conversations.tsx +7 -2
- package/src/components/display/action_button.tsx +2 -0
- package/src/components/display/badge.tsx +5 -5
- package/src/components/display/index.ts +0 -1
- package/src/components/display/platform_modal_header_buttons.tsx +6 -6
- package/src/components/display/text.tsx +30 -2
- package/src/components/display/toggle_button.tsx +6 -2
- package/src/components/page/error_boundary.tsx +16 -47
- package/src/components/primitive/avatar_primitive.tsx +14 -6
- package/src/components/primitive/blank_state_primitive.tsx +211 -0
- package/src/navigation/index.tsx +6 -6
- package/src/screens/bug_report_screen.tsx +22 -20
- package/src/screens/conversation_details_screen.tsx +13 -4
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +11 -2
- package/src/screens/conversation_new/components/filter_by_plan.tsx +2 -2
- package/src/screens/conversation_screen.tsx +13 -11
- package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +17 -6
- package/src/screens/conversations/components/list_header_component.tsx +6 -1
- package/src/screens/conversations/conversations_screen.tsx +6 -2
- package/src/screens/design_system_screen.tsx +17 -13
- package/src/screens/send_giphy_screen.tsx +10 -11
- package/src/utils/styles.ts +1 -0
- package/build/components/display/blank_state.d.ts +0 -18
- package/build/components/display/blank_state.d.ts.map +0 -1
- package/build/components/display/blank_state.js +0 -47
- package/build/components/display/blank_state.js.map +0 -1
- package/build/navigation/header.d.ts +0 -10
- package/build/navigation/header.d.ts.map +0 -1
- package/build/navigation/header.js +0 -16
- package/build/navigation/header.js.map +0 -1
- package/src/components/display/blank_state.tsx +0 -76
- package/src/navigation/header.tsx +0 -24
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useCallback, useLayoutEffect, useState } from 'react';
|
|
2
2
|
import { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview,
|
|
4
|
+
import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview, Icon, KeyboardView, } from '../components';
|
|
5
|
+
import BlankState from '../components/primitive/blank_state_primitive';
|
|
5
6
|
import { useTheme } from '../hooks';
|
|
6
7
|
import { useUploadClient } from '../hooks/use_upload_client';
|
|
7
8
|
import { ImagePicker, platformFontWeightBold } from '../utils';
|
|
8
9
|
import { useReportBugAction } from '../hooks/use_report_bug_action';
|
|
9
|
-
import {
|
|
10
|
+
import { HeaderDismissButton, HeaderTextButton, } from '../components/display/platform_modal_header_buttons';
|
|
10
11
|
import { DefaultLoading } from '../components/page/loading';
|
|
11
12
|
import { startsWith } from 'lodash';
|
|
12
13
|
import { VideoAttachmentPreview } from '../components/display/video_attachment_preview';
|
|
@@ -25,7 +26,7 @@ const BUG_TYPE_OPTIONS = [
|
|
|
25
26
|
export const BugReportScreenOptions = ({ navigation, }) => ({
|
|
26
27
|
presentation: 'modal',
|
|
27
28
|
title: 'Report a bug',
|
|
28
|
-
headerLeft: () => <
|
|
29
|
+
headerLeft: () => <HeaderDismissButton title="Cancel" onPress={() => navigation.goBack()}/>,
|
|
29
30
|
});
|
|
30
31
|
export function BugReportScreen() {
|
|
31
32
|
const styles = useStyles();
|
|
@@ -111,7 +112,7 @@ ${stepsToResolve}`;
|
|
|
111
112
|
useLayoutEffect(() => {
|
|
112
113
|
navigation.setOptions({
|
|
113
114
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
114
|
-
headerRight: () => (<
|
|
115
|
+
headerRight: () => (<HeaderTextButton title="Submit" onPress={handleSubmit} disabled={!formValid}/>),
|
|
115
116
|
});
|
|
116
117
|
}, [formValid, handleSubmit, navigation]);
|
|
117
118
|
if (status === 'pending') {
|
|
@@ -120,12 +121,17 @@ ${stepsToResolve}`;
|
|
|
120
121
|
</View>);
|
|
121
122
|
}
|
|
122
123
|
if (status === 'success') {
|
|
123
|
-
return (<BlankState
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
return (<BlankState.Root>
|
|
125
|
+
<BlankState.Imagery name="general.checkCircle" style={styles.successIcon}/>
|
|
126
|
+
<BlankState.Content>
|
|
127
|
+
<BlankState.Heading style={styles.successTitle}>Thank you!</BlankState.Heading>
|
|
128
|
+
<BlankState.Text style={styles.successSubtitle}>
|
|
129
|
+
We appreciate you taking the time to help improve chat! We'll take a look at the issue
|
|
130
|
+
you reported.
|
|
131
|
+
</BlankState.Text>
|
|
132
|
+
</BlankState.Content>
|
|
133
|
+
<BlankState.Button title="Return to chat" onPress={navigation.goBack} size="lg" variant="fill"/>
|
|
134
|
+
</BlankState.Root>);
|
|
129
135
|
}
|
|
130
136
|
if (status === 'error') {
|
|
131
137
|
return (<View style={styles.container}>
|
|
@@ -162,7 +168,7 @@ ${stepsToResolve}`;
|
|
|
162
168
|
<SafeAreaModal visible={showBugTypePicker} animationType="slide" presentationStyle="pageSheet" onRequestClose={() => setShowBugTypePicker(false)}>
|
|
163
169
|
<View style={styles.modalContainer}>
|
|
164
170
|
<View style={styles.modalHeader}>
|
|
165
|
-
<
|
|
171
|
+
<HeaderDismissButton title="Cancel" onPress={() => setShowBugTypePicker(false)}/>
|
|
166
172
|
<Text style={styles.modalTitle}>Select Bug Type</Text>
|
|
167
173
|
<View style={styles.modalHeaderSpacer}/>
|
|
168
174
|
</View>
|
|
@@ -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,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAKjG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,IA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AE,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 { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } 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 { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\nimport { SafeAreaModal } from '../components/safe_area_modal'\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 <SafeAreaModal\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 </SafeAreaModal>\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 return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: 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
|
+
{"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,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAKjG,OAAO,EAAE,aAA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AuB;YACrC,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,KAAK;YACxB,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,YAAY,EAAE,CAAC;YACf,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;YACnB,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,iBAAiB,EAAE;YACjB,GAAG,EAAE,CAAC;SACP;QACD,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 { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } 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 Icon,\n KeyboardView,\n} from '../components'\nimport BlankState from '../components/primitive/blank_state_primitive'\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 HeaderDismissButton,\n HeaderTextButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\nimport { SafeAreaModal } from '../components/safe_area_modal'\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: () => <HeaderDismissButton 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 <HeaderTextButton 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.Root>\n <BlankState.Imagery name=\"general.checkCircle\" style={styles.successIcon} />\n <BlankState.Content>\n <BlankState.Heading style={styles.successTitle}>Thank you!</BlankState.Heading>\n <BlankState.Text style={styles.successSubtitle}>\n We appreciate you taking the time to help improve chat! We'll take a look at the issue\n you reported.\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Return to chat\"\n onPress={navigation.goBack}\n size=\"lg\"\n variant=\"fill\"\n />\n </BlankState.Root>\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 <SafeAreaModal\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 <HeaderDismissButton 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 </SafeAreaModal>\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 return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: 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_details_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAQN,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_details_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAQN,MAAM,OAAO,CAAA;AAwEd,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,qBAwSlF"}
|
|
@@ -2,11 +2,11 @@ import { StackActions, useNavigation } from '@react-navigation/native';
|
|
|
2
2
|
import React, { useCallback, useEffect, useState, useRef, } from 'react';
|
|
3
3
|
import { StyleSheet, TextInput, View, Pressable, Alert, Platform, } from 'react-native';
|
|
4
4
|
import { HeaderTitle as ElementsHeaderTitle } from '@react-navigation/elements';
|
|
5
|
-
import { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components';
|
|
5
|
+
import { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton, } from '../components';
|
|
6
6
|
import { useSuspensePaginator, useTheme } from '../hooks';
|
|
7
7
|
import { useConversation, useConversationDelete, useConversationDisableReplies, useConversationMute, useConversationUpdate, } from '../hooks/use_conversation';
|
|
8
8
|
import { isDefined } from '../types';
|
|
9
|
-
import {
|
|
9
|
+
import { HeaderTextButton } from '../components/display/platform_modal_header_buttons';
|
|
10
10
|
import { FlashList } from '@shopify/flash-list';
|
|
11
11
|
import { tokens } from '../vendor/tapestry/tokens';
|
|
12
12
|
// =========================================
|
|
@@ -103,7 +103,7 @@ export function ConversationDetailsScreen({ route }) {
|
|
|
103
103
|
</View>);
|
|
104
104
|
}, [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]);
|
|
105
105
|
const HeaderRight = useCallback(() => {
|
|
106
|
-
return (<
|
|
106
|
+
return (<HeaderTextButton onPress={() => {
|
|
107
107
|
saveTitle({ title: trimmedTitle || conversation.title });
|
|
108
108
|
navigation.goBack();
|
|
109
109
|
}} title="Done"/>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EAIJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAoB,MAAM,4BAA4B,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAkB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E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type TextStyle,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'\nimport { useSuspensePaginator, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderSubmitButton } from '../components/display/platform_modal_header_buttons'\nimport { FlashList } from '@shopify/flash-list'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n loadingMembers,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<any, SectionTypes.loadingMembers>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const {\n data: members,\n fetchNextPage: fetchNextPageOfMembers,\n isFetchingNextPage: isLoadingMembers,\n } = useSuspensePaginator<MemberResource>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const loadingMemberItems = isLoadingMembers\n ? [\n {\n type: SectionTypes.loadingMembers,\n data: {},\n sectionInnerStyle: styles.sectionInnerFirstMember,\n },\n ]\n : []\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle maxFontSizeMultiplier={1} {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n maxFontSizeMultiplier={1}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderSubmitButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n title=\"Done\"\n />\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze conversation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ...loadingMemberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.loadingMembers:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Text>Loading more...</Text>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n onEndReached={fetchNextPageOfMembers}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <View style={styles.inputValidationContainer}>\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n </View>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = 4\n const sectionBorderRadius = 8\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n },\n contentContainer: {\n padding: 16,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n backgroundColor: colors.surfaceColor100,\n borderTopLeftRadius: isStart ? sectionBorderRadius : 0,\n borderTopRightRadius: isStart ? sectionBorderRadius : 0,\n borderBottomLeftRadius: isEnd ? sectionBorderRadius : 0,\n borderBottomRightRadius: isEnd ? sectionBorderRadius : 0,\n marginBottom: isEnd ? 16 : 0,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingTop: isStart ? 16 : 12,\n paddingBottom: isEnd ? 16 : 12,\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: 16,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: 12, // paddingVertical doesn't override the sectionInner padding\n paddingBottom: 12,\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: 12,\n },\n sectionInnerFirstMember: {\n paddingTop: 12,\n paddingBottom: 12,\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: 16,\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationContainer: {\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.statusErrorBorder,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EAGJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAoB,MAAM,4BAA4B,CAAA;AACjG,OAAO,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAU,GAEX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EACL,eAA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,CAAC;YACN,QAAQ,EAAE,MAAM;SACjB;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport {\n Badge,\n ChildNotice,\n Heading,\n Icon,\n Person,\n Switch,\n Text,\n TextButton,\n type TextStyle,\n} from '../components'\nimport { useSuspensePaginator, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderTextButton } from '../components/display/platform_modal_header_buttons'\nimport { FlashList } from '@shopify/flash-list'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n loadingMembers,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<any, SectionTypes.loadingMembers>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const {\n data: members,\n fetchNextPage: fetchNextPageOfMembers,\n isFetchingNextPage: isLoadingMembers,\n } = useSuspensePaginator<MemberResource>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const loadingMemberItems = isLoadingMembers\n ? [\n {\n type: SectionTypes.loadingMembers,\n data: {},\n sectionInnerStyle: styles.sectionInnerFirstMember,\n },\n ]\n : []\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle maxFontSizeMultiplier={1} {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n maxFontSizeMultiplier={1}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderTextButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n title=\"Done\"\n />\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze conversation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ...loadingMemberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.loadingMembers:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Text>Loading more...</Text>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n onEndReached={fetchNextPageOfMembers}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <View style={styles.inputValidationContainer}>\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n </View>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = 4\n const sectionBorderRadius = 8\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n },\n contentContainer: {\n padding: 16,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n backgroundColor: colors.surfaceColor100,\n borderTopLeftRadius: isStart ? sectionBorderRadius : 0,\n borderTopRightRadius: isStart ? sectionBorderRadius : 0,\n borderBottomLeftRadius: isEnd ? sectionBorderRadius : 0,\n borderBottomRightRadius: isEnd ? sectionBorderRadius : 0,\n marginBottom: isEnd ? 16 : 0,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingTop: isStart ? 16 : 12,\n paddingBottom: isEnd ? 16 : 12,\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: 16,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: 12, // paddingVertical doesn't override the sectionInner padding\n paddingBottom: 12,\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: 12,\n },\n sectionInnerFirstMember: {\n paddingTop: 12,\n paddingBottom: 12,\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: 16,\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationContainer: {\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.statusErrorBorder,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAa7D,OAAO,EAAE,uCAAuC,EAAiC,MAAM,SAAS,CAAA;AAMhG,eAAO,MAAM,0CAA0C,uEAMrD,CAAA;AAEF,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAwHzC,CAAA"}
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js
CHANGED
|
@@ -3,7 +3,8 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
3
3
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { FlatList, TextInput } from 'react-native-gesture-handler';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
-
import {
|
|
6
|
+
import { Heading, ToggleButton } from '../../components';
|
|
7
|
+
import BlankState from '../../components/primitive/blank_state_primitive';
|
|
7
8
|
import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
|
|
8
9
|
import { useTheme } from '../../hooks';
|
|
9
10
|
import { tokens } from '../../vendor/tapestry/tokens';
|
|
@@ -79,7 +80,7 @@ export const ConversationFilterRecipientsScreen = ({ route, }) => {
|
|
|
79
80
|
Service Types
|
|
80
81
|
</Heading>} contentContainerStyle={[styles.listContentContainer, listContainerStyle]} keyExtractor={item => item.type === SectionTypes.header
|
|
81
82
|
? `service-type-${item.data.serviceTypeId}`
|
|
82
|
-
: `team-${item.data.teamId}-${item.data.serviceTypeId}`} ListEmptyComponent={isFetched ? <
|
|
83
|
+
: `team-${item.data.teamId}-${item.data.serviceTypeId}`} ListEmptyComponent={isFetched ? <ListBlankState /> : <DefaultLoading />} renderItem={({ item }) => {
|
|
83
84
|
switch (item.type) {
|
|
84
85
|
case SectionTypes.header:
|
|
85
86
|
return (<HeaderRow data={item.data} style={item.sectionStyle} nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`} setTeamFilters={setTeamFilters}/>);
|
|
@@ -91,6 +92,11 @@ export const ConversationFilterRecipientsScreen = ({ route, }) => {
|
|
|
91
92
|
}}/>
|
|
92
93
|
</FormSheet.Root>);
|
|
93
94
|
};
|
|
95
|
+
const ListBlankState = () => {
|
|
96
|
+
return (<BlankState.Root>
|
|
97
|
+
<BlankState.Heading>No teams found</BlankState.Heading>
|
|
98
|
+
</BlankState.Root>);
|
|
99
|
+
};
|
|
94
100
|
const TeamFilters = ({ onLayout }) => {
|
|
95
101
|
const styles = useStyles();
|
|
96
102
|
const { colors } = useTheme();
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAE3F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAqB,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,wCAAwC,EAAE,MAAM,yDAAyD,CAAA;AAClH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAC/E,OAAO,EAA2C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAChG,OAAO,EAAE,cAAc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AE,MAAM,CAAC,cAAc;YAC9C,qBAAqB,EAAE,MAAM,CAAC,cAAc;YAC5C,YAAY,EAAE,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;SACjD;QACD,qBAAqB,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,WAAW,EAAE;YACX,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,iBAAiB,EAAE,QAAQ;YAC3B,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native'\nimport { FlatList, TextInput } from 'react-native-gesture-handler'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { BlankState, Heading, ToggleButton } from '../../components'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { HeaderRow } from './components/header_row'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes, TeamFilterTypes } from './types'\nimport { DefaultLoading } from '../../components/page/loading'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\nconst SPACE_UNDER_ROW = 16\n\nexport const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n headerTitle: 'Teams I lead',\n})\n\nexport const ConversationFilterRecipientsScreen = ({\n route,\n}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n\n // Set the height of the container to accommodate the team filters\n const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(200)\n const { bottom } = useSafeAreaInsets()\n const listContainerStyle = useMemo(\n () =>\n Platform.select({\n ios: { paddingBottom: formSheetHeaderHeight + bottom + SPACE_UNDER_ROW },\n }),\n [formSheetHeaderHeight, bottom]\n )\n\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const { team_ids: teamIds } = route.params\n const { params } = route\n const teamIdCount = Number(teamIds?.length)\n const headerTitle = useMemo(() => {\n return teamIdCount >= 1 ? `Selected teams (${teamIdCount})` : 'Select teams'\n }, [teamIdCount])\n\n const { serviceTypes, isFetched } = useServiceTypesWithTeams({\n filterType: params.team_filter_type,\n searchQuery: params.search_query,\n })\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n const setTeamFilters = useCallback(\n ({ team_ids }: { team_ids: number[] }) => {\n navigation.setParams({ team_ids })\n },\n [navigation]\n )\n\n const resetTeamFilters = useCallback(() => {\n navigation.goBack()\n }, [navigation])\n\n const applyTeamFilters = useCallback(() => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n }, [navigation, params])\n\n const handleFormSheetHeaderLayout = useCallback((event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n }, [])\n\n return (\n <FormSheet.Root style={styles.root}>\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={applyTeamFilters}\n disabled={noTeamsSelected}\n />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <TeamFilters />\n </View>\n <FlatList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n contentContainerStyle={[styles.listContentContainer, listContainerStyle]}\n keyExtractor={item =>\n item.type === SectionTypes.header\n ? `service-type-${item.data.serviceTypeId}`\n : `team-${item.data.teamId}-${item.data.serviceTypeId}`\n }\n ListEmptyComponent={isFetched ? <BlankState title=\"No teams found\" /> : <DefaultLoading />}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n default:\n return null\n }\n }}\n />\n </FormSheet.Root>\n )\n}\n\nconst TeamFilters = ({ onLayout }: { onLayout?: (event: LayoutChangeEvent) => void }) => {\n const styles = useStyles()\n const { colors } = useTheme()\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { params } = route\n\n const active = params.team_filter_type || TeamFilterTypes.TeamsIlead\n\n const handleFilterChange = useCallback(\n (filter: TeamFilterTypes) => {\n navigation.setParams({\n team_filter_type: filter,\n team_ids: [],\n })\n },\n [navigation]\n )\n\n return (\n <View style={styles.teamFiltersContainer} onLayout={onLayout}>\n <TextInput\n defaultValue={params.search_query}\n placeholder=\"Search teams\"\n placeholderTextColor={colors.textColorDefaultPlaceholder}\n style={styles.searchInput}\n onChangeText={text => {\n navigation.setParams({\n search_query: text,\n })\n }}\n />\n <View style={styles.filterToggleContainer}>\n <ToggleButton\n active={active === TeamFilterTypes.TeamsIlead}\n title={TeamFilterTypes.TeamsIlead}\n accessibilityLabel=\"Show all teams I lead\"\n onPress={() => handleFilterChange(TeamFilterTypes.TeamsIlead)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.MyTeams}\n title={TeamFilterTypes.MyTeams}\n accessibilityLabel=\"Show all my teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.MyTeams)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.All}\n title={TeamFilterTypes.All}\n accessibilityLabel=\"Show all teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.All)}\n />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n root: {\n backgroundColor: colors.surfaceColor080,\n },\n header: {\n borderBottomWidth: 0,\n },\n listContentContainer: {\n padding: 16,\n paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: SPACE_UNDER_ROW,\n },\n teamFiltersContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingBottom: 28,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n filterToggleContainer: {\n flexDirection: 'row',\n gap: 8,\n },\n searchInput: {\n paddingVertical: 16,\n paddingHorizontal: 16,\n color: colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n fontSize: 16,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 24,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAE3F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAqB,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,UAAU,MAAM,kDAAkD,CAAA;AACzE,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,O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ions, useNavigation, useRoute } from '@react-navigation/native'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native'\nimport { FlatList, TextInput } from 'react-native-gesture-handler'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading, ToggleButton } from '../../components'\nimport BlankState from '../../components/primitive/blank_state_primitive'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { HeaderRow } from './components/header_row'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes, TeamFilterTypes } from './types'\nimport { DefaultLoading } from '../../components/page/loading'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\nconst SPACE_UNDER_ROW = 16\n\nexport const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n headerTitle: 'Teams I lead',\n})\n\nexport const ConversationFilterRecipientsScreen = ({\n route,\n}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n\n // Set the height of the container to accommodate the team filters\n const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(200)\n const { bottom } = useSafeAreaInsets()\n const listContainerStyle = useMemo(\n () =>\n Platform.select({\n ios: { paddingBottom: formSheetHeaderHeight + bottom + SPACE_UNDER_ROW },\n }),\n [formSheetHeaderHeight, bottom]\n )\n\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const { team_ids: teamIds } = route.params\n const { params } = route\n const teamIdCount = Number(teamIds?.length)\n const headerTitle = useMemo(() => {\n return teamIdCount >= 1 ? `Selected teams (${teamIdCount})` : 'Select teams'\n }, [teamIdCount])\n\n const { serviceTypes, isFetched } = useServiceTypesWithTeams({\n filterType: params.team_filter_type,\n searchQuery: params.search_query,\n })\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n const setTeamFilters = useCallback(\n ({ team_ids }: { team_ids: number[] }) => {\n navigation.setParams({ team_ids })\n },\n [navigation]\n )\n\n const resetTeamFilters = useCallback(() => {\n navigation.goBack()\n }, [navigation])\n\n const applyTeamFilters = useCallback(() => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n }, [navigation, params])\n\n const handleFormSheetHeaderLayout = useCallback((event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n }, [])\n\n return (\n <FormSheet.Root style={styles.root}>\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={applyTeamFilters}\n disabled={noTeamsSelected}\n />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <TeamFilters />\n </View>\n <FlatList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n contentContainerStyle={[styles.listContentContainer, listContainerStyle]}\n keyExtractor={item =>\n item.type === SectionTypes.header\n ? `service-type-${item.data.serviceTypeId}`\n : `team-${item.data.teamId}-${item.data.serviceTypeId}`\n }\n ListEmptyComponent={isFetched ? <ListBlankState /> : <DefaultLoading />}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n default:\n return null\n }\n }}\n />\n </FormSheet.Root>\n )\n}\n\nconst ListBlankState = () => {\n return (\n <BlankState.Root>\n <BlankState.Heading>No teams found</BlankState.Heading>\n </BlankState.Root>\n )\n}\n\nconst TeamFilters = ({ onLayout }: { onLayout?: (event: LayoutChangeEvent) => void }) => {\n const styles = useStyles()\n const { colors } = useTheme()\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { params } = route\n\n const active = params.team_filter_type || TeamFilterTypes.TeamsIlead\n\n const handleFilterChange = useCallback(\n (filter: TeamFilterTypes) => {\n navigation.setParams({\n team_filter_type: filter,\n team_ids: [],\n })\n },\n [navigation]\n )\n\n return (\n <View style={styles.teamFiltersContainer} onLayout={onLayout}>\n <TextInput\n defaultValue={params.search_query}\n placeholder=\"Search teams\"\n placeholderTextColor={colors.textColorDefaultPlaceholder}\n style={styles.searchInput}\n onChangeText={text => {\n navigation.setParams({\n search_query: text,\n })\n }}\n />\n <View style={styles.filterToggleContainer}>\n <ToggleButton\n active={active === TeamFilterTypes.TeamsIlead}\n title={TeamFilterTypes.TeamsIlead}\n accessibilityLabel=\"Show all teams I lead\"\n onPress={() => handleFilterChange(TeamFilterTypes.TeamsIlead)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.MyTeams}\n title={TeamFilterTypes.MyTeams}\n accessibilityLabel=\"Show all my teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.MyTeams)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.All}\n title={TeamFilterTypes.All}\n accessibilityLabel=\"Show all teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.All)}\n />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n root: {\n backgroundColor: colors.surfaceColor080,\n },\n header: {\n borderBottomWidth: 0,\n },\n listContentContainer: {\n padding: 16,\n paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: SPACE_UNDER_ROW,\n },\n teamFiltersContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingBottom: 28,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n filterToggleContainer: {\n flexDirection: 'row',\n gap: 8,\n },\n searchInput: {\n paddingVertical: 16,\n paddingHorizontal: 16,\n color: colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n fontSize: 16,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 24,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { StyleSheet, View, FlatList, Platform } from 'react-native';
|
|
3
3
|
import { Header, PlatformPressable } from '@react-navigation/elements';
|
|
4
4
|
import { Banner, Icon, Spinner, Text, Heading } from '../../../components';
|
|
5
|
-
import {
|
|
5
|
+
import { HeaderDismissButton } from '../../../components/display/platform_modal_header_buttons';
|
|
6
6
|
import { useTeamPlans } from '../../../hooks/services/use_team_plans';
|
|
7
7
|
import { useTheme } from '../../../hooks';
|
|
8
8
|
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
@@ -68,7 +68,7 @@ export function FilterByPlanModal({ visible, onClose, teamIds, selectedPlanId, s
|
|
|
68
68
|
// ==========================================
|
|
69
69
|
// Helper Components
|
|
70
70
|
// ==========================================
|
|
71
|
-
const createStableHeaderRight = (onClose) => () => (<
|
|
71
|
+
const createStableHeaderRight = (onClose) => () => (<HeaderDismissButton onPress={onClose} title="Cancel"/>);
|
|
72
72
|
function OptionItem({ plan, isSelected, onPress }) {
|
|
73
73
|
const styles = useStyles();
|
|
74
74
|
return (<PlatformPressable style={styles.optionItem} onPress={onPress} accessibilityRole="radio" accessibilityState={{ selected: isSelected }} accessibilityLabel={plan.name}>
|