@planningcenter/chat-react-native 3.7.0-rc.2 → 3.7.0-rc.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAenE,eAAO,MAAM,WAAW;;;;;;CAOvB,CAAA;AAED,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,YAAY,EAAE,oBAAoB,CAAA;IAClC,uBAAuB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;CACjD;AA0BD,iBAAS,eAAe,CAAC,EACvB,YAAY,EACZ,uBAAuB,EACvB,QAAQ,GACT,EAAE,qBAAqB,qBAoHvB;AAiCD,iBAAS,gBAAgB,sBA2CxB;AAED,iBAAS,oBAAoB,sBAe5B;AAED,iBAAS,2BAA2B,6BA+EnC;AAED,iBAAS,mBAAmB,6BA6B3B"}
1
+ {"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAC3E,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAenE,eAAO,MAAM,WAAW;;;;;;CAOvB,CAAA;AAED,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,YAAY,EAAE,oBAAoB,CAAA;IAClC,uBAAuB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;CACjD;AA0BD,iBAAS,eAAe,CAAC,EACvB,YAAY,EACZ,uBAAuB,EACvB,QAAQ,GACT,EAAE,qBAAqB,qBAoHvB;AAiCD,iBAAS,gBAAgB,sBA2CxB;AAED,iBAAS,oBAAoB,sBAe5B;AAED,iBAAS,2BAA2B,6BAgFnC;AAED,iBAAS,mBAAmB,6BAgC3B"}
@@ -227,18 +227,19 @@ function MessageFormAttachmentPicker() {
227
227
  <IconButton accessibilityLabel="Take a photo" size="md" appearance="neutral" name={'general.videoCamera'} onPress={openCamera}/>
228
228
  <IconButton accessibilityLabel="Choose a photo" size="md" appearance="neutral" name={'churchCenter.photosIos'} onPress={pickImage}/>
229
229
  </View>)}
230
- <IconButton accessibilityLabel="File Menu" size="md" appearance="neutral" name={'general.outlinedPlusCircle'} onPress={() => setIsOpen(!isOpen)}/>
230
+ <IconButton accessibilityLabel="File Menu" size="md" appearance="neutral" name={'general.outlinedPlusCircle'} onPress={() => setIsOpen(!isOpen)} style={styles.formButton}/>
231
231
  </View>);
232
232
  }
233
233
  function MessageFormCommands() {
234
234
  const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext);
235
+ const styles = useMessageFormStyles();
235
236
  if (!canGiphy) {
236
237
  return null;
237
238
  }
238
239
  if (usingGiphy) {
239
- return (<IconButton accessibilityLabel="Exit Giphy Search" size="md" appearance="neutral" name={'general.x'} onPress={() => setUsingGiphy(false)}/>);
240
+ return (<IconButton accessibilityLabel="Exit Giphy Search" size="md" appearance="neutral" name={'general.x'} onPress={() => setUsingGiphy(false)} style={styles.formButton}/>);
240
241
  }
241
- return (<IconButton accessibilityLabel="Search Giphy" size="md" appearance="neutral" name={'general.bolt'} onPress={() => setUsingGiphy(true)} disabled={text.length > GIPHY_MAX_LENGTH}/>);
242
+ return (<IconButton accessibilityLabel="Search Giphy" size="md" appearance="neutral" name={'general.bolt'} onPress={() => setUsingGiphy(true)} disabled={text.length > GIPHY_MAX_LENGTH} style={styles.formButton}/>);
242
243
  }
