@planningcenter/chat-react-native 3.4.0 → 3.4.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +13 -5
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/navigation/index.d.ts +22 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +10 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +8 -0
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +7 -0
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +8 -0
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js +8 -0
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +2 -4
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_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 +37 -9
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +4 -0
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +44 -0
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -0
- package/package.json +2 -2
- package/src/components/conversation/message_form.tsx +22 -10
- package/src/navigation/index.tsx +15 -0
- package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +23 -0
- package/src/screens/conversation_select_recipients/components/team_recipient_row.tsx +23 -0
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +4 -11
- package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +57 -15
- package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +70 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAYlD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAA;AAED,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,YAAY,EAAE,oBAAoB,CAAA;CACnC;
|
|
1
|
+
{"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAYlD,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAA;AAED,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,YAAY,EAAE,oBAAoB,CAAA;CACnC;AAwBD,iBAAS,eAAe,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBAkGzE;AAiCD,iBAAS,gBAAgB,sBAgCxB;AAED,iBAAS,oBAAoB,sBAe5B;AAED,iBAAS,2BAA2B,6BA8EnC;AAED,iBAAS,mBAAmB,6BA6B3B"}
|
|
@@ -24,6 +24,8 @@ const MessageFormContext = React.createContext({
|
|
|
24
24
|
usingGiphy: false,
|
|
25
25
|
setUsingGiphy: (_usingGiphy) => { },
|
|
26
26
|
});
|
|
27
|
+
const GIPHY_MAX_LENGTH = 50;
|
|
28
|
+
const MAX_MESSAGE_LENGTH = 5000;
|
|
27
29
|
function MessageFormRoot({ conversation, children }) {
|
|
28
30
|
const { giphyApiKey } = useContext(ChatContext);
|
|
29
31
|
const canGiphy = !!giphyApiKey;
|
|
@@ -132,12 +134,14 @@ function MessageFormInput() {
|
|
|
132
134
|
const attachmentError = attachmentUploader?.errorMessage;
|
|
133
135
|
return (<View style={styles.textInputBoundary}>
|
|
134
136
|
<MessageFormAttachments />
|
|
135
|
-
<View style={styles.
|
|
137
|
+
<View style={styles.textInputRow}>
|
|
136
138
|
{usingGiphy ? (<View style={styles.giphyBadge}>
|
|
137
139
|
<Text>/Giphy</Text>
|
|
138
140
|
</View>) : null}
|
|
139
141
|
|
|
140
|
-
<
|
|
142
|
+
<View style={styles.textInput}>
|
|
143
|
+
<TextInput multiline={true} aria-disabled={true} placeholder="Send a message" onChangeText={setText} value={text} maxLength={usingGiphy ? GIPHY_MAX_LENGTH : MAX_MESSAGE_LENGTH} onSubmitEditing={onSubmit}/>
|
|
144
|
+
</View>
|
|
141
145
|
</View>
|
|
142
146
|
|
|
143
147
|
{attachmentError ? <Text style={styles.inputErrorMessage}>{attachmentError}</Text> : null}
|
|
@@ -200,14 +204,14 @@ function MessageFormAttachmentPicker() {
|
|
|
200
204
|
</View>);
|
|
201
205
|
}
|
|
202
206
|
function MessageFormCommands() {
|
|
203
|
-
const { canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext);
|
|
207
|
+
const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext);
|
|
204
208
|
if (!canGiphy) {
|
|
205
209
|
return null;
|
|
206
210
|
}
|
|
207
211
|
if (usingGiphy) {
|
|
208
212
|
return (<IconButton accessibilityLabel="Exit Giphy Search" size="md" appearance="neutral" name={'general.x'} onPress={() => setUsingGiphy(false)}/>);
|
|
209
213
|
}
|
|
210
|
-
return (<IconButton accessibilityLabel="Search Giphy" size="md" appearance="neutral" name={'general.bolt'} onPress={() => setUsingGiphy(true)}/>);
|
|
214
|
+
return (<IconButton accessibilityLabel="Search Giphy" size="md" appearance="neutral" name={'general.bolt'} onPress={() => setUsingGiphy(true)} disabled={text.length > GIPHY_MAX_LENGTH}/>);
|
|
211
215
|
}
|
|
212
216
|
const useMessageFormStyles = () => {
|
|
213
217
|
const theme = useTheme();
|
|
@@ -231,10 +235,14 @@ const useMessageFormStyles = () => {
|
|
|
231
235
|
flex: 1,
|
|
232
236
|
gap: 12,
|
|
233
237
|
},
|
|
234
|
-
|
|
238
|
+
textInputRow: {
|
|
235
239
|
flexDirection: 'row',
|
|
240
|
+
alignItems: 'center',
|
|
236
241
|
gap: 12,
|
|
237
242
|
},
|
|
243
|
+
textInput: {
|
|
244
|
+
flex: 1,
|
|
245
|
+
},
|
|
238
246
|
giphyBadge: {
|
|
239
247
|
backgroundColor: theme.colors.fillColorNeutral050Base,
|
|
240
248
|
borderRadius: 24,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_form.js","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAClG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;A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useTheme as useNavigationTheme, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useContext, useEffect, useState } from 'react'\nimport { StyleSheet, TextInput, View, ViewProps } from 'react-native'\nimport { IconButton, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { ConversationResource } from '../../types'\nimport { useMessageCreate } from '../../hooks/use_message_create'\nimport { ConversationScreenProps } from '../../screens/conversation_screen'\nimport { ChatContext } from '../../contexts/chat_context'\nimport { ImagePicker, ImagePickerResult } from '../../utils/native_adapters'\nimport { useAttachmentUploader } from '../../hooks/use_attachment_uploader'\nimport {\n DenormalizedAttachmentResourceForCreate,\n DenormalizedMessageAttachmentResourceForCreate,\n} from '../../types/resources/denormalized_attachment_resource'\nimport { MessageFormAttachmentImage } from './message_form/message_form_attachment_image'\n\nexport const MessageForm = {\n Root: MessageFormRoot,\n TextInput: MessageFormInput,\n SubmitButton: MessageFormSubmitBtn,\n AttachmentPicker: MessageFormAttachmentPicker,\n Commands: MessageFormCommands,\n}\n\ninterface MessagesFormRootProps extends ViewProps {\n conversation: ConversationResource\n}\n\nconst MessageFormContext = React.createContext<{\n text: string\n setText: (text: string) => void\n onSubmit: () => void\n disabled: boolean\n canGiphy: boolean\n usingGiphy: boolean\n setUsingGiphy: (usingGiphy: boolean) => void\n attachmentUploader?: ReturnType<typeof useAttachmentUploader>\n}>({\n text: '',\n setText: (_text: string) => {},\n onSubmit: () => {},\n disabled: false,\n canGiphy: false,\n usingGiphy: false,\n setUsingGiphy: (_usingGiphy: boolean) => {},\n})\n\nfunction MessageFormRoot({ conversation, children }: MessagesFormRootProps) {\n const { giphyApiKey } = useContext(ChatContext)\n const canGiphy = !!giphyApiKey\n const styles = useMessageFormStyles()\n const [text, setText] = React.useState('')\n const [usingGiphy, setUsingGiphy] = useState(false)\n const navigation = useNavigation()\n const route = useRoute() as ConversationScreenProps['route']\n const {\n status,\n isPending,\n reset: resetMutation,\n mutate,\n } = useMessageCreate({\n conversationId: conversation.id,\n })\n const attachmentUploader = useAttachmentUploader({\n conversationId: conversation.id,\n })\n const resetAttachmentUploader = attachmentUploader.reset\n\n const reset = useCallback(() => {\n resetAttachmentUploader()\n resetMutation()\n setText('')\n setUsingGiphy(false)\n }, [resetAttachmentUploader, resetMutation])\n\n useEffect(() => {\n if (canGiphy && !usingGiphy && text.startsWith('/giphy ')) {\n setUsingGiphy(true)\n setText('')\n }\n }, [canGiphy, text, usingGiphy])\n\n useEffect(() => {\n switch (status) {\n case 'success':\n reset()\n break\n }\n }, [reset, status])\n\n useEffect(() => {\n if (route.params.clear_input) {\n reset()\n navigation.setParams({ ...route.params, clear_input: false })\n }\n }, [reset, navigation, route.params])\n\n const canSubmit = (() => {\n if (isPending) return false\n if (attachmentUploader?.pendingUploads) return false\n if (text.length > 0) return true\n if (attachmentUploader?.attachments?.length) return true\n return false\n })()\n const disabled = !canSubmit\n\n const handleSubmit = () => {\n if (!canSubmit) return\n\n if (canGiphy && usingGiphy) {\n TextInput.State.blurTextInput(TextInput.State.currentlyFocusedInput())\n navigation.navigate('SendGiphy', {\n conversation_id: conversation.id,\n search_term: text,\n })\n } else {\n let attachmentsForSubmit: DenormalizedAttachmentResourceForCreate[] = []\n if (attachmentUploader?.attachmentIds) {\n attachmentsForSubmit = attachmentUploader.attachmentIds.map(\n (id: string): DenormalizedMessageAttachmentResourceForCreate => ({\n type: 'MessageAttachment',\n id,\n })\n )\n }\n mutate({ text, attachments: attachmentsForSubmit })\n }\n }\n\n return (\n <MessageFormContext.Provider\n value={{\n text,\n setText,\n onSubmit: handleSubmit,\n disabled,\n canGiphy,\n usingGiphy,\n setUsingGiphy,\n attachmentUploader,\n }}\n >\n <View style={styles.textInputContainer}>{children}</View>\n </MessageFormContext.Provider>\n )\n}\n\nfunction MessageFormAttachments() {\n const styles = useMessageFormStyles()\n const { attachmentUploader } = React.useContext(MessageFormContext)\n const numberOfAttachments = attachmentUploader?.attachments?.length || 0\n const attachments = attachmentUploader?.attachments || []\n\n if (numberOfAttachments === 0) {\n return null\n }\n\n return (\n <View style={styles.messageFormAttachments}>\n {attachments.map(attachment => {\n return (\n <MessageFormAttachmentImage\n key={attachment.file.uri}\n uri={attachment.file.uri}\n alt={attachment.file.name}\n status={attachment.status}\n width={attachment.file.width}\n height={attachment.file.height}\n removeAttachment={() => {\n attachmentUploader?.removeAttachment(attachment)\n }}\n />\n )\n })}\n </View>\n )\n}\n\nfunction MessageFormInput() {\n const styles = useMessageFormStyles()\n const { text, setText, onSubmit, usingGiphy, attachmentUploader } =\n React.useContext(MessageFormContext)\n const attachmentError = attachmentUploader?.errorMessage\n\n return (\n <View style={styles.textInputBoundary}>\n <MessageFormAttachments />\n <View style={styles.textInput}>\n {usingGiphy ? (\n <View style={styles.giphyBadge}>\n <Text>/Giphy</Text>\n </View>\n ) : null}\n\n <TextInput\n aria-disabled={true}\n placeholder=\"Send a message\"\n onChangeText={setText}\n value={text}\n onSubmitEditing={onSubmit}\n />\n </View>\n\n {attachmentError ? <Text style={styles.inputErrorMessage}>{attachmentError}</Text> : null}\n </View>\n )\n}\n\nfunction MessageFormSubmitBtn() {\n const styles = useMessageFormStyles()\n const { onSubmit, disabled, usingGiphy } = React.useContext(MessageFormContext)\n\n return (\n <IconButton\n disabled={disabled}\n accessibilityLabel={usingGiphy ? 'Search Giphy' : 'Send message'}\n size=\"md\"\n appearance=\"neutral\"\n style={styles.textInputSend}\n name={usingGiphy ? 'general.search' : 'general.upArrow'}\n onPress={onSubmit}\n />\n )\n}\n\nfunction MessageFormAttachmentPicker() {\n const styles = useMessageFormStyles()\n const { usingGiphy, attachmentUploader } = React.useContext(MessageFormContext)\n const [isOpen, setIsOpen] = useState(false)\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled) {\n return\n }\n\n const filteredAssets = result.assets\n .filter(asset => {\n return asset.fileSize && asset.fileName && asset.mimeType\n })\n .map(asset => {\n return {\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n size: asset.fileSize as number,\n height: asset.height,\n width: asset.width,\n }\n })\n\n attachmentUploader?.handleFilesAttached(filteredAssets)\n }\n\n const openCamera = async () => {\n setIsOpen(false)\n let result = await ImagePicker.openCameraAsync()\n if (!result.canceled) {\n uploadImagePickerResult(result)\n }\n }\n\n const pickImage = async () => {\n setIsOpen(false)\n let result = await ImagePicker.openImageLibraryAsync()\n if (!result.canceled) {\n uploadImagePickerResult(result)\n }\n }\n\n if (usingGiphy) {\n return null\n }\n\n return (\n // TODO: Design Pass\n <View style={styles.attachmentPicker}>\n {isOpen && (\n <View style={styles.attachmentPickerButtons}>\n <IconButton\n accessibilityLabel=\"Take a photo\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.videoCamera'}\n onPress={openCamera}\n />\n <IconButton\n accessibilityLabel=\"Choose a photo\"\n size=\"md\"\n appearance=\"neutral\"\n name={'churchCenter.photosIos'}\n onPress={pickImage}\n />\n </View>\n )}\n <IconButton\n accessibilityLabel=\"File Menu\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.outlinedPlusCircle'}\n onPress={() => setIsOpen(!isOpen)}\n />\n </View>\n )\n}\n\nfunction MessageFormCommands() {\n const { canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)\n\n if (!canGiphy) {\n return null\n }\n\n if (usingGiphy) {\n return (\n <IconButton\n accessibilityLabel=\"Exit Giphy Search\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.x'}\n onPress={() => setUsingGiphy(false)}\n />\n )\n }\n\n return (\n <IconButton\n accessibilityLabel=\"Search Giphy\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.bolt'}\n onPress={() => setUsingGiphy(true)}\n />\n )\n}\n\nconst useMessageFormStyles = () => {\n const theme = useTheme()\n const navigationTheme = useNavigationTheme()\n\n return StyleSheet.create({\n textInputContainer: {\n borderColor: theme.colors.fillColorNeutral050Base,\n borderTopWidth: 1,\n padding: 12,\n backgroundColor: navigationTheme.colors.card,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n },\n textInputBoundary: {\n borderRadius: 24,\n borderWidth: 1,\n padding: 12,\n paddingHorizontal: 20,\n borderColor: theme.colors.fillColorNeutral050Base,\n flex: 1,\n gap: 12,\n },\n textInput: {\n flexDirection: 'row',\n gap: 12,\n },\n giphyBadge: {\n backgroundColor: theme.colors.fillColorNeutral050Base,\n borderRadius: 24,\n padding: 8,\n paddingHorizontal: 12,\n },\n textInputSend: {\n borderRadius: 24,\n height: 36,\n width: 36,\n },\n attachmentPicker: {\n position: 'relative',\n },\n attachmentPickerButtons: {\n position: 'absolute',\n left: 0,\n bottom: 40,\n zIndex: 10,\n gap: 16,\n },\n messageFormAttachments: {\n flexDirection: 'row',\n gap: 8,\n },\n inputErrorMessage: {\n color: theme.colors.statusErrorText,\n fontSize: 14,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"message_form.js","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAClG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAK3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAA;AAEzF,MAAM,CAAC,M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BAAsB,EAAE;YACtB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;YACnC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useContext, useEffect, useState } from 'react'\nimport { StyleSheet, TextInput, View, ViewProps } from 'react-native'\nimport { IconButton, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { ConversationResource } from '../../types'\nimport { useMessageCreate } from '../../hooks/use_message_create'\nimport { ConversationScreenProps } from '../../screens/conversation_screen'\nimport { ChatContext } from '../../contexts/chat_context'\nimport { ImagePicker, ImagePickerResult } from '../../utils/native_adapters'\nimport { useAttachmentUploader } from '../../hooks/use_attachment_uploader'\nimport {\n DenormalizedAttachmentResourceForCreate,\n DenormalizedMessageAttachmentResourceForCreate,\n} from '../../types/resources/denormalized_attachment_resource'\nimport { MessageFormAttachmentImage } from './message_form/message_form_attachment_image'\n\nexport const MessageForm = {\n Root: MessageFormRoot,\n TextInput: MessageFormInput,\n SubmitButton: MessageFormSubmitBtn,\n AttachmentPicker: MessageFormAttachmentPicker,\n Commands: MessageFormCommands,\n}\n\ninterface MessagesFormRootProps extends ViewProps {\n conversation: ConversationResource\n}\n\nconst MessageFormContext = React.createContext<{\n text: string\n setText: (text: string) => void\n onSubmit: () => void\n disabled: boolean\n canGiphy: boolean\n usingGiphy: boolean\n setUsingGiphy: (usingGiphy: boolean) => void\n attachmentUploader?: ReturnType<typeof useAttachmentUploader>\n}>({\n text: '',\n setText: (_text: string) => {},\n onSubmit: () => {},\n disabled: false,\n canGiphy: false,\n usingGiphy: false,\n setUsingGiphy: (_usingGiphy: boolean) => {},\n})\n\nconst GIPHY_MAX_LENGTH = 50\nconst MAX_MESSAGE_LENGTH = 5000\n\nfunction MessageFormRoot({ conversation, children }: MessagesFormRootProps) {\n const { giphyApiKey } = useContext(ChatContext)\n const canGiphy = !!giphyApiKey\n const styles = useMessageFormStyles()\n const [text, setText] = React.useState('')\n const [usingGiphy, setUsingGiphy] = useState(false)\n const navigation = useNavigation()\n const route = useRoute() as ConversationScreenProps['route']\n const {\n status,\n isPending,\n reset: resetMutation,\n mutate,\n } = useMessageCreate({\n conversationId: conversation.id,\n })\n const attachmentUploader = useAttachmentUploader({\n conversationId: conversation.id,\n })\n const resetAttachmentUploader = attachmentUploader.reset\n\n const reset = useCallback(() => {\n resetAttachmentUploader()\n resetMutation()\n setText('')\n setUsingGiphy(false)\n }, [resetAttachmentUploader, resetMutation])\n\n useEffect(() => {\n if (canGiphy && !usingGiphy && text.startsWith('/giphy ')) {\n setUsingGiphy(true)\n setText('')\n }\n }, [canGiphy, text, usingGiphy])\n\n useEffect(() => {\n switch (status) {\n case 'success':\n reset()\n break\n }\n }, [reset, status])\n\n useEffect(() => {\n if (route.params.clear_input) {\n reset()\n navigation.setParams({ ...route.params, clear_input: false })\n }\n }, [reset, navigation, route.params])\n\n const canSubmit = (() => {\n if (isPending) return false\n if (attachmentUploader?.pendingUploads) return false\n if (text.length > 0) return true\n if (attachmentUploader?.attachments?.length) return true\n return false\n })()\n const disabled = !canSubmit\n\n const handleSubmit = () => {\n if (!canSubmit) return\n\n if (canGiphy && usingGiphy) {\n TextInput.State.blurTextInput(TextInput.State.currentlyFocusedInput())\n navigation.navigate('SendGiphy', {\n conversation_id: conversation.id,\n search_term: text,\n })\n } else {\n let attachmentsForSubmit: DenormalizedAttachmentResourceForCreate[] = []\n if (attachmentUploader?.attachmentIds) {\n attachmentsForSubmit = attachmentUploader.attachmentIds.map(\n (id: string): DenormalizedMessageAttachmentResourceForCreate => ({\n type: 'MessageAttachment',\n id,\n })\n )\n }\n mutate({ text, attachments: attachmentsForSubmit })\n }\n }\n\n return (\n <MessageFormContext.Provider\n value={{\n text,\n setText,\n onSubmit: handleSubmit,\n disabled,\n canGiphy,\n usingGiphy,\n setUsingGiphy,\n attachmentUploader,\n }}\n >\n <View style={styles.textInputContainer}>{children}</View>\n </MessageFormContext.Provider>\n )\n}\n\nfunction MessageFormAttachments() {\n const styles = useMessageFormStyles()\n const { attachmentUploader } = React.useContext(MessageFormContext)\n const numberOfAttachments = attachmentUploader?.attachments?.length || 0\n const attachments = attachmentUploader?.attachments || []\n\n if (numberOfAttachments === 0) {\n return null\n }\n\n return (\n <View style={styles.messageFormAttachments}>\n {attachments.map(attachment => {\n return (\n <MessageFormAttachmentImage\n key={attachment.file.uri}\n uri={attachment.file.uri}\n alt={attachment.file.name}\n status={attachment.status}\n width={attachment.file.width}\n height={attachment.file.height}\n removeAttachment={() => {\n attachmentUploader?.removeAttachment(attachment)\n }}\n />\n )\n })}\n </View>\n )\n}\n\nfunction MessageFormInput() {\n const styles = useMessageFormStyles()\n const { text, setText, onSubmit, usingGiphy, attachmentUploader } =\n React.useContext(MessageFormContext)\n const attachmentError = attachmentUploader?.errorMessage\n\n return (\n <View style={styles.textInputBoundary}>\n <MessageFormAttachments />\n <View style={styles.textInputRow}>\n {usingGiphy ? (\n <View style={styles.giphyBadge}>\n <Text>/Giphy</Text>\n </View>\n ) : null}\n\n <View style={styles.textInput}>\n <TextInput\n multiline={true}\n aria-disabled={true}\n placeholder=\"Send a message\"\n onChangeText={setText}\n value={text}\n maxLength={usingGiphy ? GIPHY_MAX_LENGTH : MAX_MESSAGE_LENGTH}\n onSubmitEditing={onSubmit}\n />\n </View>\n </View>\n\n {attachmentError ? <Text style={styles.inputErrorMessage}>{attachmentError}</Text> : null}\n </View>\n )\n}\n\nfunction MessageFormSubmitBtn() {\n const styles = useMessageFormStyles()\n const { onSubmit, disabled, usingGiphy } = React.useContext(MessageFormContext)\n\n return (\n <IconButton\n disabled={disabled}\n accessibilityLabel={usingGiphy ? 'Search Giphy' : 'Send message'}\n size=\"md\"\n appearance=\"neutral\"\n style={styles.textInputSend}\n name={usingGiphy ? 'general.search' : 'general.upArrow'}\n onPress={onSubmit}\n />\n )\n}\n\nfunction MessageFormAttachmentPicker() {\n const styles = useMessageFormStyles()\n const { usingGiphy, attachmentUploader } = React.useContext(MessageFormContext)\n const [isOpen, setIsOpen] = useState(false)\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled) {\n return\n }\n\n const filteredAssets = result.assets\n .filter(asset => {\n return asset.fileSize && asset.fileName && asset.mimeType\n })\n .map(asset => {\n return {\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n size: asset.fileSize as number,\n height: asset.height,\n width: asset.width,\n }\n })\n\n attachmentUploader?.handleFilesAttached(filteredAssets)\n }\n\n const openCamera = async () => {\n setIsOpen(false)\n let result = await ImagePicker.openCameraAsync()\n if (!result.canceled) {\n uploadImagePickerResult(result)\n }\n }\n\n const pickImage = async () => {\n setIsOpen(false)\n let result = await ImagePicker.openImageLibraryAsync()\n if (!result.canceled) {\n uploadImagePickerResult(result)\n }\n }\n\n if (usingGiphy) {\n return null\n }\n\n return (\n // TODO: Design Pass\n <View style={styles.attachmentPicker}>\n {isOpen && (\n <View style={styles.attachmentPickerButtons}>\n <IconButton\n accessibilityLabel=\"Take a photo\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.videoCamera'}\n onPress={openCamera}\n />\n <IconButton\n accessibilityLabel=\"Choose a photo\"\n size=\"md\"\n appearance=\"neutral\"\n name={'churchCenter.photosIos'}\n onPress={pickImage}\n />\n </View>\n )}\n <IconButton\n accessibilityLabel=\"File Menu\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.outlinedPlusCircle'}\n onPress={() => setIsOpen(!isOpen)}\n />\n </View>\n )\n}\n\nfunction MessageFormCommands() {\n const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)\n\n if (!canGiphy) {\n return null\n }\n\n if (usingGiphy) {\n return (\n <IconButton\n accessibilityLabel=\"Exit Giphy Search\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.x'}\n onPress={() => setUsingGiphy(false)}\n />\n )\n }\n\n return (\n <IconButton\n accessibilityLabel=\"Search Giphy\"\n size=\"md\"\n appearance=\"neutral\"\n name={'general.bolt'}\n onPress={() => setUsingGiphy(true)}\n disabled={text.length > GIPHY_MAX_LENGTH}\n />\n )\n}\n\nconst useMessageFormStyles = () => {\n const theme = useTheme()\n const navigationTheme = useNavigationTheme()\n\n return StyleSheet.create({\n textInputContainer: {\n borderColor: theme.colors.fillColorNeutral050Base,\n borderTopWidth: 1,\n padding: 12,\n backgroundColor: navigationTheme.colors.card,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n },\n textInputBoundary: {\n borderRadius: 24,\n borderWidth: 1,\n padding: 12,\n paddingHorizontal: 20,\n borderColor: theme.colors.fillColorNeutral050Base,\n flex: 1,\n gap: 12,\n },\n textInputRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n },\n textInput: {\n flex: 1,\n },\n giphyBadge: {\n backgroundColor: theme.colors.fillColorNeutral050Base,\n borderRadius: 24,\n padding: 8,\n paddingHorizontal: 12,\n },\n textInputSend: {\n borderRadius: 24,\n height: 36,\n width: 36,\n },\n attachmentPicker: {\n position: 'relative',\n },\n attachmentPickerButtons: {\n position: 'absolute',\n left: 0,\n bottom: 40,\n zIndex: 10,\n gap: 16,\n },\n messageFormAttachments: {\n flexDirection: 'row',\n gap: 8,\n },\n inputErrorMessage: {\n color: theme.colors.statusErrorText,\n fontSize: 14,\n },\n })\n}\n"]}
|
|
@@ -49,6 +49,17 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
|
|
|
49
49
|
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
readonly ConversationSelectTeamsILeadRecipients: {
|
|
53
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
54
|
+
readonly options: ({ navigation, route }: {
|
|
55
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
56
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
57
|
+
theme: ReactNavigation.Theme;
|
|
58
|
+
}) => {
|
|
59
|
+
title: string;
|
|
60
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
52
63
|
readonly ConversationFilterRecipients: {
|
|
53
64
|
readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
|
|
54
65
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
@@ -173,6 +184,17 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
173
184
|
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
174
185
|
};
|
|
175
186
|
};
|
|
187
|
+
readonly ConversationSelectTeamsILeadRecipients: {
|
|
188
|
+
readonly screen: ({ route, }: import("../screens/conversation_select_recipients/types/screen_props").ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
189
|
+
readonly options: ({ navigation, route }: {
|
|
190
|
+
route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
|
|
191
|
+
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
|
|
192
|
+
theme: ReactNavigation.Theme;
|
|
193
|
+
}) => {
|
|
194
|
+
title: string;
|
|
195
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
176
198
|
readonly ConversationFilterRecipients: {
|
|
177
199
|
readonly screen: ({}: import("../screens/conversation_filter_recipients/types").ConversationFilterRecipientsScreenProps) => React.JSX.Element;
|
|
178
200
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAOnF,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAOnF,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS7C,eAAO,MAAM,oBAAoB;;;;;;;;;uOAxBoC,mBACjE;;;;;;;;;;;;;uBAuL+8X,gBAAiB,KAAK;;;qCArJ58X,2BAA2B;;;;;;;;;uBAqJ25X,gBAAiB,KAAK;;;qCAzI58X,2BAA2B;;;;;;;;uBAyI25X,gBAAiB,KAAK;;;qCA3H58X,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;uBA2H25X,gBAAiB,KAAK;;;;qCAxG58X,2BAA2B;;;;EAQtD,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;uBA8F67X,gBAAiB,KAAK;;;qCApF58X,2BAA2B;;;;;;;;;;;;uBAoF25X,gBAAiB,KAAK;;;;;;;;;;;uBAAtB,gBAAiB,KAAK;;;;qCA9C58X,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;mDA8C46X,KAAK;;;iDArJ58X,2BAA2B;;;;;;;;;mDAqJ46X,KAAK;;;iDAzI58X,2BAA2B;;;;;;;;mDAyI46X,KAAK;;;iDA3H58X,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;mDA2H46X,KAAK;;;;iDAxG58X,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+FtD,CAAA;AAEF,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
|
|
@@ -16,6 +16,7 @@ import { HeaderRightButton } from './header';
|
|
|
16
16
|
import { ScreenLayout } from './screenLayout';
|
|
17
17
|
import { ConversationFiltersScreen, ConversationFiltersScreenOptions, } from '../screens/conversation_filters_screen';
|
|
18
18
|
import { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen';
|
|
19
|
+
import { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen';
|
|
19
20
|
export const NewConversationStack = createNativeStackNavigator({
|
|
20
21
|
initialRouteName: 'ConversationSelectRecipients',
|
|
21
22
|
screenOptions: {
|
|
@@ -42,6 +43,15 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
42
43
|
</HeaderRightButton>),
|
|
43
44
|
}),
|
|
44
45
|
},
|
|
46
|
+
ConversationSelectTeamsILeadRecipients: {
|
|
47
|
+
screen: ConversationSelectTeamsILeadRecipientsScreen,
|
|
48
|
+
options: ({ navigation, route }) => ({
|
|
49
|
+
title: 'New conversation',
|
|
50
|
+
headerRight: (props) => (<HeaderRightButton {...props} onPress={() => navigation.popTo('Conversations', route.params)}>
|
|
51
|
+
Cancel
|
|
52
|
+
</HeaderRightButton>),
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
45
55
|
ConversationFilterRecipients: {
|
|
46
56
|
screen: ConversationFilterRecipientsScreen,
|
|
47
57
|
options: ConversationFilterReceipientsScreenOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,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,CAAC,CACrB;aACF,CAAC;SACH;QACD,GAAG,EAAE;YACH,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MA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OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\nimport { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationSelectTeamsILeadRecipients: {\n screen: ConversationSelectTeamsILeadRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={() => navigation.getParent()?.goBack()}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GroupsGroupResource } from '../../../types';
|
|
2
|
+
interface GroupsRecipientRowProps {
|
|
3
|
+
group: GroupsGroupResource;
|
|
4
|
+
onPress: (group: GroupsGroupResource) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const GroupsRecipientRow: ({ group, onPress }: GroupsRecipientRowProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=groups_recipient_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups_recipient_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAIpD,UAAU,uBAAuB;IAC/B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;CAC9C;AAED,eAAO,MAAM,kBAAkB,uBAAwB,uBAAuB,gCAa7E,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { pluralize } from '../../../utils';
|
|
2
|
+
import { RecipientLinkRow } from './recipient_link_row';
|
|
3
|
+
export const GroupsRecipientRow = ({ group, onPress }) => {
|
|
4
|
+
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`;
|
|
5
|
+
return (<RecipientLinkRow imageUri={group.headerImage?.thumbnail} title={group.name} subtitle={`${group.membershipsCount} members`} onPress={() => onPress(group)} accessibilityLabel={groupAccessibilityLabel} accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}/>);
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=groups_recipient_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE,EAAE;IAChF,MAAM,uBAAuB,GAAG,UAAU,KAAK,CAAC,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAA;IAE1G,OAAO,CACL,CAAC,gBAAgB,CACf,QAAQ,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CACvC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAClB,QAAQ,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,UAAU,CAAC,CAC9C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAC9B,kBAAkB,CAAC,CAAC,uBAAuB,CAAC,CAC5C,iBAAiB,CAAC,CAAC,kGAAkG,CAAC,EACtH,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GroupsGroupResource } from '../../../types'\nimport { pluralize } from '../../../utils'\nimport { RecipientLinkRow } from './recipient_link_row'\n\ninterface GroupsRecipientRowProps {\n group: GroupsGroupResource\n onPress: (group: GroupsGroupResource) => void\n}\n\nexport const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps) => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <RecipientLinkRow\n imageUri={group.headerImage?.thumbnail}\n title={group.name}\n subtitle={`${group.membershipsCount} members`}\n onPress={() => onPress(group)}\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceTypeWithTeams } from '../../conversation_filter_recipients/types';
|
|
2
|
+
interface TeamRecipientRowProps {
|
|
3
|
+
serviceType: ServiceTypeWithTeams;
|
|
4
|
+
onPress: (teams: ServiceTypeWithTeams['teams']) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const TeamRecipientRow: ({ serviceType, onPress }: TeamRecipientRowProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=team_recipient_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team_recipient_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/team_recipient_row.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAGjF,UAAU,qBAAqB;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;CACxD;AAED,eAAO,MAAM,gBAAgB,6BAA8B,qBAAqB,gCAa/E,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { pluralize } from '../../../utils';
|
|
2
|
+
import { RecipientLinkRow } from './recipient_link_row';
|
|
3
|
+
export const TeamRecipientRow = ({ serviceType, onPress }) => {
|
|
4
|
+
const serviceTypeAccessibilityLabel = `Select ${pluralize(serviceType.teams.length, 'team')} for ${serviceType.name}`;
|
|
5
|
+
const teamNames = serviceType.teams.map(team => team.name).join(', ');
|
|
6
|
+
return (<RecipientLinkRow title={serviceType.name} subtitle={teamNames} onPress={() => onPress(serviceType.teams)} accessibilityLabel={serviceTypeAccessibilityLabel} accessibilityHint={`Selects Service Type's teams as recipients and navigates to the final screen to finish creating the conversation`}/>);
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=team_recipient_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/team_recipient_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAyB,EAAE,EAAE;IAClF,MAAM,6BAA6B,GAAG,UAAU,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,WAAW,CAAC,IAAI,EAAE,CAAA;IACrH,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAErE,OAAO,CACL,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CACxB,QAAQ,CAAC,CAAC,SAAS,CAAC,CACpB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAC1C,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,iBAAiB,CAAC,CAAC,kHAAkH,CAAC,EACtI,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { pluralize } from '../../../utils'\nimport { ServiceTypeWithTeams } from '../../conversation_filter_recipients/types'\nimport { RecipientLinkRow } from './recipient_link_row'\n\ninterface TeamRecipientRowProps {\n serviceType: ServiceTypeWithTeams\n onPress: (teams: ServiceTypeWithTeams['teams']) => void\n}\n\nexport const TeamRecipientRow = ({ serviceType, onPress }: TeamRecipientRowProps) => {\n const serviceTypeAccessibilityLabel = `Select ${pluralize(serviceType.teams.length, 'team')} for ${serviceType.name}`\n const teamNames = serviceType.teams.map(team => team.name).join(', ')\n\n return (\n <RecipientLinkRow\n title={serviceType.name}\n subtitle={teamNames}\n onPress={() => onPress(serviceType.teams)}\n accessibilityLabel={serviceTypeAccessibilityLabel}\n accessibilityHint={`Selects Service Type's teams as recipients and navigates to the final screen to finish creating the conversation`}\n />\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_group_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_select_group_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAI9E,eAAO,MAAM,uCAAuC,eAEjD,uCAAuC,sBAyCzC,CAAA"}
|
package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js
CHANGED
|
@@ -4,10 +4,9 @@ import { StyleSheet, View } from 'react-native';
|
|
|
4
4
|
import { FlashList } from '@shopify/flash-list';
|
|
5
5
|
import { Heading } from '../../components';
|
|
6
6
|
import { useGroupsGroups } from '../../hooks/use_groups_groups';
|
|
7
|
-
import { pluralize } from '../../utils';
|
|
8
|
-
import { RecipientLinkRow } from './components/recipient_link_row';
|
|
9
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
10
8
|
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row';
|
|
9
|
+
import { GroupsRecipientRow } from './components/groups_recipient_row';
|
|
11
10
|
export const ConversationSelectGroupRecipientsScreen = ({ route, }) => {
|
|
12
11
|
const styles = useStyles();
|
|
13
12
|
const navigation = useNavigation();
|
|
@@ -27,8 +26,7 @@ export const ConversationSelectGroupRecipientsScreen = ({ route, }) => {
|
|
|
27
26
|
return (<FlashList data={groupsWithCreatePermission} keyExtractor={item => item.id.toString()} estimatedItemSize={65} contentContainerStyle={styles.contentContainer} ListHeaderComponent={<View style={styles.sectionHeader}>
|
|
28
27
|
<Heading variant="h3">All my groups</Heading>
|
|
29
28
|
</View>} renderItem={({ item: group }) => {
|
|
30
|
-
|
|
31
|
-
return (<RecipientLinkRow key={group.id} imageUri={group.headerImage?.thumbnail} title={group.name} subtitle={`${group.membershipsCount} members`} onPress={() => handleNavigateToConversationNew(group)} accessibilityLabel={groupAccessibilityLabel} accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}/>);
|
|
29
|
+
return (<GroupsRecipientRow key={group.id} group={group} onPress={handleNavigateToConversationNew}/>);
|
|
32
30
|
}} ListFooterComponent={showGroupsDisclaimer ? <GroupsWithoutChatDisclaimerRow /> : null}/>);
|
|
33
31
|
};
|
|
34
32
|
const useStyles = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_group_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"conversation_select_group_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAEtE,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,EACtD,KAAK,GACmC,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,SAAS,EAAE,C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CAAC,CAAC,+BAA+B,CAAC,EACzC,CACH,CAAA;QACH,CAAC,CAAC,CACF,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,AAAD,EAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EACtF,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,aAAa,EAAE,MAAM;SACtB;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,CAAC;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { FlashList } from '@shopify/flash-list'\nimport { Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\nimport { GroupsRecipientRow } from './components/groups_recipient_row'\n\nexport const ConversationSelectGroupRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const showGroupsDisclaimer = groups.length > groupsWithCreatePermission.length\n\n const handleNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n ...route.params,\n },\n })\n }\n\n return (\n <FlashList\n data={groupsWithCreatePermission}\n keyExtractor={item => item.id.toString()}\n estimatedItemSize={65}\n contentContainerStyle={styles.contentContainer}\n ListHeaderComponent={\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">All my groups</Heading>\n </View>\n }\n renderItem={({ item: group }: { item: GroupsGroupResource }) => {\n return (\n <GroupsRecipientRow\n key={group.id}\n group={group}\n onPress={handleNavigateToConversationNew}\n />\n )\n }}\n ListFooterComponent={showGroupsDisclaimer ? <GroupsWithoutChatDisclaimerRow /> : null}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 16,\n paddingBottom: 4,\n },\n })\n}\n"]}
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAU9E,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAyHzC,CAAA"}
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js
CHANGED
|
@@ -3,22 +3,23 @@ import React from 'react';
|
|
|
3
3
|
import { ScrollView, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { Button, Heading } from '../../components';
|
|
5
5
|
import { useGroupsGroups } from '../../hooks/use_groups_groups';
|
|
6
|
-
import { pluralize } from '../../utils';
|
|
7
|
-
import { RecipientLinkRow } from './components/recipient_link_row';
|
|
8
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
7
|
import { ViewMoreLinkRow } from './components/view_more_link_row';
|
|
10
8
|
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row';
|
|
11
|
-
|
|
9
|
+
import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams';
|
|
10
|
+
import { TeamRecipientRow } from './components/team_recipient_row';
|
|
11
|
+
import { GroupsRecipientRow } from './components/groups_recipient_row';
|
|
12
|
+
const MAX_VISIBLE_RECIPIENTS = 5;
|
|
12
13
|
export const ConversationSelectRecipientsScreen = ({ route, }) => {
|
|
13
14
|
const styles = useStyles();
|
|
14
15
|
const navigation = useNavigation();
|
|
15
16
|
const { data: groups = [] } = useGroupsGroups();
|
|
16
17
|
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
|
|
17
|
-
const visibleGroups = groupsWithCreatePermission.slice(0,
|
|
18
|
-
const hasMoreGroups = groupsWithCreatePermission.length >
|
|
18
|
+
const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS);
|
|
19
|
+
const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_RECIPIENTS;
|
|
19
20
|
const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length;
|
|
20
21
|
const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups;
|
|
21
|
-
const
|
|
22
|
+
const handleGroupsNavigateToConversationNew = (group) => {
|
|
22
23
|
navigation.navigate('New', {
|
|
23
24
|
screen: 'ConversationNew',
|
|
24
25
|
params: {
|
|
@@ -36,6 +37,28 @@ export const ConversationSelectRecipientsScreen = ({ route, }) => {
|
|
|
36
37
|
},
|
|
37
38
|
});
|
|
38
39
|
};
|
|
40
|
+
const { serviceTypes } = useServiceTypesWithTeams();
|
|
41
|
+
const visibleServiceTypes = serviceTypes.slice(0, MAX_VISIBLE_RECIPIENTS);
|
|
42
|
+
const hasMoreServiceTypes = serviceTypes.length > MAX_VISIBLE_RECIPIENTS;
|
|
43
|
+
const handleTeamsNavigateToConversationNew = (teams) => {
|
|
44
|
+
const teamIds = teams.map(team => team.id);
|
|
45
|
+
navigation.navigate('New', {
|
|
46
|
+
screen: 'ConversationNew',
|
|
47
|
+
params: {
|
|
48
|
+
team_ids: teamIds,
|
|
49
|
+
source_app_name: 'Services',
|
|
50
|
+
...route.params,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const handleServiceTypesViewMore = () => {
|
|
55
|
+
navigation.navigate('New', {
|
|
56
|
+
screen: 'ConversationSelectTeamsILeadRecipients',
|
|
57
|
+
params: {
|
|
58
|
+
...route.params,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
};
|
|
39
62
|
return (<ScrollView contentContainerStyle={styles.contentContainer}>
|
|
40
63
|
<View style={styles.section}>
|
|
41
64
|
<View style={styles.sectionHeader}>
|
|
@@ -43,8 +66,7 @@ export const ConversationSelectRecipientsScreen = ({ route, }) => {
|
|
|
43
66
|
</View>
|
|
44
67
|
<View>
|
|
45
68
|
{visibleGroups.map(group => {
|
|
46
|
-
|
|
47
|
-
return (<RecipientLinkRow key={group.id} imageUri={group.headerImage?.thumbnail} title={group.name} subtitle={`${group.membershipsCount} members`} onPress={() => handleNavigateToConversationNew(group)} accessibilityLabel={groupAccessibilityLabel} accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}/>);
|
|
69
|
+
return (<GroupsRecipientRow key={group.id} group={group} onPress={handleGroupsNavigateToConversationNew}/>);
|
|
48
70
|
})}
|
|
49
71
|
{hasMoreGroups && (<ViewMoreLinkRow onPress={handleGroupsViewMore} accessibilityHint="Navigate to a full list of your groups."/>)}
|
|
50
72
|
{showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
|
|
@@ -58,7 +80,13 @@ export const ConversationSelectRecipientsScreen = ({ route, }) => {
|
|
|
58
80
|
params: {
|
|
59
81
|
source_app_name: 'Services',
|
|
60
82
|
},
|
|
61
|
-
})} title="Select teams" variant="outline" iconNameLeft="general.search"/>
|
|
83
|
+
})} title="Select teams" variant="outline" iconNameLeft="general.search" size="sm"/>
|
|
84
|
+
</View>
|
|
85
|
+
<View>
|
|
86
|
+
{visibleServiceTypes.map(serviceType => {
|
|
87
|
+
return (<TeamRecipientRow key={serviceType.id} serviceType={serviceType} onPress={handleTeamsNavigateToConversationNew}/>);
|
|
88
|
+
})}
|
|
89
|
+
{hasMoreServiceTypes && (<ViewMoreLinkRow onPress={handleServiceTypesViewMore} accessibilityHint="Navigate to a full list of teams you lead."/>)}
|
|
62
90
|
</View>
|
|
63
91
|
</View>
|
|
64
92
|
</ScrollView>);
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAA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AAY,CAAC,gBAAgB,CAC7B,IAAI,CAAC,IAAI,EAEb;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,IAAI,CACH;UAAA,CAAC,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACrC,OAAO,CACL,CAAC,gBAAgB,CACf,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CACpB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,oCAAoC,CAAC,EAC9C,CACH,CAAA;QACH,CAAC,CAAC,CACF;UAAA,CAAC,mBAAmB,IAAI,CACtB,CAAC,eAAe,CACd,OAAO,CAAC,CAAC,0BAA0B,CAAC,CACpC,iBAAiB,CAAC,4CAA4C,EAC9D,CACH,CACH;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,UAAU,CAAC,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE,GAAG,MAAM;SAC3B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,CAAC;SACjB;QACD,iBAAiB,EAAE,EAAE;KACtB,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { Button, Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { ViewMoreLinkRow } from './components/view_more_link_row'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\nimport { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'\nimport { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'\nimport { TeamRecipientRow } from './components/team_recipient_row'\nimport { GroupsRecipientRow } from './components/groups_recipient_row'\n\nconst MAX_VISIBLE_RECIPIENTS = 5\n\nexport const ConversationSelectRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_RECIPIENTS\n const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length\n const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups\n\n const handleGroupsNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n ...route.params,\n },\n })\n }\n\n const handleGroupsViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n const { serviceTypes } = useServiceTypesWithTeams()\n const visibleServiceTypes = serviceTypes.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreServiceTypes = serviceTypes.length > MAX_VISIBLE_RECIPIENTS\n\n const handleTeamsNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {\n const teamIds = teams.map(team => team.id)\n\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: teamIds,\n source_app_name: 'Services',\n ...route.params,\n },\n })\n }\n\n const handleServiceTypesViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectTeamsILeadRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n return (\n <ScrollView contentContainerStyle={styles.contentContainer}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {visibleGroups.map(group => {\n return (\n <GroupsRecipientRow\n key={group.id}\n group={group}\n onPress={handleGroupsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreGroups && (\n <ViewMoreLinkRow\n onPress={handleGroupsViewMore}\n accessibilityHint=\"Navigate to a full list of your groups.\"\n />\n )}\n {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('New', {\n screen: 'ConversationFilterRecipients',\n params: {\n source_app_name: 'Services',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n size=\"sm\"\n />\n </View>\n <View>\n {visibleServiceTypes.map(serviceType => {\n return (\n <TeamRecipientRow\n key={serviceType.id}\n serviceType={serviceType}\n onPress={handleTeamsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreServiceTypes && (\n <ViewMoreLinkRow\n onPress={handleServiceTypesViewMore}\n accessibilityHint=\"Navigate to a full list of teams you lead.\"\n />\n )}\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n gap: 24,\n paddingTop: 16,\n paddingBottom: 16 + bottom,\n },\n section: {\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 4,\n },\n selectTeamsButton: {},\n })\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConversationSelectRecipientsScreenProps } from './types/screen_props';
|
|
3
|
+
export declare const ConversationSelectTeamsILeadRecipientsScreen: ({ route, }: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=conversation_select_teams_i_lead_recipients_screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_teams_i_lead_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAK9E,eAAO,MAAM,4CAA4C,eAEtD,uCAAuC,sBAwCzC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { FlashList } from '@shopify/flash-list';
|
|
5
|
+
import { Heading } from '../../components';
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
|
+
import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams';
|
|
8
|
+
import { TeamRecipientRow } from './components/team_recipient_row';
|
|
9
|
+
export const ConversationSelectTeamsILeadRecipientsScreen = ({ route, }) => {
|
|
10
|
+
const styles = useStyles();
|
|
11
|
+
const navigation = useNavigation();
|
|
12
|
+
const { serviceTypes } = useServiceTypesWithTeams();
|
|
13
|
+
const handleNavigateToConversationNew = (teams) => {
|
|
14
|
+
const teamIds = teams.map(team => team.id);
|
|
15
|
+
navigation.navigate('New', {
|
|
16
|
+
screen: 'ConversationNew',
|
|
17
|
+
params: {
|
|
18
|
+
team_ids: teamIds,
|
|
19
|
+
source_app_name: 'Services',
|
|
20
|
+
...route.params,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return (<FlashList data={serviceTypes} keyExtractor={item => item.id.toString()} estimatedItemSize={65} contentContainerStyle={styles.contentContainer} ListHeaderComponent={<View style={styles.sectionHeader}>
|
|
25
|
+
<Heading variant="h3">All teams I lead</Heading>
|
|
26
|
+
</View>} renderItem={({ item: serviceType }) => {
|
|
27
|
+
return (<TeamRecipientRow key={serviceType.id} serviceType={serviceType} onPress={handleNavigateToConversationNew}/>);
|
|
28
|
+
}}/>);
|
|
29
|
+
};
|
|
30
|
+
const useStyles = () => {
|
|
31
|
+
const { bottom } = useSafeAreaInsets();
|
|
32
|
+
return StyleSheet.create({
|
|
33
|
+
contentContainer: {
|
|
34
|
+
paddingBottom: bottom,
|
|
35
|
+
},
|
|
36
|
+
sectionHeader: {
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
justifyContent: 'space-between',
|
|
39
|
+
padding: 16,
|
|
40
|
+
paddingBottom: 4,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=conversation_select_teams_i_lead_recipients_screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_teams_i_lead_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAA;AAE/G,OAAO,EAAE,gBAAgB,EAAE,MA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AC,CACzB,OAAO,CAAC,CAAC,+BAA+B,CAAC,EACzC,CACH,CAAA;QACH,CAAC,CAAC,EACF,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,aAAa,EAAE,MAAM;SACtB;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,CAAC;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { FlashList } from '@shopify/flash-list'\nimport { Heading } from '../../components'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'\nimport { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'\nimport { TeamRecipientRow } from './components/team_recipient_row'\n\nexport const ConversationSelectTeamsILeadRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { serviceTypes } = useServiceTypesWithTeams()\n\n const handleNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {\n const teamIds = teams.map(team => team.id)\n\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: teamIds,\n source_app_name: 'Services',\n ...route.params,\n },\n })\n }\n\n return (\n <FlashList\n data={serviceTypes}\n keyExtractor={item => item.id.toString()}\n estimatedItemSize={65}\n contentContainerStyle={styles.contentContainer}\n ListHeaderComponent={\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">All teams I lead</Heading>\n </View>\n }\n renderItem={({ item: serviceType }: { item: ServiceTypeWithTeams }) => {\n return (\n <TeamRecipientRow\n key={serviceType.id}\n serviceType={serviceType}\n onPress={handleNavigateToConversationNew}\n />\n )\n }}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 16,\n paddingBottom: 4,\n },\n })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.1-rc.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"prettier": "^3.4.2",
|
|
55
55
|
"typescript": "<5.6.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d1c7d24ac64460940d65b763e8903d722aa2ab5e"
|
|
58
58
|
}
|
|
@@ -46,6 +46,9 @@ const MessageFormContext = React.createContext<{
|
|
|
46
46
|
setUsingGiphy: (_usingGiphy: boolean) => {},
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
+
const GIPHY_MAX_LENGTH = 50
|
|
50
|
+
const MAX_MESSAGE_LENGTH = 5000
|
|
51
|
+
|
|
49
52
|
function MessageFormRoot({ conversation, children }: MessagesFormRootProps) {
|
|
50
53
|
const { giphyApiKey } = useContext(ChatContext)
|
|
51
54
|
const canGiphy = !!giphyApiKey
|
|
@@ -186,20 +189,24 @@ function MessageFormInput() {
|
|
|
186
189
|
return (
|
|
187
190
|
<View style={styles.textInputBoundary}>
|
|
188
191
|
<MessageFormAttachments />
|
|
189
|
-
<View style={styles.
|
|
192
|
+
<View style={styles.textInputRow}>
|
|
190
193
|
{usingGiphy ? (
|
|
191
194
|
<View style={styles.giphyBadge}>
|
|
192
195
|
<Text>/Giphy</Text>
|
|
193
196
|
</View>
|
|
194
197
|
) : null}
|
|
195
198
|
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
<View style={styles.textInput}>
|
|
200
|
+
<TextInput
|
|
201
|
+
multiline={true}
|
|
202
|
+
aria-disabled={true}
|
|
203
|
+
placeholder="Send a message"
|
|
204
|
+
onChangeText={setText}
|
|
205
|
+
value={text}
|
|
206
|
+
maxLength={usingGiphy ? GIPHY_MAX_LENGTH : MAX_MESSAGE_LENGTH}
|
|
207
|
+
onSubmitEditing={onSubmit}
|
|
208
|
+
/>
|
|
209
|
+
</View>
|
|
203
210
|
</View>
|
|
204
211
|
|
|
205
212
|
{attachmentError ? <Text style={styles.inputErrorMessage}>{attachmentError}</Text> : null}
|
|
@@ -305,7 +312,7 @@ function MessageFormAttachmentPicker() {
|
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
function MessageFormCommands() {
|
|
308
|
-
const { canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)
|
|
315
|
+
const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)
|
|
309
316
|
|
|
310
317
|
if (!canGiphy) {
|
|
311
318
|
return null
|
|
@@ -330,6 +337,7 @@ function MessageFormCommands() {
|
|
|
330
337
|
appearance="neutral"
|
|
331
338
|
name={'general.bolt'}
|
|
332
339
|
onPress={() => setUsingGiphy(true)}
|
|
340
|
+
disabled={text.length > GIPHY_MAX_LENGTH}
|
|
333
341
|
/>
|
|
334
342
|
)
|
|
335
343
|
}
|
|
@@ -357,10 +365,14 @@ const useMessageFormStyles = () => {
|
|
|
357
365
|
flex: 1,
|
|
358
366
|
gap: 12,
|
|
359
367
|
},
|
|
360
|
-
|
|
368
|
+
textInputRow: {
|
|
361
369
|
flexDirection: 'row',
|
|
370
|
+
alignItems: 'center',
|
|
362
371
|
gap: 12,
|
|
363
372
|
},
|
|
373
|
+
textInput: {
|
|
374
|
+
flex: 1,
|
|
375
|
+
},
|
|
364
376
|
giphyBadge: {
|
|
365
377
|
backgroundColor: theme.colors.fillColorNeutral050Base,
|
|
366
378
|
borderRadius: 24,
|
package/src/navigation/index.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from '../screens/conversation_filters_screen'
|
|
31
31
|
import { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'
|
|
32
32
|
import { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'
|
|
33
|
+
import { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'
|
|
33
34
|
|
|
34
35
|
export const NewConversationStack = createNativeStackNavigator({
|
|
35
36
|
initialRouteName: 'ConversationSelectRecipients',
|
|
@@ -64,6 +65,20 @@ export const NewConversationStack = createNativeStackNavigator({
|
|
|
64
65
|
),
|
|
65
66
|
}),
|
|
66
67
|
},
|
|
68
|
+
ConversationSelectTeamsILeadRecipients: {
|
|
69
|
+
screen: ConversationSelectTeamsILeadRecipientsScreen,
|
|
70
|
+
options: ({ navigation, route }) => ({
|
|
71
|
+
title: 'New conversation',
|
|
72
|
+
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
73
|
+
<HeaderRightButton
|
|
74
|
+
{...props}
|
|
75
|
+
onPress={() => navigation.popTo('Conversations', route.params)}
|
|
76
|
+
>
|
|
77
|
+
Cancel
|
|
78
|
+
</HeaderRightButton>
|
|
79
|
+
),
|
|
80
|
+
}),
|
|
81
|
+
},
|
|
67
82
|
ConversationFilterRecipients: {
|
|
68
83
|
screen: ConversationFilterRecipientsScreen,
|
|
69
84
|
options: ConversationFilterReceipientsScreenOptions,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GroupsGroupResource } from '../../../types'
|
|
2
|
+
import { pluralize } from '../../../utils'
|
|
3
|
+
import { RecipientLinkRow } from './recipient_link_row'
|
|
4
|
+
|
|
5
|
+
interface GroupsRecipientRowProps {
|
|
6
|
+
group: GroupsGroupResource
|
|
7
|
+
onPress: (group: GroupsGroupResource) => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps) => {
|
|
11
|
+
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<RecipientLinkRow
|
|
15
|
+
imageUri={group.headerImage?.thumbnail}
|
|
16
|
+
title={group.name}
|
|
17
|
+
subtitle={`${group.membershipsCount} members`}
|
|
18
|
+
onPress={() => onPress(group)}
|
|
19
|
+
accessibilityLabel={groupAccessibilityLabel}
|
|
20
|
+
accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { pluralize } from '../../../utils'
|
|
2
|
+
import { ServiceTypeWithTeams } from '../../conversation_filter_recipients/types'
|
|
3
|
+
import { RecipientLinkRow } from './recipient_link_row'
|
|
4
|
+
|
|
5
|
+
interface TeamRecipientRowProps {
|
|
6
|
+
serviceType: ServiceTypeWithTeams
|
|
7
|
+
onPress: (teams: ServiceTypeWithTeams['teams']) => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const TeamRecipientRow = ({ serviceType, onPress }: TeamRecipientRowProps) => {
|
|
11
|
+
const serviceTypeAccessibilityLabel = `Select ${pluralize(serviceType.teams.length, 'team')} for ${serviceType.name}`
|
|
12
|
+
const teamNames = serviceType.teams.map(team => team.name).join(', ')
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<RecipientLinkRow
|
|
16
|
+
title={serviceType.name}
|
|
17
|
+
subtitle={teamNames}
|
|
18
|
+
onPress={() => onPress(serviceType.teams)}
|
|
19
|
+
accessibilityLabel={serviceTypeAccessibilityLabel}
|
|
20
|
+
accessibilityHint={`Selects Service Type's teams as recipients and navigates to the final screen to finish creating the conversation`}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx
CHANGED
|
@@ -5,11 +5,10 @@ import { FlashList } from '@shopify/flash-list'
|
|
|
5
5
|
import { Heading } from '../../components'
|
|
6
6
|
import { GroupsGroupResource } from '../../types'
|
|
7
7
|
import { useGroupsGroups } from '../../hooks/use_groups_groups'
|
|
8
|
-
import { pluralize } from '../../utils'
|
|
9
|
-
import { RecipientLinkRow } from './components/recipient_link_row'
|
|
10
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
11
9
|
import { ConversationSelectRecipientsScreenProps } from './types/screen_props'
|
|
12
10
|
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'
|
|
11
|
+
import { GroupsRecipientRow } from './components/groups_recipient_row'
|
|
13
12
|
|
|
14
13
|
export const ConversationSelectGroupRecipientsScreen = ({
|
|
15
14
|
route,
|
|
@@ -43,17 +42,11 @@ export const ConversationSelectGroupRecipientsScreen = ({
|
|
|
43
42
|
</View>
|
|
44
43
|
}
|
|
45
44
|
renderItem={({ item: group }: { item: GroupsGroupResource }) => {
|
|
46
|
-
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`
|
|
47
|
-
|
|
48
45
|
return (
|
|
49
|
-
<
|
|
46
|
+
<GroupsRecipientRow
|
|
50
47
|
key={group.id}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
subtitle={`${group.membershipsCount} members`}
|
|
54
|
-
onPress={() => handleNavigateToConversationNew(group)}
|
|
55
|
-
accessibilityLabel={groupAccessibilityLabel}
|
|
56
|
-
accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}
|
|
48
|
+
group={group}
|
|
49
|
+
onPress={handleNavigateToConversationNew}
|
|
57
50
|
/>
|
|
58
51
|
)
|
|
59
52
|
}}
|
package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx
CHANGED
|
@@ -4,27 +4,31 @@ import { ScrollView, StyleSheet, View } from 'react-native'
|
|
|
4
4
|
import { Button, Heading } from '../../components'
|
|
5
5
|
import { GroupsGroupResource } from '../../types'
|
|
6
6
|
import { useGroupsGroups } from '../../hooks/use_groups_groups'
|
|
7
|
-
import { pluralize } from '../../utils'
|
|
8
|
-
import { RecipientLinkRow } from './components/recipient_link_row'
|
|
9
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
10
8
|
import { ConversationSelectRecipientsScreenProps } from './types/screen_props'
|
|
11
9
|
import { ViewMoreLinkRow } from './components/view_more_link_row'
|
|
12
10
|
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'
|
|
13
|
-
|
|
11
|
+
import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'
|
|
12
|
+
import { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'
|
|
13
|
+
import { TeamRecipientRow } from './components/team_recipient_row'
|
|
14
|
+
import { GroupsRecipientRow } from './components/groups_recipient_row'
|
|
15
|
+
|
|
16
|
+
const MAX_VISIBLE_RECIPIENTS = 5
|
|
14
17
|
|
|
15
18
|
export const ConversationSelectRecipientsScreen = ({
|
|
16
19
|
route,
|
|
17
20
|
}: ConversationSelectRecipientsScreenProps) => {
|
|
18
21
|
const styles = useStyles()
|
|
19
22
|
const navigation = useNavigation()
|
|
23
|
+
|
|
20
24
|
const { data: groups = [] } = useGroupsGroups()
|
|
21
25
|
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)
|
|
22
|
-
const visibleGroups = groupsWithCreatePermission.slice(0,
|
|
23
|
-
const hasMoreGroups = groupsWithCreatePermission.length >
|
|
26
|
+
const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS)
|
|
27
|
+
const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_RECIPIENTS
|
|
24
28
|
const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length
|
|
25
29
|
const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups
|
|
26
30
|
|
|
27
|
-
const
|
|
31
|
+
const handleGroupsNavigateToConversationNew = (group: GroupsGroupResource) => {
|
|
28
32
|
navigation.navigate('New', {
|
|
29
33
|
screen: 'ConversationNew',
|
|
30
34
|
params: {
|
|
@@ -44,6 +48,32 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
44
48
|
})
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
const { serviceTypes } = useServiceTypesWithTeams()
|
|
52
|
+
const visibleServiceTypes = serviceTypes.slice(0, MAX_VISIBLE_RECIPIENTS)
|
|
53
|
+
const hasMoreServiceTypes = serviceTypes.length > MAX_VISIBLE_RECIPIENTS
|
|
54
|
+
|
|
55
|
+
const handleTeamsNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {
|
|
56
|
+
const teamIds = teams.map(team => team.id)
|
|
57
|
+
|
|
58
|
+
navigation.navigate('New', {
|
|
59
|
+
screen: 'ConversationNew',
|
|
60
|
+
params: {
|
|
61
|
+
team_ids: teamIds,
|
|
62
|
+
source_app_name: 'Services',
|
|
63
|
+
...route.params,
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const handleServiceTypesViewMore = () => {
|
|
69
|
+
navigation.navigate('New', {
|
|
70
|
+
screen: 'ConversationSelectTeamsILeadRecipients',
|
|
71
|
+
params: {
|
|
72
|
+
...route.params,
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
47
77
|
return (
|
|
48
78
|
<ScrollView contentContainerStyle={styles.contentContainer}>
|
|
49
79
|
<View style={styles.section}>
|
|
@@ -52,17 +82,11 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
52
82
|
</View>
|
|
53
83
|
<View>
|
|
54
84
|
{visibleGroups.map(group => {
|
|
55
|
-
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`
|
|
56
|
-
|
|
57
85
|
return (
|
|
58
|
-
<
|
|
86
|
+
<GroupsRecipientRow
|
|
59
87
|
key={group.id}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
subtitle={`${group.membershipsCount} members`}
|
|
63
|
-
onPress={() => handleNavigateToConversationNew(group)}
|
|
64
|
-
accessibilityLabel={groupAccessibilityLabel}
|
|
65
|
-
accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}
|
|
88
|
+
group={group}
|
|
89
|
+
onPress={handleGroupsNavigateToConversationNew}
|
|
66
90
|
/>
|
|
67
91
|
)
|
|
68
92
|
})}
|
|
@@ -91,8 +115,26 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
91
115
|
title="Select teams"
|
|
92
116
|
variant="outline"
|
|
93
117
|
iconNameLeft="general.search"
|
|
118
|
+
size="sm"
|
|
94
119
|
/>
|
|
95
120
|
</View>
|
|
121
|
+
<View>
|
|
122
|
+
{visibleServiceTypes.map(serviceType => {
|
|
123
|
+
return (
|
|
124
|
+
<TeamRecipientRow
|
|
125
|
+
key={serviceType.id}
|
|
126
|
+
serviceType={serviceType}
|
|
127
|
+
onPress={handleTeamsNavigateToConversationNew}
|
|
128
|
+
/>
|
|
129
|
+
)
|
|
130
|
+
})}
|
|
131
|
+
{hasMoreServiceTypes && (
|
|
132
|
+
<ViewMoreLinkRow
|
|
133
|
+
onPress={handleServiceTypesViewMore}
|
|
134
|
+
accessibilityHint="Navigate to a full list of teams you lead."
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
</View>
|
|
96
138
|
</View>
|
|
97
139
|
</ScrollView>
|
|
98
140
|
)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { FlashList } from '@shopify/flash-list'
|
|
5
|
+
import { Heading } from '../../components'
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
7
|
+
import { ConversationSelectRecipientsScreenProps } from './types/screen_props'
|
|
8
|
+
import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'
|
|
9
|
+
import { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'
|
|
10
|
+
import { TeamRecipientRow } from './components/team_recipient_row'
|
|
11
|
+
|
|
12
|
+
export const ConversationSelectTeamsILeadRecipientsScreen = ({
|
|
13
|
+
route,
|
|
14
|
+
}: ConversationSelectRecipientsScreenProps) => {
|
|
15
|
+
const styles = useStyles()
|
|
16
|
+
const navigation = useNavigation()
|
|
17
|
+
const { serviceTypes } = useServiceTypesWithTeams()
|
|
18
|
+
|
|
19
|
+
const handleNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {
|
|
20
|
+
const teamIds = teams.map(team => team.id)
|
|
21
|
+
|
|
22
|
+
navigation.navigate('New', {
|
|
23
|
+
screen: 'ConversationNew',
|
|
24
|
+
params: {
|
|
25
|
+
team_ids: teamIds,
|
|
26
|
+
source_app_name: 'Services',
|
|
27
|
+
...route.params,
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<FlashList
|
|
34
|
+
data={serviceTypes}
|
|
35
|
+
keyExtractor={item => item.id.toString()}
|
|
36
|
+
estimatedItemSize={65}
|
|
37
|
+
contentContainerStyle={styles.contentContainer}
|
|
38
|
+
ListHeaderComponent={
|
|
39
|
+
<View style={styles.sectionHeader}>
|
|
40
|
+
<Heading variant="h3">All teams I lead</Heading>
|
|
41
|
+
</View>
|
|
42
|
+
}
|
|
43
|
+
renderItem={({ item: serviceType }: { item: ServiceTypeWithTeams }) => {
|
|
44
|
+
return (
|
|
45
|
+
<TeamRecipientRow
|
|
46
|
+
key={serviceType.id}
|
|
47
|
+
serviceType={serviceType}
|
|
48
|
+
onPress={handleNavigateToConversationNew}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const useStyles = () => {
|
|
57
|
+
const { bottom } = useSafeAreaInsets()
|
|
58
|
+
|
|
59
|
+
return StyleSheet.create({
|
|
60
|
+
contentContainer: {
|
|
61
|
+
paddingBottom: bottom,
|
|
62
|
+
},
|
|
63
|
+
sectionHeader: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
padding: 16,
|
|
67
|
+
paddingBottom: 4,
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
}
|