243
244
  function EditingIndicator() {
244
245
  const { currentlyEditingMessage } = React.useContext(MessageFormContext);
@@ -255,6 +256,7 @@ function EditingIndicator() {
255
256
  const useMessageFormStyles = () => {
256
257
  const theme = useTheme();
257
258
  const navigationTheme = useNavigationTheme();
259
+ const buttonSize = 36;
258
260
  return StyleSheet.create({
259
261
  container: {
260
262
  borderColor: theme.colors.fillColorNeutral050Base,
@@ -264,7 +266,7 @@ const useMessageFormStyles = () => {
264
266
  textInputContainer: {
265
267
  backgroundColor: navigationTheme.colors.card,
266
268
  flexDirection: 'row',
267
- alignItems: 'center',
269
+ alignItems: 'flex-end',
268
270
  gap: 12,
269
271
  },
270
272
  textInputBoundary: {
@@ -287,6 +289,7 @@ const useMessageFormStyles = () => {
287
289
  justifyContent: 'center',
288
290
  flex: 1,
289
291
  fontSize: 16,
292
+ maxHeight: 200,
290
293
  },
291
294
  textInputWithGiphy: {
292
295
  paddingLeft: 0,
@@ -302,10 +305,13 @@ const useMessageFormStyles = () => {
302
305
  fontSize: 14,
303
306
  color: theme.colors.interaction,
304
307
  },
308
+ formButton: {
309
+ height: buttonSize,
310
+ },
305
311
  textInputSend: {
306
312
  borderRadius: 24,
307
- height: 36,
308
- width: 36,
313
+ height: buttonSize,
314
+ width: buttonSize,
309
315
  },
310
316
  attachmentPicker: {
311
317
  position: 'relative',
@@ -1 +1 @@
1
- {"version":3,"file":"message_form.js","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,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;AAKtC,OAAO,EAAE,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,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;YACnC,QAAQ,EAAE,EAAE;SACb;QACD,gBAAgB,EAAE;YAChB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,aAAa,EAAE,EAAE;SAClB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import {\n RouteProp,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} 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, MessageResource } from '../../types'\n\nimport { ConversationScreenProps } from '../../screens/conversation_screen'\n\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'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { useBroadcastTypingStatus } from '../../hooks/use_broadcast_typing_status'\n\nexport const MessageForm = {\n Root: MessageFormRoot,\n\n TextInput: MessageFormInput,\n SubmitButton: MessageFormSubmitBtn,\n AttachmentPicker: MessageFormAttachmentPicker,\n Commands: MessageFormCommands,\n}\n\ninterface MessagesFormRootProps extends ViewProps {\n conversation: ConversationResource\n currentlyEditingMessage?: MessageResource | null\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 currentlyEditingMessage?: MessageResource | null\n}>({\n text: '',\n setText: (_text: string) => {},\n onSubmit: () => {},\n disabled: false,\n canGiphy: false,\n usingGiphy: false,\n setUsingGiphy: (_usingGiphy: boolean) => {},\n currentlyEditingMessage: null,\n})\n\nconst GIPHY_MAX_LENGTH = 50\nconst MAX_MESSAGE_LENGTH = 5000\n\nfunction MessageFormRoot({\n conversation,\n currentlyEditingMessage,\n children,\n}: MessagesFormRootProps) {\n const { giphyApiKey } = useContext(ChatContext)\n const canGiphy = !!giphyApiKey && !currentlyEditingMessage\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 mutateAsync,\n } = useMessageCreateOrUpdate({\n conversationId: conversation.id,\n messageId: currentlyEditingMessage?.id || null,\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 navigation.setParams({\n editing_message_id: null,\n })\n }, [resetAttachmentUploader, resetMutation, navigation])\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 if (currentlyEditingMessage) {\n mutateAsync({ text }).then(reset)\n } else {\n mutateAsync({ text, attachments: attachmentsForSubmit }).then(reset)\n }\n }\n }\n\n useEffect(() => {\n if (currentlyEditingMessage) {\n setText(currentlyEditingMessage.text || '')\n }\n }, [currentlyEditingMessage])\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 currentlyEditingMessage,\n }}\n >\n <View style={styles.container}>\n <EditingIndicator />\n <View style={styles.textInputContainer}>{children}</View>\n </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 const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const conversationId = route.params.conversation_id\n const broadcastTypingStatus = useBroadcastTypingStatus(conversationId)\n\n const handleTextChange = (newText: string) => {\n setText(newText)\n\n if (newText.length > 0) {\n broadcastTypingStatus()\n }\n }\n\n return (\n <View style={styles.textInputBoundary}>\n <MessageFormAttachments />\n <View style={styles.textInputRow}>\n {usingGiphy ? (\n <View style={styles.giphyBadge}>\n <Text style={styles.giphyBadgeText}>/giphy</Text>\n </View>\n ) : null}\n\n <TextInput\n style={[styles.textInput, usingGiphy && styles.textInputWithGiphy]}\n multiline={true}\n aria-disabled={true}\n placeholder=\"Send a message\"\n onChangeText={handleTextChange}\n value={text}\n maxLength={usingGiphy ? GIPHY_MAX_LENGTH : MAX_MESSAGE_LENGTH}\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, currentlyEditingMessage } =\n 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 || currentlyEditingMessage) {\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\nfunction EditingIndicator() {\n const { currentlyEditingMessage } = React.useContext(MessageFormContext)\n const styles = useMessageFormStyles()\n const navigation = useNavigation()\n\n if (!currentlyEditingMessage) {\n return null\n }\n\n return (\n <View style={styles.editingIndicator}>\n <Text>Editing message</Text>\n <IconButton\n accessibilityLabel=\"Exit message editing\"\n name={'general.x'}\n onPress={() => navigation.setParams({ editing_message_id: null })}\n />\n </View>\n )\n}\n\nconst useMessageFormStyles = () => {\n const theme = useTheme()\n const navigationTheme = useNavigationTheme()\n\n return StyleSheet.create({\n container: {\n borderColor: theme.colors.fillColorNeutral050Base,\n borderTopWidth: 1,\n padding: 12,\n },\n textInputContainer: {\n backgroundColor: navigationTheme.colors.card,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n },\n textInputBoundary: {\n borderRadius: 24,\n borderWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n flex: 1,\n gap: 12,\n },\n textInputRow: {\n flexDirection: 'row',\n gap: 12,\n alignItems: 'center',\n },\n textInput: {\n paddingVertical: 8,\n paddingHorizontal: 20,\n color: theme.colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n flex: 1,\n fontSize: 16,\n },\n textInputWithGiphy: {\n paddingLeft: 0,\n },\n giphyBadge: {\n backgroundColor: theme.colors.fillColorNeutral050Base,\n borderRadius: 24,\n paddingHorizontal: 12,\n marginLeft: 12,\n padding: 4,\n },\n giphyBadgeText: {\n fontSize: 14,\n color: theme.colors.interaction,\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 editingIndicator: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n paddingBottom: 12,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"message_form.js","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EA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AC,MAAM,CAAC,uBAAuB;YACrD,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,CAAC;SACX;QACD,cAAc,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;SAChC;QACD,UAAU,EAAE;YACV,MAAM,EAAE,UAAU;SACnB;QACD,aAAa,EAAE;YACb,YAAY,EAAE,EAAE;YAChB,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,UAAU;SAClB;QACD,gBAAgB,EAAE;YAChB,QAAQ,EAAE,UAAU;SACrB;QACD,uBAAuB,EAAE;YACvB,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,GAAG,EAAE,EAAE;SACR;QACD,sBAAsB,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;QACD,gBAAgB,EAAE;YAChB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,aAAa,EAAE,EAAE;SAClB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import {\n RouteProp,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} 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, MessageResource } from '../../types'\n\nimport { ConversationScreenProps } from '../../screens/conversation_screen'\n\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'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { useBroadcastTypingStatus } from '../../hooks/use_broadcast_typing_status'\n\nexport const MessageForm = {\n Root: MessageFormRoot,\n\n TextInput: MessageFormInput,\n SubmitButton: MessageFormSubmitBtn,\n AttachmentPicker: MessageFormAttachmentPicker,\n Commands: MessageFormCommands,\n}\n\ninterface MessagesFormRootProps extends ViewProps {\n conversation: ConversationResource\n currentlyEditingMessage?: MessageResource | null\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 currentlyEditingMessage?: MessageResource | null\n}>({\n text: '',\n setText: (_text: string) => {},\n onSubmit: () => {},\n disabled: false,\n canGiphy: false,\n usingGiphy: false,\n setUsingGiphy: (_usingGiphy: boolean) => {},\n currentlyEditingMessage: null,\n})\n\nconst GIPHY_MAX_LENGTH = 50\nconst MAX_MESSAGE_LENGTH = 5000\n\nfunction MessageFormRoot({\n conversation,\n currentlyEditingMessage,\n children,\n}: MessagesFormRootProps) {\n const { giphyApiKey } = useContext(ChatContext)\n const canGiphy = !!giphyApiKey && !currentlyEditingMessage\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 mutateAsync,\n } = useMessageCreateOrUpdate({\n conversationId: conversation.id,\n messageId: currentlyEditingMessage?.id || null,\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 navigation.setParams({\n editing_message_id: null,\n })\n }, [resetAttachmentUploader, resetMutation, navigation])\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 if (currentlyEditingMessage) {\n mutateAsync({ text }).then(reset)\n } else {\n mutateAsync({ text, attachments: attachmentsForSubmit }).then(reset)\n }\n }\n }\n\n useEffect(() => {\n if (currentlyEditingMessage) {\n setText(currentlyEditingMessage.text || '')\n }\n }, [currentlyEditingMessage])\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 currentlyEditingMessage,\n }}\n >\n <View style={styles.container}>\n <EditingIndicator />\n <View style={styles.textInputContainer}>{children}</View>\n </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 const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const conversationId = route.params.conversation_id\n const broadcastTypingStatus = useBroadcastTypingStatus(conversationId)\n\n const handleTextChange = (newText: string) => {\n setText(newText)\n\n if (newText.length > 0) {\n broadcastTypingStatus()\n }\n }\n\n return (\n <View style={styles.textInputBoundary}>\n <MessageFormAttachments />\n <View style={styles.textInputRow}>\n {usingGiphy ? (\n <View style={styles.giphyBadge}>\n <Text style={styles.giphyBadgeText}>/giphy</Text>\n </View>\n ) : null}\n\n <TextInput\n style={[styles.textInput, usingGiphy && styles.textInputWithGiphy]}\n multiline={true}\n aria-disabled={true}\n placeholder=\"Send a message\"\n onChangeText={handleTextChange}\n value={text}\n maxLength={usingGiphy ? GIPHY_MAX_LENGTH : MAX_MESSAGE_LENGTH}\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, currentlyEditingMessage } =\n 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 || currentlyEditingMessage) {\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 style={styles.formButton}\n />\n </View>\n )\n}\n\nfunction MessageFormCommands() {\n const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)\n const styles = useMessageFormStyles()\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 style={styles.formButton}\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 style={styles.formButton}\n />\n )\n}\n\nfunction EditingIndicator() {\n const { currentlyEditingMessage } = React.useContext(MessageFormContext)\n const styles = useMessageFormStyles()\n const navigation = useNavigation()\n\n if (!currentlyEditingMessage) {\n return null\n }\n\n return (\n <View style={styles.editingIndicator}>\n <Text>Editing message</Text>\n <IconButton\n accessibilityLabel=\"Exit message editing\"\n name={'general.x'}\n onPress={() => navigation.setParams({ editing_message_id: null })}\n />\n </View>\n )\n}\n\nconst useMessageFormStyles = () => {\n const theme = useTheme()\n const navigationTheme = useNavigationTheme()\n const buttonSize = 36\n\n return StyleSheet.create({\n container: {\n borderColor: theme.colors.fillColorNeutral050Base,\n borderTopWidth: 1,\n padding: 12,\n },\n textInputContainer: {\n backgroundColor: navigationTheme.colors.card,\n flexDirection: 'row',\n alignItems: 'flex-end',\n gap: 12,\n },\n textInputBoundary: {\n borderRadius: 24,\n borderWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n flex: 1,\n gap: 12,\n },\n textInputRow: {\n flexDirection: 'row',\n gap: 12,\n alignItems: 'center',\n },\n textInput: {\n paddingVertical: 8,\n paddingHorizontal: 20,\n color: theme.colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n flex: 1,\n fontSize: 16,\n maxHeight: 200,\n },\n textInputWithGiphy: {\n paddingLeft: 0,\n },\n giphyBadge: {\n backgroundColor: theme.colors.fillColorNeutral050Base,\n borderRadius: 24,\n paddingHorizontal: 12,\n marginLeft: 12,\n padding: 4,\n },\n giphyBadgeText: {\n fontSize: 14,\n color: theme.colors.interaction,\n },\n formButton: {\n height: buttonSize,\n },\n textInputSend: {\n borderRadius: 24,\n height: buttonSize,\n width: buttonSize,\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 editingIndicator: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n paddingBottom: 12,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reactions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAO,MAAM,sBAAsB,EAAE,4BAMpC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,qBAkD7D"}
1
+ {"version":3,"file":"reactions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,eAAO,MAAM,sBAAsB,EAAE,4BAMpC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,qBA8D7D"}
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native';
2
+ import { StyleSheet, useWindowDimensions, View } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
  import { Avatar, Text } from '../components';
5
5
  import { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction';
6
6
  import { Tabs } from '../components/display/tabs';
7
7
  import { useSuspenseGet, useTheme } from '../hooks';
8
8
  import { useConversationMessages } from '../hooks/use_conversation_messages';
9
+ import { FlashList } from '@shopify/flash-list';
9
10
  export const ReactionsScreenOptions = {
10
11
  presentation: 'formSheet',
11
12
  headerShown: false,
@@ -28,12 +29,20 @@ export function ReactionsScreen({ route }) {
28
29
  const message = messages.find(m => m.id === message_id);
29
30
  const reactionCounts = message?.reactionCounts || [];
30
31
  const initialReactionCount = reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0];
31
- const [reactionCount, setReactionCount] = React.useState(initialReactionCount);
32
+ const [reactionCountValue, setReactionCountValue] = React.useState(initialReactionCount.value);
33
+ const reactionCount = reactionCounts.find(r => r.value === reactionCountValue);
34
+ if (!reactionCount) {
35
+ return (<View style={styles.errorContainer}>
36
+ <Text>No reactions found for this message.</Text>
37
+ </View>);
38
+ }
32
39
  const authorIds = reactionCount.authorIds;
33
- const authors = members.filter(member => authorIds.includes(member.id.toString()));
40
+ const authors = members.filter(member => authorIds.includes(member.id));
34
41
  return (<View style={styles.container}>
35
- <Tabs data={reactionCounts} activeTab={reactionCount} onTabPress={setReactionCount} renderItem={({ item }) => (<Reaction active={reactionCount.id === item.id} reaction={item} onPress={() => setReactionCount(item)}/>)} style={styles.actions}/>
36
- <FlatList data={authors} keyExtractor={item => item.id.toString()} renderItem={({ item: author }) => (<View style={styles.authorList}>
42
+ <Tabs data={reactionCounts} activeTab={reactionCount} onTabPress={item => {
43
+ setReactionCountValue(item.value);
44
+ }} renderItem={({ item }) => (<Reaction active={reactionCount.id === item.id} reaction={item} onPress={() => setReactionCountValue(item.value)}/>)} style={styles.actions}/>
45
+ <FlashList data={authors} keyExtractor={item => item.id.toString()} renderItem={({ item: author }) => (<View style={styles.authorList}>
37
46
  <Avatar size={'md'} sourceUri={author.avatar}/>
38
47
  <Text key={author.id}>{author.name}</Text>
39
48
  </View>)}/>
@@ -79,6 +88,13 @@ const useStyles = () => {
79
88
  borderBottomColor: theme.colors.fillColorNeutral040,
80
89
  borderBottomWidth: 1,
81
90
  },
91
+ errorContainer: {
92
+ flex: 1,
93
+ justifyContent: 'center',
94
+ alignItems: 'center',
95
+ padding: 16,
96
+ marginTop: 30,
97
+ },
82
98
  });
83
99
  };
84
100
  //# sourceMappingURL=reactions_screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactions_screen.js","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAChG,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,QA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,2BAA2B;YACzD,MAAM;YACN,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,OAAO,EAAE;YACP,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Avatar, Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { Tabs } from '../components/display/tabs'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { MemberResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\n\nexport const ReactionsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.5],\n sheetGrabberVisible: true,\n sheetCornerRadius: 16,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n reaction_value?: string\n}>\n\nexport function ReactionsScreen({ route }: ReactionScreenProps) {\n const { conversation_id, message_id, reaction_value } = route.params\n const styles = useStyles()\n\n const { messages } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${conversation_id}/members`,\n data: {\n fields: {\n Member: ['id', 'name', 'avatar', 'badges', 'child', 'role'],\n },\n },\n })\n const message = messages.find(m => m.id === message_id)\n const reactionCounts = message?.reactionCounts || []\n const initialReactionCount =\n reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0]\n const [reactionCount, setReactionCount] =\n React.useState<ReactionCountResource>(initialReactionCount)\n\n const authorIds = reactionCount.authorIds\n const authors = members.filter(member => authorIds.includes(member.id.toString()))\n\n return (\n <View style={styles.container}>\n <Tabs\n data={reactionCounts}\n activeTab={reactionCount}\n onTabPress={setReactionCount}\n renderItem={({ item }) => (\n <Reaction\n active={reactionCount.id === item.id}\n reaction={item}\n onPress={() => setReactionCount(item)}\n />\n )}\n style={styles.actions}\n />\n <FlatList\n data={authors}\n keyExtractor={item => item.id.toString()}\n renderItem={({ item: author }) => (\n <View style={styles.authorList}>\n <Avatar size={'md'} sourceUri={author.avatar} />\n <Text key={author.id}>{author.name}</Text>\n </View>\n )}\n />\n </View>\n )\n}\n\nconst Reaction = ({\n reaction,\n}: {\n active: boolean\n reaction: ReactionCountResource\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n return (\n <View key={reaction.value} style={styles.reaction}>\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n <Text style={reactionStyles.reactionEmoji}>{reaction.count}</Text>\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n gap: 8,\n },\n authorList: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 12,\n },\n reaction: {\n paddingVertical: 12,\n paddingHorizontal: 12,\n flexDirection: 'row',\n gap: 4,\n },\n actions: {\n minHeight: 48,\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"reactions_screen.js","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAChG,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAG5E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAiC;IAClE,YAAY,EAAE,WAAW;IACzB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,CAAC,GAAG,CAAC;IAC1B,mBAAmB,EAAE,IAAI;IACzB,iBAAiB,EAAE,EAAE;CACtB,CAAA;AAQD,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAuB;IAC5D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IACpE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,EAAE,QAAQ,EAAE,GAAG,uBAAuB,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAA;IAC5F,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,CAAmB;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AE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,OAAO,EAAE;YACP,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,EAAE;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Avatar, Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { Tabs } from '../components/display/tabs'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { MemberResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { FlashList } from '@shopify/flash-list'\n\nexport const ReactionsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.5],\n sheetGrabberVisible: true,\n sheetCornerRadius: 16,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n reaction_value?: string\n}>\n\nexport function ReactionsScreen({ route }: ReactionScreenProps) {\n const { conversation_id, message_id, reaction_value } = route.params\n const styles = useStyles()\n\n const { messages } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${conversation_id}/members`,\n data: {\n fields: {\n Member: ['id', 'name', 'avatar', 'badges', 'child', 'role'],\n },\n },\n })\n const message = messages.find(m => m.id === message_id)\n const reactionCounts = message?.reactionCounts || []\n const initialReactionCount =\n reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0]\n const [reactionCountValue, setReactionCountValue] = React.useState<\n ReactionCountResource['value']\n >(initialReactionCount.value)\n const reactionCount = reactionCounts.find(r => r.value === reactionCountValue)\n\n if (!reactionCount) {\n return (\n <View style={styles.errorContainer}>\n <Text>No reactions found for this message.</Text>\n </View>\n )\n }\n\n const authorIds = reactionCount.authorIds\n const authors = members.filter(member => authorIds.includes(member.id))\n\n return (\n <View style={styles.container}>\n <Tabs\n data={reactionCounts}\n activeTab={reactionCount}\n onTabPress={item => {\n setReactionCountValue(item.value)\n }}\n renderItem={({ item }) => (\n <Reaction\n active={reactionCount.id === item.id}\n reaction={item}\n onPress={() => setReactionCountValue(item.value)}\n />\n )}\n style={styles.actions}\n />\n <FlashList\n data={authors}\n keyExtractor={item => item.id.toString()}\n renderItem={({ item: author }) => (\n <View style={styles.authorList}>\n <Avatar size={'md'} sourceUri={author.avatar} />\n <Text key={author.id}>{author.name}</Text>\n </View>\n )}\n />\n </View>\n )\n}\n\nconst Reaction = ({\n reaction,\n}: {\n active: boolean\n reaction: ReactionCountResource\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n return (\n <View key={reaction.value} style={styles.reaction}>\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n <Text style={reactionStyles.reactionEmoji}>{reaction.count}</Text>\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n gap: 8,\n },\n authorList: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 12,\n },\n reaction: {\n paddingVertical: 12,\n paddingHorizontal: 12,\n flexDirection: 'row',\n gap: 4,\n },\n actions: {\n minHeight: 48,\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n errorContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 16,\n marginTop: 30,\n },\n })\n}\n"]}
@@ -5,6 +5,6 @@ export interface ReactionCountResource {
5
5
  count: number;
6
6
  mine: number;
7
7
  messageId: string;
8
- authorIds: string[];
8
+ authorIds: number[];
9
9
  }
10
10
  //# sourceMappingURL=reaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../src/types/resources/reaction.ts"],"names":[],"mappings":"","sourcesContent":["export interface ReactionCountResource {\n type: 'ReactionCount'\n id: string\n value: 'thumbs_up' | 'thumbs_down' | 'pray' | 'laugh' | 'heart'\n count: number\n mine: number\n messageId: string\n authorIds: string[] // These is in fact a string array\n}\n"]}
1
+ {"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../src/types/resources/reaction.ts"],"names":[],"mappings":"","sourcesContent":["export interface ReactionCountResource {\n type: 'ReactionCount'\n id: string\n value: 'thumbs_up' | 'thumbs_down' | 'pray' | 'laugh' | 'heart'\n count: number\n mine: number\n messageId: string\n authorIds: number[]\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  export function transformReactionEventDataToReactionCountResource({ data, oldData, event, currentPersonId, }) {
2
2
  let authorIds = new Set(oldData?.authorIds || []);
3
3
  if (event === 'reaction.created') {
4
- authorIds.add(data.author_id.toString());
4
+ authorIds.add(data.author_id);
5
5
  }
6
6
  else if (event === 'reaction.destroyed') {
7
- authorIds.delete(data.author_id.toString());
7
+ authorIds.delete(data.author_id);
8
8
  }
9
- const mine = authorIds.has(currentPersonId.toString());
9
+ const mine = authorIds.has(currentPersonId);
10
10
  return {
11
11
  type: 'ReactionCount',
12
12
  id: `${data.message_sort_key}/${data.value}`,
@@ -1 +1 @@
1
- {"version":3,"file":"transform_reaction_event_data_to_reaction_count_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,iDAAiD,CAAC,EAChE,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,GACT;IACN,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,IAAI,KAAK,KAAK,kBAAkB,EAAE,CAAC;QACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,IAAI,KAAK,KAAK,oBAAoB,EAAE,CAAC;QAC1C,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,EAAE;QAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC,gBAAgB;QAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;KACjC,CAAA;AACH,CAAC","sourcesContent":["import { JoltReactionEvent } from '../../types/jolt_events'\nimport { ReactionCreatedEvent } from '../../types/jolt_events/reaction_events'\nimport { ReactionCountResource } from '../../types/resources/reaction'\n\ninterface Props {\n data: ReactionCreatedEvent['data']['data']\n oldData?: ReactionCountResource\n event: JoltReactionEvent['event']\n currentPersonId: number\n}\n\nexport function transformReactionEventDataToReactionCountResource({\n data,\n oldData,\n event,\n currentPersonId,\n}: Props): ReactionCountResource {\n let authorIds = new Set(oldData?.authorIds || [])\n if (event === 'reaction.created') {\n authorIds.add(data.author_id.toString())\n } else if (event === 'reaction.destroyed') {\n authorIds.delete(data.author_id.toString())\n }\n\n const mine = authorIds.has(currentPersonId.toString())\n\n return {\n type: 'ReactionCount',\n id: `${data.message_sort_key}/${data.value}`,\n value: data.value,\n count: data.count,\n mine: mine ? 1 : 0,\n messageId: data.message_sort_key,\n authorIds: Array.from(authorIds),\n }\n}\n"]}
1
+ {"version":3,"file":"transform_reaction_event_data_to_reaction_count_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,iDAAiD,CAAC,EAChE,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,GACT;IACN,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,IAAI,KAAK,KAAK,kBAAkB,EAAE,CAAC;QACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC/B,CAAC;SAAM,IAAI,KAAK,KAAK,oBAAoB,EAAE,CAAC;QAC1C,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAClC,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAE3C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,EAAE;QAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC,gBAAgB;QAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;KACjC,CAAA;AACH,CAAC","sourcesContent":["import { JoltReactionEvent } from '../../types/jolt_events'\nimport { ReactionCreatedEvent } from '../../types/jolt_events/reaction_events'\nimport { ReactionCountResource } from '../../types/resources/reaction'\n\ninterface Props {\n data: ReactionCreatedEvent['data']['data']\n oldData?: ReactionCountResource\n event: JoltReactionEvent['event']\n currentPersonId: number\n}\n\nexport function transformReactionEventDataToReactionCountResource({\n data,\n oldData,\n event,\n currentPersonId,\n}: Props): ReactionCountResource {\n let authorIds = new Set(oldData?.authorIds || [])\n if (event === 'reaction.created') {\n authorIds.add(data.author_id)\n } else if (event === 'reaction.destroyed') {\n authorIds.delete(data.author_id)\n }\n\n const mine = authorIds.has(currentPersonId)\n\n return {\n type: 'ReactionCount',\n id: `${data.message_sort_key}/${data.value}`,\n value: data.value,\n count: data.count,\n mine: mine ? 1 : 0,\n messageId: data.message_sort_key,\n authorIds: Array.from(authorIds),\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.7.0-rc.2",
3
+ "version": "3.7.0-rc.4",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "prettier": "^3.4.2",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "3b71fbd4d157d71bc2f29676b6f2c3b3d274afff"
58
+ "gitHead": "1184732da9ddda124d8a5bbb1e633fbb7136c66f"
59
59
  }
@@ -352,6 +352,7 @@ function MessageFormAttachmentPicker() {
352
352
  appearance="neutral"
353
353
  name={'general.outlinedPlusCircle'}
354
354
  onPress={() => setIsOpen(!isOpen)}
355
+ style={styles.formButton}
355
356
  />
356
357
  </View>
357
358
  )
@@ -359,6 +360,7 @@ function MessageFormAttachmentPicker() {
359
360
 
360
361
  function MessageFormCommands() {
361
362
  const { text, canGiphy, usingGiphy, setUsingGiphy } = React.useContext(MessageFormContext)
363
+ const styles = useMessageFormStyles()
362
364
 
363
365
  if (!canGiphy) {
364
366
  return null
@@ -372,6 +374,7 @@ function MessageFormCommands() {
372
374
  appearance="neutral"
373
375
  name={'general.x'}
374
376
  onPress={() => setUsingGiphy(false)}
377
+ style={styles.formButton}
375
378
  />
376
379
  )
377
380
  }
@@ -384,6 +387,7 @@ function MessageFormCommands() {
384
387
  name={'general.bolt'}
385
388
  onPress={() => setUsingGiphy(true)}
386
389
  disabled={text.length > GIPHY_MAX_LENGTH}
390
+ style={styles.formButton}
387
391
  />
388
392
  )
389
393
  }
@@ -412,6 +416,7 @@ function EditingIndicator() {
412
416
  const useMessageFormStyles = () => {
413
417
  const theme = useTheme()
414
418
  const navigationTheme = useNavigationTheme()
419
+ const buttonSize = 36
415
420
 
416
421
  return StyleSheet.create({
417
422
  container: {
@@ -422,7 +427,7 @@ const useMessageFormStyles = () => {
422
427
  textInputContainer: {
423
428
  backgroundColor: navigationTheme.colors.card,
424
429
  flexDirection: 'row',
425
- alignItems: 'center',
430
+ alignItems: 'flex-end',
426
431
  gap: 12,
427
432
  },
428
433
  textInputBoundary: {
@@ -445,6 +450,7 @@ const useMessageFormStyles = () => {
445
450
  justifyContent: 'center',
446
451
  flex: 1,
447
452
  fontSize: 16,
453
+ maxHeight: 200,
448
454
  },
449
455
  textInputWithGiphy: {
450
456
  paddingLeft: 0,
@@ -460,10 +466,13 @@ const useMessageFormStyles = () => {
460
466
  fontSize: 14,
461
467
  color: theme.colors.interaction,
462
468
  },
469
+ formButton: {
470
+ height: buttonSize,
471
+ },
463
472
  textInputSend: {
464
473
  borderRadius: 24,
465
- height: 36,
466
- width: 36,
474
+ height: buttonSize,
475
+ width: buttonSize,
467
476
  },
468
477
  attachmentPicker: {
469
478
  position: 'relative',
@@ -1,7 +1,7 @@
1
1
  import { StaticScreenProps } from '@react-navigation/native'
2
2
  import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
3
3
  import React from 'react'
4
- import { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native'
4
+ import { StyleSheet, useWindowDimensions, View } from 'react-native'
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
6
6
  import { Avatar, Text } from '../components'
7
7
  import { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'
@@ -10,6 +10,7 @@ import { useSuspenseGet, useTheme } from '../hooks'
10
10
  import { useConversationMessages } from '../hooks/use_conversation_messages'
11
11
  import { MemberResource } from '../types'
12
12
  import { ReactionCountResource } from '../types/resources/reaction'
13
+ import { FlashList } from '@shopify/flash-list'
13
14
 
14
15
  export const ReactionsScreenOptions: NativeStackNavigationOptions = {
15
16
  presentation: 'formSheet',
@@ -42,28 +43,40 @@ export function ReactionsScreen({ route }: ReactionScreenProps) {
42
43
  const reactionCounts = message?.reactionCounts || []
43
44
  const initialReactionCount =
44
45
  reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0]
45
- const [reactionCount, setReactionCount] =
46
- React.useState<ReactionCountResource>(initialReactionCount)
46
+ const [reactionCountValue, setReactionCountValue] = React.useState<
47
+ ReactionCountResource['value']
48
+ >(initialReactionCount.value)
49
+ const reactionCount = reactionCounts.find(r => r.value === reactionCountValue)
50
+
51
+ if (!reactionCount) {
52
+ return (
53
+ <View style={styles.errorContainer}>
54
+ <Text>No reactions found for this message.</Text>
55
+ </View>
56
+ )
57
+ }
47
58
 
48
59
  const authorIds = reactionCount.authorIds
49
- const authors = members.filter(member => authorIds.includes(member.id.toString()))
60
+ const authors = members.filter(member => authorIds.includes(member.id))
50
61
 
51
62
  return (
52
63
  <View style={styles.container}>
53
64
  <Tabs
54
65
  data={reactionCounts}
55
66
  activeTab={reactionCount}
56
- onTabPress={setReactionCount}
67
+ onTabPress={item => {
68
+ setReactionCountValue(item.value)
69
+ }}
57
70
  renderItem={({ item }) => (
58
71
  <Reaction
59
72
  active={reactionCount.id === item.id}
60
73
  reaction={item}
61
- onPress={() => setReactionCount(item)}
74
+ onPress={() => setReactionCountValue(item.value)}
62
75
  />
63
76
  )}
64
77
  style={styles.actions}
65
78
  />
66
- <FlatList
79
+ <FlashList
67
80
  data={authors}
68
81
  keyExtractor={item => item.id.toString()}
69
82
  renderItem={({ item: author }) => (
@@ -128,5 +141,12 @@ const useStyles = () => {
128
141
  borderBottomColor: theme.colors.fillColorNeutral040,
129
142
  borderBottomWidth: 1,
130
143
  },
144
+ errorContainer: {
145
+ flex: 1,
146
+ justifyContent: 'center',
147
+ alignItems: 'center',
148
+ padding: 16,
149
+ marginTop: 30,
150
+ },
131
151
  })
132
152
  }
@@ -5,5 +5,5 @@ export interface ReactionCountResource {
5
5
  count: number
6
6
  mine: number
7
7
  messageId: string
8
- authorIds: string[] // These is in fact a string array
8
+ authorIds: number[]
9
9
  }
@@ -17,12 +17,12 @@ export function transformReactionEventDataToReactionCountResource({
17
17
  }: Props): ReactionCountResource {
18
18
  let authorIds = new Set(oldData?.authorIds || [])
19
19
  if (event === 'reaction.created') {
20
- authorIds.add(data.author_id.toString())
20
+ authorIds.add(data.author_id)
21
21
  } else if (event === 'reaction.destroyed') {
22
- authorIds.delete(data.author_id.toString())
22
+ authorIds.delete(data.author_id)
23
23
  }
24
24
 
25
- const mine = authorIds.has(currentPersonId.toString())
25
+ const mine = authorIds.has(currentPersonId)
26
26
 
27
27
  return {
28
28
  type: 'ReactionCount',