stream-chat-react-native-core 5.11.0 → 5.11.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/lib/commonjs/components/MessageList/MessageList.js +22 -22
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/MessageList/MessageList.js +22 -22
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/package.json +1 -1
- package/src/components/MessageList/MessageList.tsx +13 -7
- package/src/version.json +1 -1
|
@@ -704,26 +704,27 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
704
704
|
data: messageList
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
-
var
|
|
707
|
+
var shouldApplyAndroidWorkaround = inverted && _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 33;
|
|
708
|
+
var renderListEmptyComponent = (0, _react.useCallback)(function () {
|
|
708
709
|
return _react["default"].createElement(_reactNative.View, {
|
|
709
|
-
style: [styles.flex, styles.invert],
|
|
710
|
+
style: [styles.flex, shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert],
|
|
710
711
|
testID: "empty-state",
|
|
711
712
|
__self: _this,
|
|
712
713
|
__source: {
|
|
713
714
|
fileName: _jsxFileName,
|
|
714
|
-
lineNumber:
|
|
715
|
-
columnNumber:
|
|
715
|
+
lineNumber: 964,
|
|
716
|
+
columnNumber: 7
|
|
716
717
|
}
|
|
717
718
|
}, _react["default"].createElement(EmptyStateIndicator, {
|
|
718
719
|
listType: "message",
|
|
719
720
|
__self: _this,
|
|
720
721
|
__source: {
|
|
721
722
|
fileName: _jsxFileName,
|
|
722
|
-
lineNumber:
|
|
723
|
-
columnNumber:
|
|
723
|
+
lineNumber: 968,
|
|
724
|
+
columnNumber: 9
|
|
724
725
|
}
|
|
725
726
|
}));
|
|
726
|
-
};
|
|
727
|
+
}, [EmptyStateIndicator, shouldApplyAndroidWorkaround]);
|
|
727
728
|
if (!FlatList) return null;
|
|
728
729
|
if (loading) {
|
|
729
730
|
return _react["default"].createElement(_reactNative.View, {
|
|
@@ -731,7 +732,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
731
732
|
__self: _this,
|
|
732
733
|
__source: {
|
|
733
734
|
fileName: _jsxFileName,
|
|
734
|
-
lineNumber:
|
|
735
|
+
lineNumber: 978,
|
|
735
736
|
columnNumber: 7
|
|
736
737
|
}
|
|
737
738
|
}, _react["default"].createElement(LoadingIndicator, {
|
|
@@ -739,7 +740,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
739
740
|
__self: _this,
|
|
740
741
|
__source: {
|
|
741
742
|
fileName: _jsxFileName,
|
|
742
|
-
lineNumber:
|
|
743
|
+
lineNumber: 979,
|
|
743
744
|
columnNumber: 9
|
|
744
745
|
}
|
|
745
746
|
}));
|
|
@@ -751,7 +752,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
751
752
|
__self: _this,
|
|
752
753
|
__source: {
|
|
753
754
|
fileName: _jsxFileName,
|
|
754
|
-
lineNumber:
|
|
755
|
+
lineNumber: 986,
|
|
755
756
|
columnNumber: 30
|
|
756
757
|
}
|
|
757
758
|
});
|
|
@@ -760,13 +761,12 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
760
761
|
__self: _this,
|
|
761
762
|
__source: {
|
|
762
763
|
fileName: _jsxFileName,
|
|
763
|
-
lineNumber:
|
|
764
|
+
lineNumber: 987,
|
|
764
765
|
columnNumber: 46
|
|
765
766
|
}
|
|
766
767
|
});
|
|
767
768
|
return null;
|
|
768
769
|
};
|
|
769
|
-
var shouldApplyAndroidWorkaround = inverted && _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 33;
|
|
770
770
|
return _react["default"].createElement(_reactNative.View, {
|
|
771
771
|
style: [styles.container, {
|
|
772
772
|
backgroundColor: white_snow
|
|
@@ -775,7 +775,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
775
775
|
__self: _this,
|
|
776
776
|
__source: {
|
|
777
777
|
fileName: _jsxFileName,
|
|
778
|
-
lineNumber:
|
|
778
|
+
lineNumber: 992,
|
|
779
779
|
columnNumber: 5
|
|
780
780
|
}
|
|
781
781
|
}, _react["default"].createElement(FlatList, (0, _extends2["default"])({
|
|
@@ -811,13 +811,13 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
811
811
|
__self: _this,
|
|
812
812
|
__source: {
|
|
813
813
|
fileName: _jsxFileName,
|
|
814
|
-
lineNumber:
|
|
814
|
+
lineNumber: 996,
|
|
815
815
|
columnNumber: 7
|
|
816
816
|
}
|
|
817
817
|
})), !loading && _react["default"].createElement(_react["default"].Fragment, {
|
|
818
818
|
__source: {
|
|
819
819
|
fileName: _jsxFileName,
|
|
820
|
-
lineNumber:
|
|
820
|
+
lineNumber: 1035,
|
|
821
821
|
columnNumber: 9
|
|
822
822
|
}
|
|
823
823
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -825,28 +825,28 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
825
825
|
__self: _this,
|
|
826
826
|
__source: {
|
|
827
827
|
fileName: _jsxFileName,
|
|
828
|
-
lineNumber:
|
|
828
|
+
lineNumber: 1036,
|
|
829
829
|
columnNumber: 11
|
|
830
830
|
}
|
|
831
831
|
}, _react["default"].createElement(StickyHeaderComponent, {
|
|
832
832
|
__self: _this,
|
|
833
833
|
__source: {
|
|
834
834
|
fileName: _jsxFileName,
|
|
835
|
-
lineNumber:
|
|
835
|
+
lineNumber: 1037,
|
|
836
836
|
columnNumber: 13
|
|
837
837
|
}
|
|
838
838
|
})), !disableTypingIndicator && TypingIndicator && _react["default"].createElement(TypingIndicatorContainer, {
|
|
839
839
|
__self: _this,
|
|
840
840
|
__source: {
|
|
841
841
|
fileName: _jsxFileName,
|
|
842
|
-
lineNumber:
|
|
842
|
+
lineNumber: 1040,
|
|
843
843
|
columnNumber: 13
|
|
844
844
|
}
|
|
845
845
|
}, _react["default"].createElement(TypingIndicator, {
|
|
846
846
|
__self: _this,
|
|
847
847
|
__source: {
|
|
848
848
|
fileName: _jsxFileName,
|
|
849
|
-
lineNumber:
|
|
849
|
+
lineNumber: 1041,
|
|
850
850
|
columnNumber: 15
|
|
851
851
|
}
|
|
852
852
|
})), _react["default"].createElement(ScrollToBottomButton, {
|
|
@@ -856,14 +856,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
856
856
|
__self: _this,
|
|
857
857
|
__source: {
|
|
858
858
|
fileName: _jsxFileName,
|
|
859
|
-
lineNumber:
|
|
859
|
+
lineNumber: 1044,
|
|
860
860
|
columnNumber: 11
|
|
861
861
|
}
|
|
862
862
|
})), _react["default"].createElement(NetworkDownIndicator, {
|
|
863
863
|
__self: _this,
|
|
864
864
|
__source: {
|
|
865
865
|
fileName: _jsxFileName,
|
|
866
|
-
lineNumber:
|
|
866
|
+
lineNumber: 1051,
|
|
867
867
|
columnNumber: 7
|
|
868
868
|
}
|
|
869
869
|
}));
|
|
@@ -970,7 +970,7 @@ var MessageList = function MessageList(props) {
|
|
|
970
970
|
__self: _this,
|
|
971
971
|
__source: {
|
|
972
972
|
fileName: _jsxFileName,
|
|
973
|
-
lineNumber:
|
|
973
|
+
lineNumber: 1109,
|
|
974
974
|
columnNumber: 5
|
|
975
975
|
}
|
|
976
976
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","container","alignItems","flex","width","contentContainer","flexGrow","paddingBottom","invert","transform","scaleY","invertAndroid","scaleX","listContainer","messagePadding","paddingHorizontal","stickyHeader","position","top","InvertedCellRendererComponent","props","keyExtractor","item","id","created_at","toISOString","Date","now","toString","flatListViewabilityConfig","viewAreaCoveragePercentThreshold","MessageListWithContext","LoadingMoreIndicator","threadList","InlineLoadingMoreThreadIndicator","InlineLoadingMoreIndicator","additionalFlatListProps","channel","client","closePicker","DateHeader","disabled","disableTypingIndicator","EmptyStateIndicator","FlatList","FooterComponent","hasNoMoreRecentMessagesToLoad","HeaderComponent","InlineLoadingMoreRecentIndicator","hideStickyDateHeader","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","inverted","isListActive","legacyImageViewerSwipeBehaviour","loadChannelAroundMessage","loading","LoadingIndicator","loadMore","loadMoreRecent","loadMoreThread","markRead","Message","MessageSystem","myMessageTheme","NetworkDownIndicator","noGroupByUser","onListScroll","onThreadSelect","overlay","reloadChannel","ScrollToBottomButton","scrollToFirstUnreadThreshold","selectedPicker","setFlatListRef","setMessages","setSelectedPicker","setTargetedMessage","StickyHeader","targetedMessage","tDateTimeParser","thread","TypingIndicator","TypingIndicatorContainer","useTheme","theme","white_snow","colors","messageList","modifiedTheme","useMemo","mergeThemes","style","useMessageList","messageListLengthBeforeUpdate","useRef","messageListLengthAfterUpdate","length","topMessageBeforeUpdate","topMessageAfterUpdate","useState","autoscrollToTop","setAutoscrollToTop","onStartReachedTracker","onEndReachedTracker","onStartReachedInPromise","onEndReachedInPromise","flatListRef","initialScrollSet","channelResyncScrollSet","scrollToDebounceTimeoutRef","messageIdToScrollToRef","messageIdLastScrolledToRef","hasMoved","setHasMoved","getLastReceivedMessage","lastReceivedId","setLastReceivedId","scrollToBottomButtonVisible","setScrollToBottomButtonVisible","stickyHeaderDate","setStickyHeaderDate","stickyHeaderDateRef","isUnreadMessageRef","message","lastRead","channelLastReadRef","initialized","undefined","useEffect","current","updateStickyHeaderDateIfNeeded","viewableItems","lastItem","pop","isMessageTypeDeleted","type","toDateString","onViewableItemsChanged","Platform","OS","resetPaginationTrackersRef","shouldMarkReadOnFirstLoad","countUnread","lastReceivedMessage","hasNewMessage","isMyMessage","user","userID","scrollToBottomIfNeeded","setTimeout","scrollToOffset","offset","maybeCallOnStartReached","renderItem","index","offlineMode","lastMessage","showUnreadUnderlay","insertInlineUnreadIndicator","wrapMessageInTheme","goToMessage","isMessageWithStylesReadByAndDateSeparator","groupStyles","dateSeparator","quoted_message_id","limit","callback","Promise","resolve","onError","then","maybeCallOnEndReached","handleScroll","event","nativeEvent","contentOffset","y","visibleLength","layoutMeasurement","height","contentLength","contentSize","isScrollAtStart","isScrollAtEnd","isScrollAtBottom","showScrollToBottomButton","shouldMarkRead","goToNewMessages","onScrollToIndexFailedRef","info","animated","averageItemLength","scrollToIndex","viewPosition","useCallback","messageId","indexOfParentInMessageList","findIndex","clearTimeout","messageIdToScroll","messagesWithImages","filter","attachments","some","attachment","title_link","og_scrape_url","image_url","thumb_url","imageString","map","join","numberOfMessagesWithImages","threadExists","stickyHeaderFormatDate","getFullYear","tStickyHeaderDate","stickyHeaderDateString","isDayOrMoment","format","dismissImagePicker","onScrollBeginDrag","onScrollEndDrag","refCallback","ref","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","setEventType","setSendEventParams","action","data","renderListEmptyComponent","StickyHeaderComponent","shouldApplyAndroidWorkaround","Version","backgroundColor","autoscrollToTopThreshold","minIndexForVisible","MessageList","useAttachmentPickerContext","useChannelContext","enableMessageGroupingByUser","error","isChannelActive","useChatContext","useImageGalleryContext","useMessagesContext","usePaginatedMessageListContext","useOverlayContext","useThreadContext","useTranslationContext","t"],"sources":["MessageList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n FlatListProps,\n FlatList as FlatListType,\n Platform,\n ScrollViewProps,\n StyleSheet,\n View,\n ViewToken,\n} from 'react-native';\n\nimport type { Channel as StreamChannel } from 'stream-chat';\n\nimport {\n isMessageWithStylesReadByAndDateSeparator,\n MessageType,\n useMessageList,\n} from './hooks/useMessageList';\nimport { InlineLoadingMoreIndicator } from './InlineLoadingMoreIndicator';\nimport { InlineLoadingMoreRecentIndicator } from './InlineLoadingMoreRecentIndicator';\nimport { InlineLoadingMoreThreadIndicator } from './InlineLoadingMoreThreadIndicator';\nimport { getLastReceivedMessage } from './utils/getLastReceivedMessage';\n\nimport {\n AttachmentPickerContextValue,\n useAttachmentPickerContext,\n} from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../contexts/channelContext/ChannelContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport {\n ImageGalleryContextValue,\n useImageGalleryContext,\n} from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport {\n PaginatedMessageListContextValue,\n usePaginatedMessageListContext,\n} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { ThreadContextValue, useThreadContext } from '../../contexts/threadContext/ThreadContext';\nimport {\n isDayOrMoment,\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flex: 1,\n width: '100%',\n },\n contentContainer: {\n flexGrow: 1,\n /**\n * paddingBottom is set to 4 to account for the default date\n * header and inline indicator alignment. The top margin is 8\n * on the header but 4 on the inline date, this adjusts the spacing\n * to allow the \"first\" inline date to align with the date header.\n */\n paddingBottom: 4,\n },\n flex: { flex: 1 },\n invert: { transform: [{ scaleY: -1 }] },\n invertAndroid: {\n // Invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13\n // details: https://github.com/Expensify/App/pull/12820\n transform: [{ scaleX: -1 }, { scaleY: -1 }],\n },\n listContainer: {\n flex: 1,\n width: '100%',\n },\n messagePadding: {\n paddingHorizontal: 8,\n },\n stickyHeader: {\n position: 'absolute',\n top: 0,\n },\n});\n\nconst InvertedCellRendererComponent = (props: React.PropsWithChildren<unknown>) => (\n <View {...props} style={styles.invertAndroid} />\n);\n\nconst keyExtractor = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n item: MessageType<StreamChatGenerics>,\n) => {\n if (item.id) return item.id;\n if (item.created_at)\n return typeof item.created_at === 'string' ? item.created_at : item.created_at.toISOString();\n return Date.now().toString();\n};\n\nconst flatListViewabilityConfig = {\n viewAreaCoveragePercentThreshold: 1,\n};\n\ntype MessageListPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> &\n Pick<\n ChannelContextValue<StreamChatGenerics>,\n | 'channel'\n | 'disabled'\n | 'EmptyStateIndicator'\n | 'hideStickyDateHeader'\n | 'loadChannelAroundMessage'\n | 'loading'\n | 'LoadingIndicator'\n | 'markRead'\n | 'NetworkDownIndicator'\n | 'reloadChannel'\n | 'scrollToFirstUnreadThreshold'\n | 'setTargetedMessage'\n | 'StickyHeader'\n | 'targetedMessage'\n > &\n Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &\n Pick<\n PaginatedMessageListContextValue<StreamChatGenerics>,\n 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'\n > &\n Pick<OverlayContextValue, 'overlay'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'DateHeader'\n | 'disableTypingIndicator'\n | 'FlatList'\n | 'initialScrollToFirstUnreadMessage'\n | 'InlineDateSeparator'\n | 'InlineUnreadIndicator'\n | 'legacyImageViewerSwipeBehaviour'\n | 'Message'\n | 'ScrollToBottomButton'\n | 'MessageSystem'\n | 'myMessageTheme'\n | 'TypingIndicator'\n | 'TypingIndicatorContainer'\n > &\n Pick<ThreadContextValue<StreamChatGenerics>, 'loadMoreThread' | 'thread'> &\n Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {\n /**\n * Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want\n * to attach some additional props to underlying FlatList, you can add it to following prop.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **NOTE** Don't use `additionalFlatListProps` to get access to ref of flatlist. Use `setFlatListRef` instead.\n *\n * e.g.\n * ```js\n * <MessageList\n * additionalFlatListProps={{ bounces: true, keyboardDismissMode: true }} />\n * ```\n */\n additionalFlatListProps?: Partial<FlatListProps<MessageType<StreamChatGenerics>>>;\n /**\n * UI component for footer of message list. By default message list will use `InlineLoadingMoreIndicator`\n * as FooterComponent. If you want to implement your own inline loading indicator, you can access `loadingMore`\n * from context.\n *\n * This is a [ListHeaderComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header by default if inverted is true or defaulted\n */\n FooterComponent?: React.ComponentType;\n /**\n * UI component for header of message list. By default message list will use `InlineLoadingMoreRecentIndicator`\n * as HeaderComponent. If you want to implement your own inline loading indicator, you can access `loadingMoreRecent`\n * from context.\n *\n * This is a [ListFooterComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header if inverted is false\n */\n HeaderComponent?: React.ComponentType;\n /** Whether or not the FlatList is inverted. Defaults to true */\n inverted?: boolean;\n isListActive?: boolean;\n /** Turn off grouping of messages by user */\n noGroupByUser?: boolean;\n onListScroll?: ScrollViewProps['onScroll'];\n /**\n * Handler to open the thread on message. This is callback for touch event for replies button.\n *\n * @param message A message object to open the thread upon.\n */\n onThreadSelect?: (message: ThreadContextValue<StreamChatGenerics>['thread']) => void;\n /**\n * Use `setFlatListRef` to get access to ref to inner FlatList.\n *\n * e.g.\n * ```js\n * <MessageList\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef?: (ref: FlatListType<MessageType<StreamChatGenerics>> | null) => void;\n /**\n * Boolean whether or not the Messages in the MessageList are part of a Thread\n **/\n threadList?: boolean;\n };\n\n/**\n * The message list component renders a list of messages. It consumes the following contexts:\n *\n * [ChannelContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/channel-context/)\n * [ChatContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/chat-context/)\n * [MessagesContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/)\n * [ThreadContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/thread-context/)\n * [TranslationContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/translation-context/)\n */\nconst MessageListWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListPropsWithContext<StreamChatGenerics>,\n) => {\n const LoadingMoreIndicator = props.threadList\n ? InlineLoadingMoreThreadIndicator\n : InlineLoadingMoreIndicator;\n const {\n additionalFlatListProps,\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n FlatList,\n FooterComponent = LoadingMoreIndicator,\n hasNoMoreRecentMessagesToLoad,\n HeaderComponent = InlineLoadingMoreRecentIndicator,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n inverted = true,\n isListActive = false,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n noGroupByUser,\n onListScroll,\n onThreadSelect,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setFlatListRef,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n tDateTimeParser,\n thread,\n threadList = false,\n TypingIndicator,\n TypingIndicatorContainer,\n } = props;\n\n const { theme } = useTheme();\n\n const {\n colors: { white_snow },\n messageList: { container, contentContainer, listContainer },\n } = theme;\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageTheme, theme],\n );\n\n const messageList = useMessageList<StreamChatGenerics>({\n noGroupByUser,\n threadList,\n });\n const messageListLengthBeforeUpdate = useRef(0);\n const messageListLengthAfterUpdate = messageList.length;\n\n /**\n * We need topMessage and channelLastRead values to set the initial scroll position.\n * So these values only get used if `initialScrollToFirstUnreadMessage` prop is true.\n */\n const topMessageBeforeUpdate = useRef<MessageType<StreamChatGenerics>>();\n const topMessageAfterUpdate = messageList[messageList.length - 1];\n\n const [autoscrollToTop, setAutoscrollToTop] = useState(false);\n\n /**\n * We want to call onEndReached and onStartReached only once, per content length.\n * We keep track of calls to these functions per content length, with following trackers.\n */\n const onStartReachedTracker = useRef<Record<number, boolean>>({});\n const onEndReachedTracker = useRef<Record<number, boolean>>({});\n\n const onStartReachedInPromise = useRef<Promise<void> | null>(null);\n const onEndReachedInPromise = useRef<Promise<void> | null>(null);\n\n const flatListRef = useRef<FlatListType<MessageType<StreamChatGenerics>> | null>(null);\n\n /**\n * Flag to track if the initial scroll has been set\n * If the prop `initialScrollToFirstUnreadMessage` was enabled, then we scroll to the unread msg and set it to true\n * If not, the default offset of 0 for flatList means that it has been set already\n */\n const initialScrollSet = useRef<boolean>(!initialScrollToFirstUnreadMessage);\n\n const channelResyncScrollSet = useRef<boolean>(true);\n\n /**\n * The timeout id used to debounce our scrollToIndex calls on messageList updates\n */\n const scrollToDebounceTimeoutRef = useRef<NodeJS.Timeout>();\n\n /**\n * If a messageId was requested to scroll to but was unloaded,\n * this flag keeps track of it to scroll to it after loading the message\n */\n const messageIdToScrollToRef = useRef<string>();\n /**\n * Last messageID that was scrolled to after loading a new message list,\n * this flag keeps track of it so that we dont scroll to it again on target message set\n */\n const messageIdLastScrolledToRef = useRef<string>();\n const [hasMoved, setHasMoved] = useState(false);\n const [lastReceivedId, setLastReceivedId] = useState(getLastReceivedMessage(messageList)?.id);\n const [scrollToBottomButtonVisible, setScrollToBottomButtonVisible] = useState(false);\n\n const [stickyHeaderDate, setStickyHeaderDate] = useState<Date | undefined>();\n const stickyHeaderDateRef = useRef<Date | undefined>();\n\n const isUnreadMessageRef = useRef(\n (\n message: MessageType<StreamChatGenerics> | undefined,\n lastRead?: ReturnType<StreamChannel<StreamChatGenerics>['lastRead']>,\n ) => message && lastRead && message.created_at && lastRead < message.created_at,\n );\n\n const channelLastReadRef = useRef(channel?.initialized ? channel.lastRead() : undefined);\n\n useEffect(() => {\n channelLastReadRef.current = channel?.initialized ? channel.lastRead() : undefined;\n }, [channel]);\n\n const updateStickyHeaderDateIfNeeded = (viewableItems: ViewToken[]) => {\n if (viewableItems.length) {\n const lastItem = viewableItems.pop() as {\n item: MessageType<StreamChatGenerics>;\n };\n\n const isMessageTypeDeleted = lastItem.item.type === 'deleted';\n\n if (\n lastItem?.item?.created_at &&\n !isMessageTypeDeleted &&\n typeof lastItem.item.created_at !== 'string' &&\n lastItem.item.created_at.toDateString() !== stickyHeaderDateRef.current?.toDateString()\n ) {\n stickyHeaderDateRef.current = lastItem.item.created_at;\n setStickyHeaderDate(lastItem.item.created_at);\n }\n }\n };\n\n /**\n * FlatList doesn't accept changeable function for onViewableItemsChanged prop.\n * Thus useRef.\n */\n const onViewableItemsChanged = useRef(\n ({ viewableItems }: { viewableItems: ViewToken[] | undefined }) => {\n /**\n * When a new message comes in, list scrolls down to the bottom automatically (using prop `maintainVisibleContentPosition`)\n * and we mark the channel as read from handleScroll function.\n * Although this logic is dependent on the fact that `onScroll` event gets triggered during this process.\n * But for Android, this event is not triggered when messages length is lesser than visible screen height.\n *\n * And thus we need to check if the message list length is lesser than visible screen height and mark the channel as read.\n */\n if (\n Platform.OS === 'android' &&\n viewableItems?.length &&\n viewableItems?.length >= messageListLengthBeforeUpdate.current\n ) {\n channel.markRead();\n }\n\n if (viewableItems && !hideStickyDateHeader) {\n updateStickyHeaderDateIfNeeded(viewableItems);\n }\n },\n );\n\n /**\n * Resets the pagination trackers, doing so cancels currently scheduled loading more calls\n */\n const resetPaginationTrackersRef = useRef(() => {\n onStartReachedTracker.current = {};\n onEndReachedTracker.current = {};\n });\n\n useEffect(() => {\n setScrollToBottomButtonVisible(false);\n }, [disabled]);\n\n useEffect(() => {\n /**\n * 1. !initialScrollToFirstUnreadMessage && channel.countUnread() > 0\n *\n * In this case MessageList won't scroll to first unread message when opened, so we can mark\n * the channel as read right after opening.\n *\n * 2. initialScrollToFirstUnreadMessage && channel.countUnread() <= scrollToFirstUnreadThreshold\n *\n * In this case MessageList will be opened to first unread message.\n * But if there are not enough (scrollToFirstUnreadThreshold) unread messages, then MessageList\n * won't need to scroll up. So we can safely mark the channel as read right after opening.\n */\n const shouldMarkReadOnFirstLoad =\n !loading &&\n channel &&\n ((!initialScrollToFirstUnreadMessage && channel.countUnread() > 0) ||\n (initialScrollToFirstUnreadMessage &&\n channel.countUnread() <= scrollToFirstUnreadThreshold));\n\n if (shouldMarkReadOnFirstLoad) {\n markRead();\n }\n }, [loading]);\n\n useEffect(() => {\n const lastReceivedMessage = getLastReceivedMessage(messageList);\n\n const hasNewMessage = lastReceivedId !== lastReceivedMessage?.id;\n const isMyMessage = lastReceivedMessage?.user?.id === client.userID;\n\n setLastReceivedId(lastReceivedMessage?.id);\n\n /**\n * Scroll down when\n * 1. you send a new message to channel\n * 2. new message list is small than the one before update - channel has resynced\n * 3. created_at timestamp of top message before update is lesser than created_at timestamp of top message after update - channel has resynced\n */\n const scrollToBottomIfNeeded = () => {\n if (!client || !channel || messageList.length === 0) {\n return;\n }\n if (\n (hasNewMessage && isMyMessage) ||\n messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current ||\n (topMessageBeforeUpdate.current?.created_at &&\n topMessageAfterUpdate?.created_at &&\n topMessageBeforeUpdate.current.created_at < topMessageAfterUpdate.created_at)\n ) {\n channelResyncScrollSet.current = false;\n setScrollToBottomButtonVisible(false);\n resetPaginationTrackersRef.current();\n\n setTimeout(() => {\n flatListRef.current?.scrollToOffset({\n offset: 0,\n });\n }, 50);\n setTimeout(() => {\n channelResyncScrollSet.current = true;\n if (channel.countUnread() > 0) {\n markRead();\n }\n }, 500);\n }\n };\n\n if (threadList || hasNoMoreRecentMessagesToLoad) {\n scrollToBottomIfNeeded();\n } else if (!scrollToBottomButtonVisible) {\n setScrollToBottomButtonVisible(true);\n }\n\n if (\n !hasNoMoreRecentMessagesToLoad &&\n flatListRef.current &&\n messageListLengthBeforeUpdate.current === 0 &&\n messageListLengthAfterUpdate < 10\n ) {\n /**\n * Trigger onStartReached on first load, if messages are not enough to fill the screen.\n * This is important especially for android, where you can't overscroll.\n */\n maybeCallOnStartReached(10);\n }\n\n messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;\n topMessageBeforeUpdate.current = topMessageAfterUpdate;\n }, [messageListLengthAfterUpdate, topMessageAfterUpdate?.id]);\n\n useEffect(() => {\n setAutoscrollToTop(hasNoMoreRecentMessagesToLoad);\n }, [messageList, hasNoMoreRecentMessagesToLoad]);\n\n const renderItem = ({\n index,\n item: message,\n }: {\n index: number;\n item: MessageType<StreamChatGenerics>;\n }) => {\n if (!channel || (!channel.initialized && !channel.offlineMode)) return null;\n\n const lastRead = channel.lastRead();\n\n const lastMessage = messageList?.[index + 1];\n\n const showUnreadUnderlay =\n !!isUnreadMessageRef.current(message, lastRead) && scrollToBottomButtonVisible;\n const insertInlineUnreadIndicator =\n showUnreadUnderlay && !isUnreadMessageRef.current(lastMessage, lastRead);\n\n if (message.type === 'system') {\n return (\n <>\n <View testID={`message-list-item-${index}`}>\n <MessageSystem message={message} style={styles.messagePadding} />\n </View>\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n }\n\n const wrapMessageInTheme = client.userID === message.user?.id && !!myMessageTheme;\n return wrapMessageInTheme ? (\n <>\n <ThemeProvider mergedStyle={modifiedTheme}>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={lastReceivedId === message.id ? lastReceivedId : undefined}\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n </ThemeProvider>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n ) : (\n <>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={\n lastReceivedId === message.id || message.quoted_message_id\n ? lastReceivedId\n : undefined\n }\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n };\n\n /**\n * We are keeping full control on message pagination, and not relying on react-native for it.\n * The reasons being,\n * 1. FlatList doesn't support onStartReached prop\n * 2. `onEndReached` function prop available on react-native, gets executed\n * once per content length (and thats actually a nice optimization strategy).\n * But it also means, we always need to prioritize onEndReached above our\n * logic for `onStartReached`.\n * 3. `onEndReachedThreshold` prop decides - at which scroll position to call `onEndReached`.\n * Its a factor of content length (which is necessary for \"real\" infinite scroll). But on\n * the other hand, it also makes calls to `onEndReached` (and this `channel.query`) way\n * too early during scroll, which we don't really need. So we are going to instead\n * keep some fixed offset distance, to decide when to call `loadMore` or `loadMoreRecent`.\n *\n * We are still gonna keep the optimization, which react-native does - only call onEndReached\n * once per content length.\n */\n\n /**\n * 1. Makes a call to `loadMoreRecent` function, which queries more recent messages.\n * 2. Ensures that we call `loadMoreRecent`, once per content length\n * 3. If the call to `loadMore` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnStartReached = async (limit?: number) => {\n // If onStartReached has already been called for given data length, then ignore.\n if (messageList?.length && onStartReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onStartReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onStartReachedInPromise.current = null;\n\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onStartReached trigger after 2 seconds, to try again */\n setTimeout(() => {\n onStartReachedTracker.current = {};\n }, 2000);\n };\n\n // If onEndReached is in progress, better to wait for it to finish for smooth UX\n if (onEndReachedInPromise.current) {\n await onEndReachedInPromise.current;\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n } else {\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n }\n };\n\n /**\n * 1. Makes a call to `loadMore` function, which queries more older messages.\n * 2. Ensures that we call `loadMore`, once per content length\n * 3. If the call to `loadMoreRecent` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnEndReached = async () => {\n // If onEndReached has already been called for given messageList length, then ignore.\n if (messageList?.length && onEndReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onEndReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onEndReachedInPromise.current = null;\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onEndReachedTracker trigger after 2 seconds, to try again */\n setTimeout(() => {\n onEndReachedTracker.current = {};\n }, 2000);\n };\n\n // If onStartReached is in progress, better to wait for it to finish for smooth UX\n if (onStartReachedInPromise.current) {\n await onStartReachedInPromise.current;\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n } else {\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n }\n };\n\n /**\n * Following if condition covers following cases:\n * 1. If I scroll up -> show scrollToBottom button.\n * 2. If I scroll to bottom of screen\n * |-> hide scrollToBottom button.\n * |-> if channel is unread, call markRead().\n */\n const handleScroll: ScrollViewProps['onScroll'] = (event) => {\n if (!channel || !channelResyncScrollSet.current) {\n return;\n }\n\n const offset = event.nativeEvent.contentOffset.y;\n const visibleLength = event.nativeEvent.layoutMeasurement.height;\n const contentLength = event.nativeEvent.contentSize.height;\n // Check if scroll has reached either start of end of list.\n const isScrollAtStart = offset < 100;\n const isScrollAtEnd = contentLength - visibleLength - offset < 100;\n\n if (isScrollAtStart) {\n maybeCallOnStartReached();\n }\n\n if (isScrollAtEnd) {\n maybeCallOnEndReached();\n }\n\n // Show scrollToBottom button once scroll position goes beyond 300.\n const isScrollAtBottom = offset <= 300;\n const showScrollToBottomButton = !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad;\n\n const shouldMarkRead =\n !threadList && offset <= 0 && hasNoMoreRecentMessagesToLoad && channel.countUnread() > 0;\n\n if (shouldMarkRead) {\n markRead();\n }\n\n setScrollToBottomButtonVisible(showScrollToBottomButton);\n\n if (onListScroll) {\n onListScroll(event);\n }\n };\n\n const goToNewMessages = async () => {\n if (!hasNoMoreRecentMessagesToLoad) {\n resetPaginationTrackersRef.current();\n await reloadChannel();\n } else if (flatListRef.current) {\n flatListRef.current.scrollToOffset({\n offset: 0,\n });\n }\n\n setScrollToBottomButtonVisible(false);\n if (!threadList) {\n markRead();\n }\n };\n\n const onScrollToIndexFailedRef = useRef<\n FlatListProps<MessageType<StreamChatGenerics>>['onScrollToIndexFailed']\n >((info) => {\n // We got a failure as we tried to scroll to an item that was outside the render length\n if (flatListRef.current) {\n // we dont know the actual size of all items but we can see the average, so scroll to the closest offset\n flatListRef.current.scrollToOffset({\n animated: false,\n offset: info.averageItemLength * info.index,\n });\n // since we used only an average offset.. we wont go to the center of the item yet\n // with a little delay to wait for scroll to offset to complete, we can then scroll to the index\n setTimeout(() => {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: info.index,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n if (messageIdLastScrolledToRef.current) {\n setTargetedMessage(messageIdLastScrolledToRef.current);\n }\n }, 150);\n }\n });\n\n const goToMessage = useCallback(\n (messageId: string) => {\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageId,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: true,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // keep track of this messageId, so that we dont scroll to again in useEffect for targeted message change\n messageIdLastScrolledToRef.current = messageId;\n setTargetedMessage(messageId);\n return;\n }\n messageIdToScrollToRef.current = messageId; // keep track of the id to scroll afterwards\n loadChannelAroundMessage({ messageId }); // now try to load the message and whats around it\n resetPaginationTrackersRef.current();\n },\n [messageList],\n );\n\n /**\n * Check if a messageId needs to be scrolled to after list loads, and scroll to it\n * Note: This effect fires on every list change with a small debounce so that scrolling isnt abrupted by an immediate rerender\n */\n useEffect(() => {\n if (scrollToDebounceTimeoutRef.current) clearTimeout(scrollToDebounceTimeoutRef.current);\n scrollToDebounceTimeoutRef.current = setTimeout(() => {\n // goToMessage method might have requested to scroll to a message\n let messageIdToScroll: string | undefined = messageIdToScrollToRef.current;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n // find the first unread message, if we have to initially scroll to an unread message\n for (let index = messageList.length - 1; index >= 0; index--) {\n if (isUnreadMessageRef.current(messageList[index], channelLastReadRef.current)) {\n messageIdToScroll = messageList[index].id;\n break;\n }\n }\n } else if (targetedMessage && messageIdLastScrolledToRef.current !== targetedMessage) {\n // if some messageId was targeted but not scrolledTo yet\n // we have scroll to there after loading completes\n messageIdToScroll = targetedMessage;\n }\n if (!messageIdToScroll) return;\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageIdToScroll,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: false,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // reset the messageId tracker to not scroll to that again\n messageIdToScrollToRef.current = undefined;\n // keep track of this messageId, so that we dont scroll to again for targeted message change\n messageIdLastScrolledToRef.current = messageIdToScroll;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n initialScrollSet.current = true;\n } else {\n setTargetedMessage(messageIdToScroll);\n }\n }\n }, 150);\n }, [messageList, targetedMessage, initialScrollToFirstUnreadMessage]);\n\n const messagesWithImages =\n legacyImageViewerSwipeBehaviour &&\n messageList.filter((message) => {\n const isMessageTypeDeleted = message.type === 'deleted';\n if (!isMessageTypeDeleted && message.attachments) {\n return message.attachments.some(\n (attachment) =>\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n (attachment.image_url || attachment.thumb_url),\n );\n }\n return false;\n });\n\n /**\n * This is for the useEffect to run again in the case that a message\n * gets edited with more or the same number of images\n */\n const imageString =\n legacyImageViewerSwipeBehaviour &&\n messagesWithImages &&\n messagesWithImages\n .map((message) =>\n message.attachments\n ?.map((attachment) => attachment.image_url || attachment.thumb_url || '')\n .join(),\n )\n .join();\n\n const numberOfMessagesWithImages =\n legacyImageViewerSwipeBehaviour && messagesWithImages && messagesWithImages.length;\n const threadExists = !!thread;\n\n useEffect(() => {\n if (\n legacyImageViewerSwipeBehaviour &&\n isListActive &&\n ((threadList && thread) || (!threadList && !thread))\n ) {\n setMessages(messagesWithImages as MessageType<StreamChatGenerics>[]);\n }\n }, [\n imageString,\n isListActive,\n legacyImageViewerSwipeBehaviour,\n numberOfMessagesWithImages,\n threadExists,\n threadList,\n ]);\n\n const stickyHeaderFormatDate =\n stickyHeaderDate?.getFullYear() === new Date().getFullYear() ? 'MMM D' : 'MMM D, YYYY';\n const tStickyHeaderDate =\n stickyHeaderDate && !hideStickyDateHeader ? tDateTimeParser(stickyHeaderDate) : null;\n\n const stickyHeaderDateString = useMemo(() => {\n if (tStickyHeaderDate === null || hideStickyDateHeader) return null;\n if (isDayOrMoment(tStickyHeaderDate)) return tStickyHeaderDate.format(stickyHeaderFormatDate);\n\n return new Date(tStickyHeaderDate).toDateString();\n }, [tStickyHeaderDate, stickyHeaderFormatDate, hideStickyDateHeader]);\n\n const dismissImagePicker = () => {\n if (!hasMoved && selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n }\n };\n const onScrollBeginDrag = () => !hasMoved && selectedPicker && setHasMoved(true);\n const onScrollEndDrag = () => hasMoved && selectedPicker && setHasMoved(false);\n\n const refCallback = (ref: FlatListType<MessageType<StreamChatGenerics>>) => {\n flatListRef.current = ref;\n\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n };\n\n const debugRef = useDebugContext();\n\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: thread ? 'ThreadList' : 'Messages',\n data: messageList,\n });\n }\n\n const renderListEmptyComponent = () => (\n <View style={[styles.flex, styles.invert]} testID='empty-state'>\n <EmptyStateIndicator listType='message' />\n </View>\n );\n\n if (!FlatList) return null;\n\n if (loading) {\n return (\n <View style={styles.flex}>\n <LoadingIndicator listType='message' />\n </View>\n );\n }\n\n const StickyHeaderComponent = () => {\n if (!stickyHeaderDateString) return null;\n if (StickyHeader) return <StickyHeader dateString={stickyHeaderDateString} />;\n if (messageListLengthAfterUpdate) return <DateHeader dateString={stickyHeaderDateString} />;\n return null;\n };\n\n const shouldApplyAndroidWorkaround =\n inverted && Platform.OS === 'android' && Platform.Version >= 33;\n\n return (\n <View\n style={[styles.container, { backgroundColor: white_snow }, container]}\n testID='message-flat-list-wrapper'\n >\n <FlatList\n CellRendererComponent={\n shouldApplyAndroidWorkaround ? InvertedCellRendererComponent : undefined\n }\n contentContainerStyle={[styles.contentContainer, contentContainer]}\n data={messageList}\n /** Disables the MessageList UI. Which means, message actions, reactions won't work. */\n extraData={disabled || !hasNoMoreRecentMessagesToLoad}\n inverted={shouldApplyAndroidWorkaround ? false : inverted}\n keyboardShouldPersistTaps='handled'\n keyExtractor={keyExtractor}\n ListEmptyComponent={renderListEmptyComponent}\n ListFooterComponent={FooterComponent}\n ListHeaderComponent={HeaderComponent}\n maintainVisibleContentPosition={{\n autoscrollToTopThreshold: autoscrollToTop ? 10 : undefined,\n minIndexForVisible: 1,\n }}\n maxToRenderPerBatch={30}\n onScroll={handleScroll}\n onScrollBeginDrag={onScrollBeginDrag}\n onScrollEndDrag={onScrollEndDrag}\n onScrollToIndexFailed={onScrollToIndexFailedRef.current}\n onTouchEnd={dismissImagePicker}\n onViewableItemsChanged={onViewableItemsChanged.current}\n ref={refCallback}\n renderItem={renderItem}\n scrollEnabled={overlay === 'none'}\n showsVerticalScrollIndicator={!shouldApplyAndroidWorkaround}\n style={[\n styles.listContainer,\n listContainer,\n shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined,\n ]}\n testID='message-flat-list'\n viewabilityConfig={flatListViewabilityConfig}\n {...additionalFlatListProps}\n />\n {!loading && (\n <>\n <View style={styles.stickyHeader}>\n <StickyHeaderComponent />\n </View>\n {!disableTypingIndicator && TypingIndicator && (\n <TypingIndicatorContainer>\n <TypingIndicator />\n </TypingIndicatorContainer>\n )}\n <ScrollToBottomButton\n onPress={goToNewMessages}\n showNotification={scrollToBottomButtonVisible}\n unreadCount={threadList ? 0 : channel?.countUnread()}\n />\n </>\n )}\n <NetworkDownIndicator />\n </View>\n );\n};\n\nexport type MessageListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<MessageListPropsWithContext<StreamChatGenerics>>;\n\nexport const MessageList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListProps<StreamChatGenerics>,\n) => {\n const { closePicker, selectedPicker, setSelectedPicker } = useAttachmentPickerContext();\n const {\n channel,\n disabled,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n hideStickyDateHeader,\n isChannelActive,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n markRead,\n NetworkDownIndicator,\n reloadChannel,\n scrollToFirstUnreadThreshold,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n } = useChannelContext<StreamChatGenerics>();\n const { client } = useChatContext<StreamChatGenerics>();\n const { setMessages } = useImageGalleryContext<StreamChatGenerics>();\n const {\n DateHeader,\n disableTypingIndicator,\n FlatList,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n legacyImageViewerSwipeBehaviour,\n Message,\n MessageSystem,\n myMessageTheme,\n ScrollToBottomButton,\n TypingIndicator,\n TypingIndicatorContainer,\n } = useMessagesContext<StreamChatGenerics>();\n const { hasNoMoreRecentMessagesToLoad, loadMore, loadMoreRecent } =\n usePaginatedMessageListContext<StreamChatGenerics>();\n const { overlay } = useOverlayContext();\n const { loadMoreThread, thread } = useThreadContext<StreamChatGenerics>();\n const { t, tDateTimeParser } = useTranslationContext();\n\n return (\n <MessageListWithContext\n {...{\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n FlatList,\n hasNoMoreRecentMessagesToLoad,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isListActive: isChannelActive,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n t,\n targetedMessage,\n tDateTimeParser,\n thread,\n TypingIndicator,\n TypingIndicatorContainer,\n }}\n {...props}\n noGroupBy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AAa,EAAbA,aAAa;IACbC,oBAAoB,EAApBA,oBAAoB;IACpBC,4BAA4B,EAA5BA,4BAA4B;IAC5BC,cAAc,EAAdA,cAAc;IACdE,WAAW,EAAXA,WAAW;IACXC,iBAAiB,EAAjBA,iBAAiB;IACjBC,kBAAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZgL,CAAC,EAADA,CAAC;IACD/K,eAAe,EAAfA,eAAe;IACfC,eAAe,EAAfA,eAAe;IACfC,MAAM,EAANA,MAAM;IACNC,eAAe,EAAfA,eAAe;IACfC,wBAAwB,EAAxBA;EAAwB,GAEtBhE,KAAK;IACT,aAAa,EAAE,CAACiO,2BAA2B,IAAIjO,KAAK,CAAC+C,aAAc;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACnE;AAEN,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","container","alignItems","flex","width","contentContainer","flexGrow","paddingBottom","invert","transform","scaleY","invertAndroid","scaleX","listContainer","messagePadding","paddingHorizontal","stickyHeader","position","top","InvertedCellRendererComponent","props","keyExtractor","item","id","created_at","toISOString","Date","now","toString","flatListViewabilityConfig","viewAreaCoveragePercentThreshold","MessageListWithContext","LoadingMoreIndicator","threadList","InlineLoadingMoreThreadIndicator","InlineLoadingMoreIndicator","additionalFlatListProps","channel","client","closePicker","DateHeader","disabled","disableTypingIndicator","EmptyStateIndicator","FlatList","FooterComponent","hasNoMoreRecentMessagesToLoad","HeaderComponent","InlineLoadingMoreRecentIndicator","hideStickyDateHeader","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","inverted","isListActive","legacyImageViewerSwipeBehaviour","loadChannelAroundMessage","loading","LoadingIndicator","loadMore","loadMoreRecent","loadMoreThread","markRead","Message","MessageSystem","myMessageTheme","NetworkDownIndicator","noGroupByUser","onListScroll","onThreadSelect","overlay","reloadChannel","ScrollToBottomButton","scrollToFirstUnreadThreshold","selectedPicker","setFlatListRef","setMessages","setSelectedPicker","setTargetedMessage","StickyHeader","targetedMessage","tDateTimeParser","thread","TypingIndicator","TypingIndicatorContainer","useTheme","theme","white_snow","colors","messageList","modifiedTheme","useMemo","mergeThemes","style","useMessageList","messageListLengthBeforeUpdate","useRef","messageListLengthAfterUpdate","length","topMessageBeforeUpdate","topMessageAfterUpdate","useState","autoscrollToTop","setAutoscrollToTop","onStartReachedTracker","onEndReachedTracker","onStartReachedInPromise","onEndReachedInPromise","flatListRef","initialScrollSet","channelResyncScrollSet","scrollToDebounceTimeoutRef","messageIdToScrollToRef","messageIdLastScrolledToRef","hasMoved","setHasMoved","getLastReceivedMessage","lastReceivedId","setLastReceivedId","scrollToBottomButtonVisible","setScrollToBottomButtonVisible","stickyHeaderDate","setStickyHeaderDate","stickyHeaderDateRef","isUnreadMessageRef","message","lastRead","channelLastReadRef","initialized","undefined","useEffect","current","updateStickyHeaderDateIfNeeded","viewableItems","lastItem","pop","isMessageTypeDeleted","type","toDateString","onViewableItemsChanged","Platform","OS","resetPaginationTrackersRef","shouldMarkReadOnFirstLoad","countUnread","lastReceivedMessage","hasNewMessage","isMyMessage","user","userID","scrollToBottomIfNeeded","setTimeout","scrollToOffset","offset","maybeCallOnStartReached","renderItem","index","offlineMode","lastMessage","showUnreadUnderlay","insertInlineUnreadIndicator","wrapMessageInTheme","goToMessage","isMessageWithStylesReadByAndDateSeparator","groupStyles","dateSeparator","quoted_message_id","limit","callback","Promise","resolve","onError","then","maybeCallOnEndReached","handleScroll","event","nativeEvent","contentOffset","y","visibleLength","layoutMeasurement","height","contentLength","contentSize","isScrollAtStart","isScrollAtEnd","isScrollAtBottom","showScrollToBottomButton","shouldMarkRead","goToNewMessages","onScrollToIndexFailedRef","info","animated","averageItemLength","scrollToIndex","viewPosition","useCallback","messageId","indexOfParentInMessageList","findIndex","clearTimeout","messageIdToScroll","messagesWithImages","filter","attachments","some","attachment","title_link","og_scrape_url","image_url","thumb_url","imageString","map","join","numberOfMessagesWithImages","threadExists","stickyHeaderFormatDate","getFullYear","tStickyHeaderDate","stickyHeaderDateString","isDayOrMoment","format","dismissImagePicker","onScrollBeginDrag","onScrollEndDrag","refCallback","ref","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","setEventType","setSendEventParams","action","data","shouldApplyAndroidWorkaround","Version","renderListEmptyComponent","StickyHeaderComponent","backgroundColor","autoscrollToTopThreshold","minIndexForVisible","MessageList","useAttachmentPickerContext","useChannelContext","enableMessageGroupingByUser","error","isChannelActive","useChatContext","useImageGalleryContext","useMessagesContext","usePaginatedMessageListContext","useOverlayContext","useThreadContext","useTranslationContext","t"],"sources":["MessageList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n FlatListProps,\n FlatList as FlatListType,\n Platform,\n ScrollViewProps,\n StyleSheet,\n View,\n ViewToken,\n} from 'react-native';\n\nimport type { Channel as StreamChannel } from 'stream-chat';\n\nimport {\n isMessageWithStylesReadByAndDateSeparator,\n MessageType,\n useMessageList,\n} from './hooks/useMessageList';\nimport { InlineLoadingMoreIndicator } from './InlineLoadingMoreIndicator';\nimport { InlineLoadingMoreRecentIndicator } from './InlineLoadingMoreRecentIndicator';\nimport { InlineLoadingMoreThreadIndicator } from './InlineLoadingMoreThreadIndicator';\nimport { getLastReceivedMessage } from './utils/getLastReceivedMessage';\n\nimport {\n AttachmentPickerContextValue,\n useAttachmentPickerContext,\n} from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../contexts/channelContext/ChannelContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport {\n ImageGalleryContextValue,\n useImageGalleryContext,\n} from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport {\n PaginatedMessageListContextValue,\n usePaginatedMessageListContext,\n} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { ThreadContextValue, useThreadContext } from '../../contexts/threadContext/ThreadContext';\nimport {\n isDayOrMoment,\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flex: 1,\n width: '100%',\n },\n contentContainer: {\n flexGrow: 1,\n /**\n * paddingBottom is set to 4 to account for the default date\n * header and inline indicator alignment. The top margin is 8\n * on the header but 4 on the inline date, this adjusts the spacing\n * to allow the \"first\" inline date to align with the date header.\n */\n paddingBottom: 4,\n },\n flex: { flex: 1 },\n invert: { transform: [{ scaleY: -1 }] },\n invertAndroid: {\n // Invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13\n // details: https://github.com/Expensify/App/pull/12820\n transform: [{ scaleX: -1 }, { scaleY: -1 }],\n },\n listContainer: {\n flex: 1,\n width: '100%',\n },\n messagePadding: {\n paddingHorizontal: 8,\n },\n stickyHeader: {\n position: 'absolute',\n top: 0,\n },\n});\n\nconst InvertedCellRendererComponent = (props: React.PropsWithChildren<unknown>) => (\n <View {...props} style={styles.invertAndroid} />\n);\n\nconst keyExtractor = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n item: MessageType<StreamChatGenerics>,\n) => {\n if (item.id) return item.id;\n if (item.created_at)\n return typeof item.created_at === 'string' ? item.created_at : item.created_at.toISOString();\n return Date.now().toString();\n};\n\nconst flatListViewabilityConfig = {\n viewAreaCoveragePercentThreshold: 1,\n};\n\ntype MessageListPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> &\n Pick<\n ChannelContextValue<StreamChatGenerics>,\n | 'channel'\n | 'disabled'\n | 'EmptyStateIndicator'\n | 'hideStickyDateHeader'\n | 'loadChannelAroundMessage'\n | 'loading'\n | 'LoadingIndicator'\n | 'markRead'\n | 'NetworkDownIndicator'\n | 'reloadChannel'\n | 'scrollToFirstUnreadThreshold'\n | 'setTargetedMessage'\n | 'StickyHeader'\n | 'targetedMessage'\n > &\n Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &\n Pick<\n PaginatedMessageListContextValue<StreamChatGenerics>,\n 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'\n > &\n Pick<OverlayContextValue, 'overlay'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'DateHeader'\n | 'disableTypingIndicator'\n | 'FlatList'\n | 'initialScrollToFirstUnreadMessage'\n | 'InlineDateSeparator'\n | 'InlineUnreadIndicator'\n | 'legacyImageViewerSwipeBehaviour'\n | 'Message'\n | 'ScrollToBottomButton'\n | 'MessageSystem'\n | 'myMessageTheme'\n | 'TypingIndicator'\n | 'TypingIndicatorContainer'\n > &\n Pick<ThreadContextValue<StreamChatGenerics>, 'loadMoreThread' | 'thread'> &\n Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {\n /**\n * Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want\n * to attach some additional props to underlying FlatList, you can add it to following prop.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **NOTE** Don't use `additionalFlatListProps` to get access to ref of flatlist. Use `setFlatListRef` instead.\n *\n * e.g.\n * ```js\n * <MessageList\n * additionalFlatListProps={{ bounces: true, keyboardDismissMode: true }} />\n * ```\n */\n additionalFlatListProps?: Partial<FlatListProps<MessageType<StreamChatGenerics>>>;\n /**\n * UI component for footer of message list. By default message list will use `InlineLoadingMoreIndicator`\n * as FooterComponent. If you want to implement your own inline loading indicator, you can access `loadingMore`\n * from context.\n *\n * This is a [ListHeaderComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header by default if inverted is true or defaulted\n */\n FooterComponent?: React.ComponentType;\n /**\n * UI component for header of message list. By default message list will use `InlineLoadingMoreRecentIndicator`\n * as HeaderComponent. If you want to implement your own inline loading indicator, you can access `loadingMoreRecent`\n * from context.\n *\n * This is a [ListFooterComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header if inverted is false\n */\n HeaderComponent?: React.ComponentType;\n /** Whether or not the FlatList is inverted. Defaults to true */\n inverted?: boolean;\n isListActive?: boolean;\n /** Turn off grouping of messages by user */\n noGroupByUser?: boolean;\n onListScroll?: ScrollViewProps['onScroll'];\n /**\n * Handler to open the thread on message. This is callback for touch event for replies button.\n *\n * @param message A message object to open the thread upon.\n */\n onThreadSelect?: (message: ThreadContextValue<StreamChatGenerics>['thread']) => void;\n /**\n * Use `setFlatListRef` to get access to ref to inner FlatList.\n *\n * e.g.\n * ```js\n * <MessageList\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef?: (ref: FlatListType<MessageType<StreamChatGenerics>> | null) => void;\n /**\n * Boolean whether or not the Messages in the MessageList are part of a Thread\n **/\n threadList?: boolean;\n };\n\n/**\n * The message list component renders a list of messages. It consumes the following contexts:\n *\n * [ChannelContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/channel-context/)\n * [ChatContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/chat-context/)\n * [MessagesContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/)\n * [ThreadContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/thread-context/)\n * [TranslationContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/translation-context/)\n */\nconst MessageListWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListPropsWithContext<StreamChatGenerics>,\n) => {\n const LoadingMoreIndicator = props.threadList\n ? InlineLoadingMoreThreadIndicator\n : InlineLoadingMoreIndicator;\n const {\n additionalFlatListProps,\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n FlatList,\n FooterComponent = LoadingMoreIndicator,\n hasNoMoreRecentMessagesToLoad,\n HeaderComponent = InlineLoadingMoreRecentIndicator,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n inverted = true,\n isListActive = false,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n noGroupByUser,\n onListScroll,\n onThreadSelect,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setFlatListRef,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n tDateTimeParser,\n thread,\n threadList = false,\n TypingIndicator,\n TypingIndicatorContainer,\n } = props;\n\n const { theme } = useTheme();\n\n const {\n colors: { white_snow },\n messageList: { container, contentContainer, listContainer },\n } = theme;\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageTheme, theme],\n );\n\n const messageList = useMessageList<StreamChatGenerics>({\n noGroupByUser,\n threadList,\n });\n const messageListLengthBeforeUpdate = useRef(0);\n const messageListLengthAfterUpdate = messageList.length;\n\n /**\n * We need topMessage and channelLastRead values to set the initial scroll position.\n * So these values only get used if `initialScrollToFirstUnreadMessage` prop is true.\n */\n const topMessageBeforeUpdate = useRef<MessageType<StreamChatGenerics>>();\n const topMessageAfterUpdate = messageList[messageList.length - 1];\n\n const [autoscrollToTop, setAutoscrollToTop] = useState(false);\n\n /**\n * We want to call onEndReached and onStartReached only once, per content length.\n * We keep track of calls to these functions per content length, with following trackers.\n */\n const onStartReachedTracker = useRef<Record<number, boolean>>({});\n const onEndReachedTracker = useRef<Record<number, boolean>>({});\n\n const onStartReachedInPromise = useRef<Promise<void> | null>(null);\n const onEndReachedInPromise = useRef<Promise<void> | null>(null);\n\n const flatListRef = useRef<FlatListType<MessageType<StreamChatGenerics>> | null>(null);\n\n /**\n * Flag to track if the initial scroll has been set\n * If the prop `initialScrollToFirstUnreadMessage` was enabled, then we scroll to the unread msg and set it to true\n * If not, the default offset of 0 for flatList means that it has been set already\n */\n const initialScrollSet = useRef<boolean>(!initialScrollToFirstUnreadMessage);\n\n const channelResyncScrollSet = useRef<boolean>(true);\n\n /**\n * The timeout id used to debounce our scrollToIndex calls on messageList updates\n */\n const scrollToDebounceTimeoutRef = useRef<NodeJS.Timeout>();\n\n /**\n * If a messageId was requested to scroll to but was unloaded,\n * this flag keeps track of it to scroll to it after loading the message\n */\n const messageIdToScrollToRef = useRef<string>();\n /**\n * Last messageID that was scrolled to after loading a new message list,\n * this flag keeps track of it so that we dont scroll to it again on target message set\n */\n const messageIdLastScrolledToRef = useRef<string>();\n const [hasMoved, setHasMoved] = useState(false);\n const [lastReceivedId, setLastReceivedId] = useState(getLastReceivedMessage(messageList)?.id);\n const [scrollToBottomButtonVisible, setScrollToBottomButtonVisible] = useState(false);\n\n const [stickyHeaderDate, setStickyHeaderDate] = useState<Date | undefined>();\n const stickyHeaderDateRef = useRef<Date | undefined>();\n\n const isUnreadMessageRef = useRef(\n (\n message: MessageType<StreamChatGenerics> | undefined,\n lastRead?: ReturnType<StreamChannel<StreamChatGenerics>['lastRead']>,\n ) => message && lastRead && message.created_at && lastRead < message.created_at,\n );\n\n const channelLastReadRef = useRef(channel?.initialized ? channel.lastRead() : undefined);\n\n useEffect(() => {\n channelLastReadRef.current = channel?.initialized ? channel.lastRead() : undefined;\n }, [channel]);\n\n const updateStickyHeaderDateIfNeeded = (viewableItems: ViewToken[]) => {\n if (viewableItems.length) {\n const lastItem = viewableItems.pop() as {\n item: MessageType<StreamChatGenerics>;\n };\n\n const isMessageTypeDeleted = lastItem.item.type === 'deleted';\n\n if (\n lastItem?.item?.created_at &&\n !isMessageTypeDeleted &&\n typeof lastItem.item.created_at !== 'string' &&\n lastItem.item.created_at.toDateString() !== stickyHeaderDateRef.current?.toDateString()\n ) {\n stickyHeaderDateRef.current = lastItem.item.created_at;\n setStickyHeaderDate(lastItem.item.created_at);\n }\n }\n };\n\n /**\n * FlatList doesn't accept changeable function for onViewableItemsChanged prop.\n * Thus useRef.\n */\n const onViewableItemsChanged = useRef(\n ({ viewableItems }: { viewableItems: ViewToken[] | undefined }) => {\n /**\n * When a new message comes in, list scrolls down to the bottom automatically (using prop `maintainVisibleContentPosition`)\n * and we mark the channel as read from handleScroll function.\n * Although this logic is dependent on the fact that `onScroll` event gets triggered during this process.\n * But for Android, this event is not triggered when messages length is lesser than visible screen height.\n *\n * And thus we need to check if the message list length is lesser than visible screen height and mark the channel as read.\n */\n if (\n Platform.OS === 'android' &&\n viewableItems?.length &&\n viewableItems?.length >= messageListLengthBeforeUpdate.current\n ) {\n channel.markRead();\n }\n\n if (viewableItems && !hideStickyDateHeader) {\n updateStickyHeaderDateIfNeeded(viewableItems);\n }\n },\n );\n\n /**\n * Resets the pagination trackers, doing so cancels currently scheduled loading more calls\n */\n const resetPaginationTrackersRef = useRef(() => {\n onStartReachedTracker.current = {};\n onEndReachedTracker.current = {};\n });\n\n useEffect(() => {\n setScrollToBottomButtonVisible(false);\n }, [disabled]);\n\n useEffect(() => {\n /**\n * 1. !initialScrollToFirstUnreadMessage && channel.countUnread() > 0\n *\n * In this case MessageList won't scroll to first unread message when opened, so we can mark\n * the channel as read right after opening.\n *\n * 2. initialScrollToFirstUnreadMessage && channel.countUnread() <= scrollToFirstUnreadThreshold\n *\n * In this case MessageList will be opened to first unread message.\n * But if there are not enough (scrollToFirstUnreadThreshold) unread messages, then MessageList\n * won't need to scroll up. So we can safely mark the channel as read right after opening.\n */\n const shouldMarkReadOnFirstLoad =\n !loading &&\n channel &&\n ((!initialScrollToFirstUnreadMessage && channel.countUnread() > 0) ||\n (initialScrollToFirstUnreadMessage &&\n channel.countUnread() <= scrollToFirstUnreadThreshold));\n\n if (shouldMarkReadOnFirstLoad) {\n markRead();\n }\n }, [loading]);\n\n useEffect(() => {\n const lastReceivedMessage = getLastReceivedMessage(messageList);\n\n const hasNewMessage = lastReceivedId !== lastReceivedMessage?.id;\n const isMyMessage = lastReceivedMessage?.user?.id === client.userID;\n\n setLastReceivedId(lastReceivedMessage?.id);\n\n /**\n * Scroll down when\n * 1. you send a new message to channel\n * 2. new message list is small than the one before update - channel has resynced\n * 3. created_at timestamp of top message before update is lesser than created_at timestamp of top message after update - channel has resynced\n */\n const scrollToBottomIfNeeded = () => {\n if (!client || !channel || messageList.length === 0) {\n return;\n }\n if (\n (hasNewMessage && isMyMessage) ||\n messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current ||\n (topMessageBeforeUpdate.current?.created_at &&\n topMessageAfterUpdate?.created_at &&\n topMessageBeforeUpdate.current.created_at < topMessageAfterUpdate.created_at)\n ) {\n channelResyncScrollSet.current = false;\n setScrollToBottomButtonVisible(false);\n resetPaginationTrackersRef.current();\n\n setTimeout(() => {\n flatListRef.current?.scrollToOffset({\n offset: 0,\n });\n }, 50);\n setTimeout(() => {\n channelResyncScrollSet.current = true;\n if (channel.countUnread() > 0) {\n markRead();\n }\n }, 500);\n }\n };\n\n if (threadList || hasNoMoreRecentMessagesToLoad) {\n scrollToBottomIfNeeded();\n } else if (!scrollToBottomButtonVisible) {\n setScrollToBottomButtonVisible(true);\n }\n\n if (\n !hasNoMoreRecentMessagesToLoad &&\n flatListRef.current &&\n messageListLengthBeforeUpdate.current === 0 &&\n messageListLengthAfterUpdate < 10\n ) {\n /**\n * Trigger onStartReached on first load, if messages are not enough to fill the screen.\n * This is important especially for android, where you can't overscroll.\n */\n maybeCallOnStartReached(10);\n }\n\n messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;\n topMessageBeforeUpdate.current = topMessageAfterUpdate;\n }, [messageListLengthAfterUpdate, topMessageAfterUpdate?.id]);\n\n useEffect(() => {\n setAutoscrollToTop(hasNoMoreRecentMessagesToLoad);\n }, [messageList, hasNoMoreRecentMessagesToLoad]);\n\n const renderItem = ({\n index,\n item: message,\n }: {\n index: number;\n item: MessageType<StreamChatGenerics>;\n }) => {\n if (!channel || (!channel.initialized && !channel.offlineMode)) return null;\n\n const lastRead = channel.lastRead();\n\n const lastMessage = messageList?.[index + 1];\n\n const showUnreadUnderlay =\n !!isUnreadMessageRef.current(message, lastRead) && scrollToBottomButtonVisible;\n const insertInlineUnreadIndicator =\n showUnreadUnderlay && !isUnreadMessageRef.current(lastMessage, lastRead);\n\n if (message.type === 'system') {\n return (\n <>\n <View testID={`message-list-item-${index}`}>\n <MessageSystem message={message} style={styles.messagePadding} />\n </View>\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n }\n\n const wrapMessageInTheme = client.userID === message.user?.id && !!myMessageTheme;\n return wrapMessageInTheme ? (\n <>\n <ThemeProvider mergedStyle={modifiedTheme}>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={lastReceivedId === message.id ? lastReceivedId : undefined}\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n </ThemeProvider>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n ) : (\n <>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={\n lastReceivedId === message.id || message.quoted_message_id\n ? lastReceivedId\n : undefined\n }\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n };\n\n /**\n * We are keeping full control on message pagination, and not relying on react-native for it.\n * The reasons being,\n * 1. FlatList doesn't support onStartReached prop\n * 2. `onEndReached` function prop available on react-native, gets executed\n * once per content length (and thats actually a nice optimization strategy).\n * But it also means, we always need to prioritize onEndReached above our\n * logic for `onStartReached`.\n * 3. `onEndReachedThreshold` prop decides - at which scroll position to call `onEndReached`.\n * Its a factor of content length (which is necessary for \"real\" infinite scroll). But on\n * the other hand, it also makes calls to `onEndReached` (and this `channel.query`) way\n * too early during scroll, which we don't really need. So we are going to instead\n * keep some fixed offset distance, to decide when to call `loadMore` or `loadMoreRecent`.\n *\n * We are still gonna keep the optimization, which react-native does - only call onEndReached\n * once per content length.\n */\n\n /**\n * 1. Makes a call to `loadMoreRecent` function, which queries more recent messages.\n * 2. Ensures that we call `loadMoreRecent`, once per content length\n * 3. If the call to `loadMore` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnStartReached = async (limit?: number) => {\n // If onStartReached has already been called for given data length, then ignore.\n if (messageList?.length && onStartReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onStartReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onStartReachedInPromise.current = null;\n\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onStartReached trigger after 2 seconds, to try again */\n setTimeout(() => {\n onStartReachedTracker.current = {};\n }, 2000);\n };\n\n // If onEndReached is in progress, better to wait for it to finish for smooth UX\n if (onEndReachedInPromise.current) {\n await onEndReachedInPromise.current;\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n } else {\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n }\n };\n\n /**\n * 1. Makes a call to `loadMore` function, which queries more older messages.\n * 2. Ensures that we call `loadMore`, once per content length\n * 3. If the call to `loadMoreRecent` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnEndReached = async () => {\n // If onEndReached has already been called for given messageList length, then ignore.\n if (messageList?.length && onEndReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onEndReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onEndReachedInPromise.current = null;\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onEndReachedTracker trigger after 2 seconds, to try again */\n setTimeout(() => {\n onEndReachedTracker.current = {};\n }, 2000);\n };\n\n // If onStartReached is in progress, better to wait for it to finish for smooth UX\n if (onStartReachedInPromise.current) {\n await onStartReachedInPromise.current;\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n } else {\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n }\n };\n\n /**\n * Following if condition covers following cases:\n * 1. If I scroll up -> show scrollToBottom button.\n * 2. If I scroll to bottom of screen\n * |-> hide scrollToBottom button.\n * |-> if channel is unread, call markRead().\n */\n const handleScroll: ScrollViewProps['onScroll'] = (event) => {\n if (!channel || !channelResyncScrollSet.current) {\n return;\n }\n\n const offset = event.nativeEvent.contentOffset.y;\n const visibleLength = event.nativeEvent.layoutMeasurement.height;\n const contentLength = event.nativeEvent.contentSize.height;\n // Check if scroll has reached either start of end of list.\n const isScrollAtStart = offset < 100;\n const isScrollAtEnd = contentLength - visibleLength - offset < 100;\n\n if (isScrollAtStart) {\n maybeCallOnStartReached();\n }\n\n if (isScrollAtEnd) {\n maybeCallOnEndReached();\n }\n\n // Show scrollToBottom button once scroll position goes beyond 300.\n const isScrollAtBottom = offset <= 300;\n const showScrollToBottomButton = !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad;\n\n const shouldMarkRead =\n !threadList && offset <= 0 && hasNoMoreRecentMessagesToLoad && channel.countUnread() > 0;\n\n if (shouldMarkRead) {\n markRead();\n }\n\n setScrollToBottomButtonVisible(showScrollToBottomButton);\n\n if (onListScroll) {\n onListScroll(event);\n }\n };\n\n const goToNewMessages = async () => {\n if (!hasNoMoreRecentMessagesToLoad) {\n resetPaginationTrackersRef.current();\n await reloadChannel();\n } else if (flatListRef.current) {\n flatListRef.current.scrollToOffset({\n offset: 0,\n });\n }\n\n setScrollToBottomButtonVisible(false);\n if (!threadList) {\n markRead();\n }\n };\n\n const onScrollToIndexFailedRef = useRef<\n FlatListProps<MessageType<StreamChatGenerics>>['onScrollToIndexFailed']\n >((info) => {\n // We got a failure as we tried to scroll to an item that was outside the render length\n if (flatListRef.current) {\n // we dont know the actual size of all items but we can see the average, so scroll to the closest offset\n flatListRef.current.scrollToOffset({\n animated: false,\n offset: info.averageItemLength * info.index,\n });\n // since we used only an average offset.. we wont go to the center of the item yet\n // with a little delay to wait for scroll to offset to complete, we can then scroll to the index\n setTimeout(() => {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: info.index,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n if (messageIdLastScrolledToRef.current) {\n setTargetedMessage(messageIdLastScrolledToRef.current);\n }\n }, 150);\n }\n });\n\n const goToMessage = useCallback(\n (messageId: string) => {\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageId,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: true,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // keep track of this messageId, so that we dont scroll to again in useEffect for targeted message change\n messageIdLastScrolledToRef.current = messageId;\n setTargetedMessage(messageId);\n return;\n }\n messageIdToScrollToRef.current = messageId; // keep track of the id to scroll afterwards\n loadChannelAroundMessage({ messageId }); // now try to load the message and whats around it\n resetPaginationTrackersRef.current();\n },\n [messageList],\n );\n\n /**\n * Check if a messageId needs to be scrolled to after list loads, and scroll to it\n * Note: This effect fires on every list change with a small debounce so that scrolling isnt abrupted by an immediate rerender\n */\n useEffect(() => {\n if (scrollToDebounceTimeoutRef.current) clearTimeout(scrollToDebounceTimeoutRef.current);\n scrollToDebounceTimeoutRef.current = setTimeout(() => {\n // goToMessage method might have requested to scroll to a message\n let messageIdToScroll: string | undefined = messageIdToScrollToRef.current;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n // find the first unread message, if we have to initially scroll to an unread message\n for (let index = messageList.length - 1; index >= 0; index--) {\n if (isUnreadMessageRef.current(messageList[index], channelLastReadRef.current)) {\n messageIdToScroll = messageList[index].id;\n break;\n }\n }\n } else if (targetedMessage && messageIdLastScrolledToRef.current !== targetedMessage) {\n // if some messageId was targeted but not scrolledTo yet\n // we have scroll to there after loading completes\n messageIdToScroll = targetedMessage;\n }\n if (!messageIdToScroll) return;\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageIdToScroll,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: false,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // reset the messageId tracker to not scroll to that again\n messageIdToScrollToRef.current = undefined;\n // keep track of this messageId, so that we dont scroll to again for targeted message change\n messageIdLastScrolledToRef.current = messageIdToScroll;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n initialScrollSet.current = true;\n } else {\n setTargetedMessage(messageIdToScroll);\n }\n }\n }, 150);\n }, [messageList, targetedMessage, initialScrollToFirstUnreadMessage]);\n\n const messagesWithImages =\n legacyImageViewerSwipeBehaviour &&\n messageList.filter((message) => {\n const isMessageTypeDeleted = message.type === 'deleted';\n if (!isMessageTypeDeleted && message.attachments) {\n return message.attachments.some(\n (attachment) =>\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n (attachment.image_url || attachment.thumb_url),\n );\n }\n return false;\n });\n\n /**\n * This is for the useEffect to run again in the case that a message\n * gets edited with more or the same number of images\n */\n const imageString =\n legacyImageViewerSwipeBehaviour &&\n messagesWithImages &&\n messagesWithImages\n .map((message) =>\n message.attachments\n ?.map((attachment) => attachment.image_url || attachment.thumb_url || '')\n .join(),\n )\n .join();\n\n const numberOfMessagesWithImages =\n legacyImageViewerSwipeBehaviour && messagesWithImages && messagesWithImages.length;\n const threadExists = !!thread;\n\n useEffect(() => {\n if (\n legacyImageViewerSwipeBehaviour &&\n isListActive &&\n ((threadList && thread) || (!threadList && !thread))\n ) {\n setMessages(messagesWithImages as MessageType<StreamChatGenerics>[]);\n }\n }, [\n imageString,\n isListActive,\n legacyImageViewerSwipeBehaviour,\n numberOfMessagesWithImages,\n threadExists,\n threadList,\n ]);\n\n const stickyHeaderFormatDate =\n stickyHeaderDate?.getFullYear() === new Date().getFullYear() ? 'MMM D' : 'MMM D, YYYY';\n const tStickyHeaderDate =\n stickyHeaderDate && !hideStickyDateHeader ? tDateTimeParser(stickyHeaderDate) : null;\n\n const stickyHeaderDateString = useMemo(() => {\n if (tStickyHeaderDate === null || hideStickyDateHeader) return null;\n if (isDayOrMoment(tStickyHeaderDate)) return tStickyHeaderDate.format(stickyHeaderFormatDate);\n\n return new Date(tStickyHeaderDate).toDateString();\n }, [tStickyHeaderDate, stickyHeaderFormatDate, hideStickyDateHeader]);\n\n const dismissImagePicker = () => {\n if (!hasMoved && selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n }\n };\n const onScrollBeginDrag = () => !hasMoved && selectedPicker && setHasMoved(true);\n const onScrollEndDrag = () => hasMoved && selectedPicker && setHasMoved(false);\n\n const refCallback = (ref: FlatListType<MessageType<StreamChatGenerics>>) => {\n flatListRef.current = ref;\n\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n };\n\n const debugRef = useDebugContext();\n\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: thread ? 'ThreadList' : 'Messages',\n data: messageList,\n });\n }\n\n const shouldApplyAndroidWorkaround =\n inverted && Platform.OS === 'android' && Platform.Version >= 33;\n\n const renderListEmptyComponent = useCallback(\n () => (\n <View\n style={[styles.flex, shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert]}\n testID='empty-state'\n >\n <EmptyStateIndicator listType='message' />\n </View>\n ),\n [EmptyStateIndicator, shouldApplyAndroidWorkaround],\n );\n\n if (!FlatList) return null;\n\n if (loading) {\n return (\n <View style={styles.flex}>\n <LoadingIndicator listType='message' />\n </View>\n );\n }\n\n const StickyHeaderComponent = () => {\n if (!stickyHeaderDateString) return null;\n if (StickyHeader) return <StickyHeader dateString={stickyHeaderDateString} />;\n if (messageListLengthAfterUpdate) return <DateHeader dateString={stickyHeaderDateString} />;\n return null;\n };\n\n return (\n <View\n style={[styles.container, { backgroundColor: white_snow }, container]}\n testID='message-flat-list-wrapper'\n >\n <FlatList\n CellRendererComponent={\n shouldApplyAndroidWorkaround ? InvertedCellRendererComponent : undefined\n }\n contentContainerStyle={[styles.contentContainer, contentContainer]}\n data={messageList}\n /** Disables the MessageList UI. Which means, message actions, reactions won't work. */\n extraData={disabled || !hasNoMoreRecentMessagesToLoad}\n inverted={shouldApplyAndroidWorkaround ? false : inverted}\n keyboardShouldPersistTaps='handled'\n keyExtractor={keyExtractor}\n ListEmptyComponent={renderListEmptyComponent}\n ListFooterComponent={FooterComponent}\n ListHeaderComponent={HeaderComponent}\n maintainVisibleContentPosition={{\n autoscrollToTopThreshold: autoscrollToTop ? 10 : undefined,\n minIndexForVisible: 1,\n }}\n maxToRenderPerBatch={30}\n onScroll={handleScroll}\n onScrollBeginDrag={onScrollBeginDrag}\n onScrollEndDrag={onScrollEndDrag}\n onScrollToIndexFailed={onScrollToIndexFailedRef.current}\n onTouchEnd={dismissImagePicker}\n onViewableItemsChanged={onViewableItemsChanged.current}\n ref={refCallback}\n renderItem={renderItem}\n scrollEnabled={overlay === 'none'}\n showsVerticalScrollIndicator={!shouldApplyAndroidWorkaround}\n style={[\n styles.listContainer,\n listContainer,\n shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined,\n ]}\n testID='message-flat-list'\n viewabilityConfig={flatListViewabilityConfig}\n {...additionalFlatListProps}\n />\n {!loading && (\n <>\n <View style={styles.stickyHeader}>\n <StickyHeaderComponent />\n </View>\n {!disableTypingIndicator && TypingIndicator && (\n <TypingIndicatorContainer>\n <TypingIndicator />\n </TypingIndicatorContainer>\n )}\n <ScrollToBottomButton\n onPress={goToNewMessages}\n showNotification={scrollToBottomButtonVisible}\n unreadCount={threadList ? 0 : channel?.countUnread()}\n />\n </>\n )}\n <NetworkDownIndicator />\n </View>\n );\n};\n\nexport type MessageListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<MessageListPropsWithContext<StreamChatGenerics>>;\n\nexport const MessageList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListProps<StreamChatGenerics>,\n) => {\n const { closePicker, selectedPicker, setSelectedPicker } = useAttachmentPickerContext();\n const {\n channel,\n disabled,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n hideStickyDateHeader,\n isChannelActive,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n markRead,\n NetworkDownIndicator,\n reloadChannel,\n scrollToFirstUnreadThreshold,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n } = useChannelContext<StreamChatGenerics>();\n const { client } = useChatContext<StreamChatGenerics>();\n const { setMessages } = useImageGalleryContext<StreamChatGenerics>();\n const {\n DateHeader,\n disableTypingIndicator,\n FlatList,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n legacyImageViewerSwipeBehaviour,\n Message,\n MessageSystem,\n myMessageTheme,\n ScrollToBottomButton,\n TypingIndicator,\n TypingIndicatorContainer,\n } = useMessagesContext<StreamChatGenerics>();\n const { hasNoMoreRecentMessagesToLoad, loadMore, loadMoreRecent } =\n usePaginatedMessageListContext<StreamChatGenerics>();\n const { overlay } = useOverlayContext();\n const { loadMoreThread, thread } = useThreadContext<StreamChatGenerics>();\n const { t, tDateTimeParser } = useTranslationContext();\n\n return (\n <MessageListWithContext\n {...{\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n FlatList,\n hasNoMoreRecentMessagesToLoad,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isListActive: isChannelActive,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n t,\n targetedMessage,\n tDateTimeParser,\n thread,\n TypingIndicator,\n TypingIndicatorContainer,\n }}\n {...props}\n noGroupByUser={!enableMessageGroupingByUser || props.noGroupByUser}\n />\n );\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AAYA;AAKA;AACA;AACA;AACA;AAEA;AAIA;AAIA;AACA;AACA;AAIA;AAIA;AAIA;AAIA;AACA;AACA;AAI8D;EAAA;AAAA;AAAA;AAI9D,IAAMA,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IAC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C,kBAAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZgL,CAAC,EAADA,CAAC;IACD/K,eAAe,EAAfA,eAAe;IACfC,eAAe,EAAfA,eAAe;IACfC,MAAM,EAANA,MAAM;IACNC,eAAe,EAAfA,eAAe;IACfC,wBAAwB,EAAxBA;EAAwB,GAEtBhE,KAAK;IACT,aAAa,EAAE,CAACiO,2BAA2B,IAAIjO,KAAK,CAAC+C,aAAc;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACnE;AAEN,CAAC;AAAC"}
|
|
@@ -704,26 +704,27 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
704
704
|
data: messageList
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
-
var
|
|
707
|
+
var shouldApplyAndroidWorkaround = inverted && _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 33;
|
|
708
|
+
var renderListEmptyComponent = (0, _react.useCallback)(function () {
|
|
708
709
|
return _react["default"].createElement(_reactNative.View, {
|
|
709
|
-
style: [styles.flex, styles.invert],
|
|
710
|
+
style: [styles.flex, shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert],
|
|
710
711
|
testID: "empty-state",
|
|
711
712
|
__self: _this,
|
|
712
713
|
__source: {
|
|
713
714
|
fileName: _jsxFileName,
|
|
714
|
-
lineNumber:
|
|
715
|
-
columnNumber:
|
|
715
|
+
lineNumber: 964,
|
|
716
|
+
columnNumber: 7
|
|
716
717
|
}
|
|
717
718
|
}, _react["default"].createElement(EmptyStateIndicator, {
|
|
718
719
|
listType: "message",
|
|
719
720
|
__self: _this,
|
|
720
721
|
__source: {
|
|
721
722
|
fileName: _jsxFileName,
|
|
722
|
-
lineNumber:
|
|
723
|
-
columnNumber:
|
|
723
|
+
lineNumber: 968,
|
|
724
|
+
columnNumber: 9
|
|
724
725
|
}
|
|
725
726
|
}));
|
|
726
|
-
};
|
|
727
|
+
}, [EmptyStateIndicator, shouldApplyAndroidWorkaround]);
|
|
727
728
|
if (!FlatList) return null;
|
|
728
729
|
if (loading) {
|
|
729
730
|
return _react["default"].createElement(_reactNative.View, {
|
|
@@ -731,7 +732,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
731
732
|
__self: _this,
|
|
732
733
|
__source: {
|
|
733
734
|
fileName: _jsxFileName,
|
|
734
|
-
lineNumber:
|
|
735
|
+
lineNumber: 978,
|
|
735
736
|
columnNumber: 7
|
|
736
737
|
}
|
|
737
738
|
}, _react["default"].createElement(LoadingIndicator, {
|
|
@@ -739,7 +740,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
739
740
|
__self: _this,
|
|
740
741
|
__source: {
|
|
741
742
|
fileName: _jsxFileName,
|
|
742
|
-
lineNumber:
|
|
743
|
+
lineNumber: 979,
|
|
743
744
|
columnNumber: 9
|
|
744
745
|
}
|
|
745
746
|
}));
|
|
@@ -751,7 +752,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
751
752
|
__self: _this,
|
|
752
753
|
__source: {
|
|
753
754
|
fileName: _jsxFileName,
|
|
754
|
-
lineNumber:
|
|
755
|
+
lineNumber: 986,
|
|
755
756
|
columnNumber: 30
|
|
756
757
|
}
|
|
757
758
|
});
|
|
@@ -760,13 +761,12 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
760
761
|
__self: _this,
|
|
761
762
|
__source: {
|
|
762
763
|
fileName: _jsxFileName,
|
|
763
|
-
lineNumber:
|
|
764
|
+
lineNumber: 987,
|
|
764
765
|
columnNumber: 46
|
|
765
766
|
}
|
|
766
767
|
});
|
|
767
768
|
return null;
|
|
768
769
|
};
|
|
769
|
-
var shouldApplyAndroidWorkaround = inverted && _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 33;
|
|
770
770
|
return _react["default"].createElement(_reactNative.View, {
|
|
771
771
|
style: [styles.container, {
|
|
772
772
|
backgroundColor: white_snow
|
|
@@ -775,7 +775,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
775
775
|
__self: _this,
|
|
776
776
|
__source: {
|
|
777
777
|
fileName: _jsxFileName,
|
|
778
|
-
lineNumber:
|
|
778
|
+
lineNumber: 992,
|
|
779
779
|
columnNumber: 5
|
|
780
780
|
}
|
|
781
781
|
}, _react["default"].createElement(FlatList, (0, _extends2["default"])({
|
|
@@ -811,13 +811,13 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
811
811
|
__self: _this,
|
|
812
812
|
__source: {
|
|
813
813
|
fileName: _jsxFileName,
|
|
814
|
-
lineNumber:
|
|
814
|
+
lineNumber: 996,
|
|
815
815
|
columnNumber: 7
|
|
816
816
|
}
|
|
817
817
|
})), !loading && _react["default"].createElement(_react["default"].Fragment, {
|
|
818
818
|
__source: {
|
|
819
819
|
fileName: _jsxFileName,
|
|
820
|
-
lineNumber:
|
|
820
|
+
lineNumber: 1035,
|
|
821
821
|
columnNumber: 9
|
|
822
822
|
}
|
|
823
823
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -825,28 +825,28 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
825
825
|
__self: _this,
|
|
826
826
|
__source: {
|
|
827
827
|
fileName: _jsxFileName,
|
|
828
|
-
lineNumber:
|
|
828
|
+
lineNumber: 1036,
|
|
829
829
|
columnNumber: 11
|
|
830
830
|
}
|
|
831
831
|
}, _react["default"].createElement(StickyHeaderComponent, {
|
|
832
832
|
__self: _this,
|
|
833
833
|
__source: {
|
|
834
834
|
fileName: _jsxFileName,
|
|
835
|
-
lineNumber:
|
|
835
|
+
lineNumber: 1037,
|
|
836
836
|
columnNumber: 13
|
|
837
837
|
}
|
|
838
838
|
})), !disableTypingIndicator && TypingIndicator && _react["default"].createElement(TypingIndicatorContainer, {
|
|
839
839
|
__self: _this,
|
|
840
840
|
__source: {
|
|
841
841
|
fileName: _jsxFileName,
|
|
842
|
-
lineNumber:
|
|
842
|
+
lineNumber: 1040,
|
|
843
843
|
columnNumber: 13
|
|
844
844
|
}
|
|
845
845
|
}, _react["default"].createElement(TypingIndicator, {
|
|
846
846
|
__self: _this,
|
|
847
847
|
__source: {
|
|
848
848
|
fileName: _jsxFileName,
|
|
849
|
-
lineNumber:
|
|
849
|
+
lineNumber: 1041,
|
|
850
850
|
columnNumber: 15
|
|
851
851
|
}
|
|
852
852
|
})), _react["default"].createElement(ScrollToBottomButton, {
|
|
@@ -856,14 +856,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
856
856
|
__self: _this,
|
|
857
857
|
__source: {
|
|
858
858
|
fileName: _jsxFileName,
|
|
859
|
-
lineNumber:
|
|
859
|
+
lineNumber: 1044,
|
|
860
860
|
columnNumber: 11
|
|
861
861
|
}
|
|
862
862
|
})), _react["default"].createElement(NetworkDownIndicator, {
|
|
863
863
|
__self: _this,
|
|
864
864
|
__source: {
|
|
865
865
|
fileName: _jsxFileName,
|
|
866
|
-
lineNumber:
|
|
866
|
+
lineNumber: 1051,
|
|
867
867
|
columnNumber: 7
|
|
868
868
|
}
|
|
869
869
|
}));
|
|
@@ -970,7 +970,7 @@ var MessageList = function MessageList(props) {
|
|
|
970
970
|
__self: _this,
|
|
971
971
|
__source: {
|
|
972
972
|
fileName: _jsxFileName,
|
|
973
|
-
lineNumber:
|
|
973
|
+
lineNumber: 1109,
|
|
974
974
|
columnNumber: 5
|
|
975
975
|
}
|
|
976
976
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","container","alignItems","flex","width","contentContainer","flexGrow","paddingBottom","invert","transform","scaleY","invertAndroid","scaleX","listContainer","messagePadding","paddingHorizontal","stickyHeader","position","top","InvertedCellRendererComponent","props","keyExtractor","item","id","created_at","toISOString","Date","now","toString","flatListViewabilityConfig","viewAreaCoveragePercentThreshold","MessageListWithContext","LoadingMoreIndicator","threadList","InlineLoadingMoreThreadIndicator","InlineLoadingMoreIndicator","additionalFlatListProps","channel","client","closePicker","DateHeader","disabled","disableTypingIndicator","EmptyStateIndicator","FlatList","FooterComponent","hasNoMoreRecentMessagesToLoad","HeaderComponent","InlineLoadingMoreRecentIndicator","hideStickyDateHeader","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","inverted","isListActive","legacyImageViewerSwipeBehaviour","loadChannelAroundMessage","loading","LoadingIndicator","loadMore","loadMoreRecent","loadMoreThread","markRead","Message","MessageSystem","myMessageTheme","NetworkDownIndicator","noGroupByUser","onListScroll","onThreadSelect","overlay","reloadChannel","ScrollToBottomButton","scrollToFirstUnreadThreshold","selectedPicker","setFlatListRef","setMessages","setSelectedPicker","setTargetedMessage","StickyHeader","targetedMessage","tDateTimeParser","thread","TypingIndicator","TypingIndicatorContainer","useTheme","theme","white_snow","colors","messageList","modifiedTheme","useMemo","mergeThemes","style","useMessageList","messageListLengthBeforeUpdate","useRef","messageListLengthAfterUpdate","length","topMessageBeforeUpdate","topMessageAfterUpdate","useState","autoscrollToTop","setAutoscrollToTop","onStartReachedTracker","onEndReachedTracker","onStartReachedInPromise","onEndReachedInPromise","flatListRef","initialScrollSet","channelResyncScrollSet","scrollToDebounceTimeoutRef","messageIdToScrollToRef","messageIdLastScrolledToRef","hasMoved","setHasMoved","getLastReceivedMessage","lastReceivedId","setLastReceivedId","scrollToBottomButtonVisible","setScrollToBottomButtonVisible","stickyHeaderDate","setStickyHeaderDate","stickyHeaderDateRef","isUnreadMessageRef","message","lastRead","channelLastReadRef","initialized","undefined","useEffect","current","updateStickyHeaderDateIfNeeded","viewableItems","lastItem","pop","isMessageTypeDeleted","type","toDateString","onViewableItemsChanged","Platform","OS","resetPaginationTrackersRef","shouldMarkReadOnFirstLoad","countUnread","lastReceivedMessage","hasNewMessage","isMyMessage","user","userID","scrollToBottomIfNeeded","setTimeout","scrollToOffset","offset","maybeCallOnStartReached","renderItem","index","offlineMode","lastMessage","showUnreadUnderlay","insertInlineUnreadIndicator","wrapMessageInTheme","goToMessage","isMessageWithStylesReadByAndDateSeparator","groupStyles","dateSeparator","quoted_message_id","limit","callback","Promise","resolve","onError","then","maybeCallOnEndReached","handleScroll","event","nativeEvent","contentOffset","y","visibleLength","layoutMeasurement","height","contentLength","contentSize","isScrollAtStart","isScrollAtEnd","isScrollAtBottom","showScrollToBottomButton","shouldMarkRead","goToNewMessages","onScrollToIndexFailedRef","info","animated","averageItemLength","scrollToIndex","viewPosition","useCallback","messageId","indexOfParentInMessageList","findIndex","clearTimeout","messageIdToScroll","messagesWithImages","filter","attachments","some","attachment","title_link","og_scrape_url","image_url","thumb_url","imageString","map","join","numberOfMessagesWithImages","threadExists","stickyHeaderFormatDate","getFullYear","tStickyHeaderDate","stickyHeaderDateString","isDayOrMoment","format","dismissImagePicker","onScrollBeginDrag","onScrollEndDrag","refCallback","ref","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","setEventType","setSendEventParams","action","data","renderListEmptyComponent","StickyHeaderComponent","shouldApplyAndroidWorkaround","Version","backgroundColor","autoscrollToTopThreshold","minIndexForVisible","MessageList","useAttachmentPickerContext","useChannelContext","enableMessageGroupingByUser","error","isChannelActive","useChatContext","useImageGalleryContext","useMessagesContext","usePaginatedMessageListContext","useOverlayContext","useThreadContext","useTranslationContext","t"],"sources":["MessageList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n FlatListProps,\n FlatList as FlatListType,\n Platform,\n ScrollViewProps,\n StyleSheet,\n View,\n ViewToken,\n} from 'react-native';\n\nimport type { Channel as StreamChannel } from 'stream-chat';\n\nimport {\n isMessageWithStylesReadByAndDateSeparator,\n MessageType,\n useMessageList,\n} from './hooks/useMessageList';\nimport { InlineLoadingMoreIndicator } from './InlineLoadingMoreIndicator';\nimport { InlineLoadingMoreRecentIndicator } from './InlineLoadingMoreRecentIndicator';\nimport { InlineLoadingMoreThreadIndicator } from './InlineLoadingMoreThreadIndicator';\nimport { getLastReceivedMessage } from './utils/getLastReceivedMessage';\n\nimport {\n AttachmentPickerContextValue,\n useAttachmentPickerContext,\n} from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../contexts/channelContext/ChannelContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport {\n ImageGalleryContextValue,\n useImageGalleryContext,\n} from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport {\n PaginatedMessageListContextValue,\n usePaginatedMessageListContext,\n} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { ThreadContextValue, useThreadContext } from '../../contexts/threadContext/ThreadContext';\nimport {\n isDayOrMoment,\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flex: 1,\n width: '100%',\n },\n contentContainer: {\n flexGrow: 1,\n /**\n * paddingBottom is set to 4 to account for the default date\n * header and inline indicator alignment. The top margin is 8\n * on the header but 4 on the inline date, this adjusts the spacing\n * to allow the \"first\" inline date to align with the date header.\n */\n paddingBottom: 4,\n },\n flex: { flex: 1 },\n invert: { transform: [{ scaleY: -1 }] },\n invertAndroid: {\n // Invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13\n // details: https://github.com/Expensify/App/pull/12820\n transform: [{ scaleX: -1 }, { scaleY: -1 }],\n },\n listContainer: {\n flex: 1,\n width: '100%',\n },\n messagePadding: {\n paddingHorizontal: 8,\n },\n stickyHeader: {\n position: 'absolute',\n top: 0,\n },\n});\n\nconst InvertedCellRendererComponent = (props: React.PropsWithChildren<unknown>) => (\n <View {...props} style={styles.invertAndroid} />\n);\n\nconst keyExtractor = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n item: MessageType<StreamChatGenerics>,\n) => {\n if (item.id) return item.id;\n if (item.created_at)\n return typeof item.created_at === 'string' ? item.created_at : item.created_at.toISOString();\n return Date.now().toString();\n};\n\nconst flatListViewabilityConfig = {\n viewAreaCoveragePercentThreshold: 1,\n};\n\ntype MessageListPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> &\n Pick<\n ChannelContextValue<StreamChatGenerics>,\n | 'channel'\n | 'disabled'\n | 'EmptyStateIndicator'\n | 'hideStickyDateHeader'\n | 'loadChannelAroundMessage'\n | 'loading'\n | 'LoadingIndicator'\n | 'markRead'\n | 'NetworkDownIndicator'\n | 'reloadChannel'\n | 'scrollToFirstUnreadThreshold'\n | 'setTargetedMessage'\n | 'StickyHeader'\n | 'targetedMessage'\n > &\n Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &\n Pick<\n PaginatedMessageListContextValue<StreamChatGenerics>,\n 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'\n > &\n Pick<OverlayContextValue, 'overlay'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'DateHeader'\n | 'disableTypingIndicator'\n | 'FlatList'\n | 'initialScrollToFirstUnreadMessage'\n | 'InlineDateSeparator'\n | 'InlineUnreadIndicator'\n | 'legacyImageViewerSwipeBehaviour'\n | 'Message'\n | 'ScrollToBottomButton'\n | 'MessageSystem'\n | 'myMessageTheme'\n | 'TypingIndicator'\n | 'TypingIndicatorContainer'\n > &\n Pick<ThreadContextValue<StreamChatGenerics>, 'loadMoreThread' | 'thread'> &\n Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {\n /**\n * Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want\n * to attach some additional props to underlying FlatList, you can add it to following prop.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **NOTE** Don't use `additionalFlatListProps` to get access to ref of flatlist. Use `setFlatListRef` instead.\n *\n * e.g.\n * ```js\n * <MessageList\n * additionalFlatListProps={{ bounces: true, keyboardDismissMode: true }} />\n * ```\n */\n additionalFlatListProps?: Partial<FlatListProps<MessageType<StreamChatGenerics>>>;\n /**\n * UI component for footer of message list. By default message list will use `InlineLoadingMoreIndicator`\n * as FooterComponent. If you want to implement your own inline loading indicator, you can access `loadingMore`\n * from context.\n *\n * This is a [ListHeaderComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header by default if inverted is true or defaulted\n */\n FooterComponent?: React.ComponentType;\n /**\n * UI component for header of message list. By default message list will use `InlineLoadingMoreRecentIndicator`\n * as HeaderComponent. If you want to implement your own inline loading indicator, you can access `loadingMoreRecent`\n * from context.\n *\n * This is a [ListFooterComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header if inverted is false\n */\n HeaderComponent?: React.ComponentType;\n /** Whether or not the FlatList is inverted. Defaults to true */\n inverted?: boolean;\n isListActive?: boolean;\n /** Turn off grouping of messages by user */\n noGroupByUser?: boolean;\n onListScroll?: ScrollViewProps['onScroll'];\n /**\n * Handler to open the thread on message. This is callback for touch event for replies button.\n *\n * @param message A message object to open the thread upon.\n */\n onThreadSelect?: (message: ThreadContextValue<StreamChatGenerics>['thread']) => void;\n /**\n * Use `setFlatListRef` to get access to ref to inner FlatList.\n *\n * e.g.\n * ```js\n * <MessageList\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef?: (ref: FlatListType<MessageType<StreamChatGenerics>> | null) => void;\n /**\n * Boolean whether or not the Messages in the MessageList are part of a Thread\n **/\n threadList?: boolean;\n };\n\n/**\n * The message list component renders a list of messages. It consumes the following contexts:\n *\n * [ChannelContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/channel-context/)\n * [ChatContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/chat-context/)\n * [MessagesContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/)\n * [ThreadContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/thread-context/)\n * [TranslationContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/translation-context/)\n */\nconst MessageListWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListPropsWithContext<StreamChatGenerics>,\n) => {\n const LoadingMoreIndicator = props.threadList\n ? InlineLoadingMoreThreadIndicator\n : InlineLoadingMoreIndicator;\n const {\n additionalFlatListProps,\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n FlatList,\n FooterComponent = LoadingMoreIndicator,\n hasNoMoreRecentMessagesToLoad,\n HeaderComponent = InlineLoadingMoreRecentIndicator,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n inverted = true,\n isListActive = false,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n noGroupByUser,\n onListScroll,\n onThreadSelect,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setFlatListRef,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n tDateTimeParser,\n thread,\n threadList = false,\n TypingIndicator,\n TypingIndicatorContainer,\n } = props;\n\n const { theme } = useTheme();\n\n const {\n colors: { white_snow },\n messageList: { container, contentContainer, listContainer },\n } = theme;\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageTheme, theme],\n );\n\n const messageList = useMessageList<StreamChatGenerics>({\n noGroupByUser,\n threadList,\n });\n const messageListLengthBeforeUpdate = useRef(0);\n const messageListLengthAfterUpdate = messageList.length;\n\n /**\n * We need topMessage and channelLastRead values to set the initial scroll position.\n * So these values only get used if `initialScrollToFirstUnreadMessage` prop is true.\n */\n const topMessageBeforeUpdate = useRef<MessageType<StreamChatGenerics>>();\n const topMessageAfterUpdate = messageList[messageList.length - 1];\n\n const [autoscrollToTop, setAutoscrollToTop] = useState(false);\n\n /**\n * We want to call onEndReached and onStartReached only once, per content length.\n * We keep track of calls to these functions per content length, with following trackers.\n */\n const onStartReachedTracker = useRef<Record<number, boolean>>({});\n const onEndReachedTracker = useRef<Record<number, boolean>>({});\n\n const onStartReachedInPromise = useRef<Promise<void> | null>(null);\n const onEndReachedInPromise = useRef<Promise<void> | null>(null);\n\n const flatListRef = useRef<FlatListType<MessageType<StreamChatGenerics>> | null>(null);\n\n /**\n * Flag to track if the initial scroll has been set\n * If the prop `initialScrollToFirstUnreadMessage` was enabled, then we scroll to the unread msg and set it to true\n * If not, the default offset of 0 for flatList means that it has been set already\n */\n const initialScrollSet = useRef<boolean>(!initialScrollToFirstUnreadMessage);\n\n const channelResyncScrollSet = useRef<boolean>(true);\n\n /**\n * The timeout id used to debounce our scrollToIndex calls on messageList updates\n */\n const scrollToDebounceTimeoutRef = useRef<NodeJS.Timeout>();\n\n /**\n * If a messageId was requested to scroll to but was unloaded,\n * this flag keeps track of it to scroll to it after loading the message\n */\n const messageIdToScrollToRef = useRef<string>();\n /**\n * Last messageID that was scrolled to after loading a new message list,\n * this flag keeps track of it so that we dont scroll to it again on target message set\n */\n const messageIdLastScrolledToRef = useRef<string>();\n const [hasMoved, setHasMoved] = useState(false);\n const [lastReceivedId, setLastReceivedId] = useState(getLastReceivedMessage(messageList)?.id);\n const [scrollToBottomButtonVisible, setScrollToBottomButtonVisible] = useState(false);\n\n const [stickyHeaderDate, setStickyHeaderDate] = useState<Date | undefined>();\n const stickyHeaderDateRef = useRef<Date | undefined>();\n\n const isUnreadMessageRef = useRef(\n (\n message: MessageType<StreamChatGenerics> | undefined,\n lastRead?: ReturnType<StreamChannel<StreamChatGenerics>['lastRead']>,\n ) => message && lastRead && message.created_at && lastRead < message.created_at,\n );\n\n const channelLastReadRef = useRef(channel?.initialized ? channel.lastRead() : undefined);\n\n useEffect(() => {\n channelLastReadRef.current = channel?.initialized ? channel.lastRead() : undefined;\n }, [channel]);\n\n const updateStickyHeaderDateIfNeeded = (viewableItems: ViewToken[]) => {\n if (viewableItems.length) {\n const lastItem = viewableItems.pop() as {\n item: MessageType<StreamChatGenerics>;\n };\n\n const isMessageTypeDeleted = lastItem.item.type === 'deleted';\n\n if (\n lastItem?.item?.created_at &&\n !isMessageTypeDeleted &&\n typeof lastItem.item.created_at !== 'string' &&\n lastItem.item.created_at.toDateString() !== stickyHeaderDateRef.current?.toDateString()\n ) {\n stickyHeaderDateRef.current = lastItem.item.created_at;\n setStickyHeaderDate(lastItem.item.created_at);\n }\n }\n };\n\n /**\n * FlatList doesn't accept changeable function for onViewableItemsChanged prop.\n * Thus useRef.\n */\n const onViewableItemsChanged = useRef(\n ({ viewableItems }: { viewableItems: ViewToken[] | undefined }) => {\n /**\n * When a new message comes in, list scrolls down to the bottom automatically (using prop `maintainVisibleContentPosition`)\n * and we mark the channel as read from handleScroll function.\n * Although this logic is dependent on the fact that `onScroll` event gets triggered during this process.\n * But for Android, this event is not triggered when messages length is lesser than visible screen height.\n *\n * And thus we need to check if the message list length is lesser than visible screen height and mark the channel as read.\n */\n if (\n Platform.OS === 'android' &&\n viewableItems?.length &&\n viewableItems?.length >= messageListLengthBeforeUpdate.current\n ) {\n channel.markRead();\n }\n\n if (viewableItems && !hideStickyDateHeader) {\n updateStickyHeaderDateIfNeeded(viewableItems);\n }\n },\n );\n\n /**\n * Resets the pagination trackers, doing so cancels currently scheduled loading more calls\n */\n const resetPaginationTrackersRef = useRef(() => {\n onStartReachedTracker.current = {};\n onEndReachedTracker.current = {};\n });\n\n useEffect(() => {\n setScrollToBottomButtonVisible(false);\n }, [disabled]);\n\n useEffect(() => {\n /**\n * 1. !initialScrollToFirstUnreadMessage && channel.countUnread() > 0\n *\n * In this case MessageList won't scroll to first unread message when opened, so we can mark\n * the channel as read right after opening.\n *\n * 2. initialScrollToFirstUnreadMessage && channel.countUnread() <= scrollToFirstUnreadThreshold\n *\n * In this case MessageList will be opened to first unread message.\n * But if there are not enough (scrollToFirstUnreadThreshold) unread messages, then MessageList\n * won't need to scroll up. So we can safely mark the channel as read right after opening.\n */\n const shouldMarkReadOnFirstLoad =\n !loading &&\n channel &&\n ((!initialScrollToFirstUnreadMessage && channel.countUnread() > 0) ||\n (initialScrollToFirstUnreadMessage &&\n channel.countUnread() <= scrollToFirstUnreadThreshold));\n\n if (shouldMarkReadOnFirstLoad) {\n markRead();\n }\n }, [loading]);\n\n useEffect(() => {\n const lastReceivedMessage = getLastReceivedMessage(messageList);\n\n const hasNewMessage = lastReceivedId !== lastReceivedMessage?.id;\n const isMyMessage = lastReceivedMessage?.user?.id === client.userID;\n\n setLastReceivedId(lastReceivedMessage?.id);\n\n /**\n * Scroll down when\n * 1. you send a new message to channel\n * 2. new message list is small than the one before update - channel has resynced\n * 3. created_at timestamp of top message before update is lesser than created_at timestamp of top message after update - channel has resynced\n */\n const scrollToBottomIfNeeded = () => {\n if (!client || !channel || messageList.length === 0) {\n return;\n }\n if (\n (hasNewMessage && isMyMessage) ||\n messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current ||\n (topMessageBeforeUpdate.current?.created_at &&\n topMessageAfterUpdate?.created_at &&\n topMessageBeforeUpdate.current.created_at < topMessageAfterUpdate.created_at)\n ) {\n channelResyncScrollSet.current = false;\n setScrollToBottomButtonVisible(false);\n resetPaginationTrackersRef.current();\n\n setTimeout(() => {\n flatListRef.current?.scrollToOffset({\n offset: 0,\n });\n }, 50);\n setTimeout(() => {\n channelResyncScrollSet.current = true;\n if (channel.countUnread() > 0) {\n markRead();\n }\n }, 500);\n }\n };\n\n if (threadList || hasNoMoreRecentMessagesToLoad) {\n scrollToBottomIfNeeded();\n } else if (!scrollToBottomButtonVisible) {\n setScrollToBottomButtonVisible(true);\n }\n\n if (\n !hasNoMoreRecentMessagesToLoad &&\n flatListRef.current &&\n messageListLengthBeforeUpdate.current === 0 &&\n messageListLengthAfterUpdate < 10\n ) {\n /**\n * Trigger onStartReached on first load, if messages are not enough to fill the screen.\n * This is important especially for android, where you can't overscroll.\n */\n maybeCallOnStartReached(10);\n }\n\n messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;\n topMessageBeforeUpdate.current = topMessageAfterUpdate;\n }, [messageListLengthAfterUpdate, topMessageAfterUpdate?.id]);\n\n useEffect(() => {\n setAutoscrollToTop(hasNoMoreRecentMessagesToLoad);\n }, [messageList, hasNoMoreRecentMessagesToLoad]);\n\n const renderItem = ({\n index,\n item: message,\n }: {\n index: number;\n item: MessageType<StreamChatGenerics>;\n }) => {\n if (!channel || (!channel.initialized && !channel.offlineMode)) return null;\n\n const lastRead = channel.lastRead();\n\n const lastMessage = messageList?.[index + 1];\n\n const showUnreadUnderlay =\n !!isUnreadMessageRef.current(message, lastRead) && scrollToBottomButtonVisible;\n const insertInlineUnreadIndicator =\n showUnreadUnderlay && !isUnreadMessageRef.current(lastMessage, lastRead);\n\n if (message.type === 'system') {\n return (\n <>\n <View testID={`message-list-item-${index}`}>\n <MessageSystem message={message} style={styles.messagePadding} />\n </View>\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n }\n\n const wrapMessageInTheme = client.userID === message.user?.id && !!myMessageTheme;\n return wrapMessageInTheme ? (\n <>\n <ThemeProvider mergedStyle={modifiedTheme}>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={lastReceivedId === message.id ? lastReceivedId : undefined}\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n </ThemeProvider>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n ) : (\n <>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={\n lastReceivedId === message.id || message.quoted_message_id\n ? lastReceivedId\n : undefined\n }\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n };\n\n /**\n * We are keeping full control on message pagination, and not relying on react-native for it.\n * The reasons being,\n * 1. FlatList doesn't support onStartReached prop\n * 2. `onEndReached` function prop available on react-native, gets executed\n * once per content length (and thats actually a nice optimization strategy).\n * But it also means, we always need to prioritize onEndReached above our\n * logic for `onStartReached`.\n * 3. `onEndReachedThreshold` prop decides - at which scroll position to call `onEndReached`.\n * Its a factor of content length (which is necessary for \"real\" infinite scroll). But on\n * the other hand, it also makes calls to `onEndReached` (and this `channel.query`) way\n * too early during scroll, which we don't really need. So we are going to instead\n * keep some fixed offset distance, to decide when to call `loadMore` or `loadMoreRecent`.\n *\n * We are still gonna keep the optimization, which react-native does - only call onEndReached\n * once per content length.\n */\n\n /**\n * 1. Makes a call to `loadMoreRecent` function, which queries more recent messages.\n * 2. Ensures that we call `loadMoreRecent`, once per content length\n * 3. If the call to `loadMore` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnStartReached = async (limit?: number) => {\n // If onStartReached has already been called for given data length, then ignore.\n if (messageList?.length && onStartReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onStartReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onStartReachedInPromise.current = null;\n\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onStartReached trigger after 2 seconds, to try again */\n setTimeout(() => {\n onStartReachedTracker.current = {};\n }, 2000);\n };\n\n // If onEndReached is in progress, better to wait for it to finish for smooth UX\n if (onEndReachedInPromise.current) {\n await onEndReachedInPromise.current;\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n } else {\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n }\n };\n\n /**\n * 1. Makes a call to `loadMore` function, which queries more older messages.\n * 2. Ensures that we call `loadMore`, once per content length\n * 3. If the call to `loadMoreRecent` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnEndReached = async () => {\n // If onEndReached has already been called for given messageList length, then ignore.\n if (messageList?.length && onEndReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onEndReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onEndReachedInPromise.current = null;\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onEndReachedTracker trigger after 2 seconds, to try again */\n setTimeout(() => {\n onEndReachedTracker.current = {};\n }, 2000);\n };\n\n // If onStartReached is in progress, better to wait for it to finish for smooth UX\n if (onStartReachedInPromise.current) {\n await onStartReachedInPromise.current;\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n } else {\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n }\n };\n\n /**\n * Following if condition covers following cases:\n * 1. If I scroll up -> show scrollToBottom button.\n * 2. If I scroll to bottom of screen\n * |-> hide scrollToBottom button.\n * |-> if channel is unread, call markRead().\n */\n const handleScroll: ScrollViewProps['onScroll'] = (event) => {\n if (!channel || !channelResyncScrollSet.current) {\n return;\n }\n\n const offset = event.nativeEvent.contentOffset.y;\n const visibleLength = event.nativeEvent.layoutMeasurement.height;\n const contentLength = event.nativeEvent.contentSize.height;\n // Check if scroll has reached either start of end of list.\n const isScrollAtStart = offset < 100;\n const isScrollAtEnd = contentLength - visibleLength - offset < 100;\n\n if (isScrollAtStart) {\n maybeCallOnStartReached();\n }\n\n if (isScrollAtEnd) {\n maybeCallOnEndReached();\n }\n\n // Show scrollToBottom button once scroll position goes beyond 300.\n const isScrollAtBottom = offset <= 300;\n const showScrollToBottomButton = !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad;\n\n const shouldMarkRead =\n !threadList && offset <= 0 && hasNoMoreRecentMessagesToLoad && channel.countUnread() > 0;\n\n if (shouldMarkRead) {\n markRead();\n }\n\n setScrollToBottomButtonVisible(showScrollToBottomButton);\n\n if (onListScroll) {\n onListScroll(event);\n }\n };\n\n const goToNewMessages = async () => {\n if (!hasNoMoreRecentMessagesToLoad) {\n resetPaginationTrackersRef.current();\n await reloadChannel();\n } else if (flatListRef.current) {\n flatListRef.current.scrollToOffset({\n offset: 0,\n });\n }\n\n setScrollToBottomButtonVisible(false);\n if (!threadList) {\n markRead();\n }\n };\n\n const onScrollToIndexFailedRef = useRef<\n FlatListProps<MessageType<StreamChatGenerics>>['onScrollToIndexFailed']\n >((info) => {\n // We got a failure as we tried to scroll to an item that was outside the render length\n if (flatListRef.current) {\n // we dont know the actual size of all items but we can see the average, so scroll to the closest offset\n flatListRef.current.scrollToOffset({\n animated: false,\n offset: info.averageItemLength * info.index,\n });\n // since we used only an average offset.. we wont go to the center of the item yet\n // with a little delay to wait for scroll to offset to complete, we can then scroll to the index\n setTimeout(() => {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: info.index,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n if (messageIdLastScrolledToRef.current) {\n setTargetedMessage(messageIdLastScrolledToRef.current);\n }\n }, 150);\n }\n });\n\n const goToMessage = useCallback(\n (messageId: string) => {\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageId,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: true,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // keep track of this messageId, so that we dont scroll to again in useEffect for targeted message change\n messageIdLastScrolledToRef.current = messageId;\n setTargetedMessage(messageId);\n return;\n }\n messageIdToScrollToRef.current = messageId; // keep track of the id to scroll afterwards\n loadChannelAroundMessage({ messageId }); // now try to load the message and whats around it\n resetPaginationTrackersRef.current();\n },\n [messageList],\n );\n\n /**\n * Check if a messageId needs to be scrolled to after list loads, and scroll to it\n * Note: This effect fires on every list change with a small debounce so that scrolling isnt abrupted by an immediate rerender\n */\n useEffect(() => {\n if (scrollToDebounceTimeoutRef.current) clearTimeout(scrollToDebounceTimeoutRef.current);\n scrollToDebounceTimeoutRef.current = setTimeout(() => {\n // goToMessage method might have requested to scroll to a message\n let messageIdToScroll: string | undefined = messageIdToScrollToRef.current;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n // find the first unread message, if we have to initially scroll to an unread message\n for (let index = messageList.length - 1; index >= 0; index--) {\n if (isUnreadMessageRef.current(messageList[index], channelLastReadRef.current)) {\n messageIdToScroll = messageList[index].id;\n break;\n }\n }\n } else if (targetedMessage && messageIdLastScrolledToRef.current !== targetedMessage) {\n // if some messageId was targeted but not scrolledTo yet\n // we have scroll to there after loading completes\n messageIdToScroll = targetedMessage;\n }\n if (!messageIdToScroll) return;\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageIdToScroll,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: false,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // reset the messageId tracker to not scroll to that again\n messageIdToScrollToRef.current = undefined;\n // keep track of this messageId, so that we dont scroll to again for targeted message change\n messageIdLastScrolledToRef.current = messageIdToScroll;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n initialScrollSet.current = true;\n } else {\n setTargetedMessage(messageIdToScroll);\n }\n }\n }, 150);\n }, [messageList, targetedMessage, initialScrollToFirstUnreadMessage]);\n\n const messagesWithImages =\n legacyImageViewerSwipeBehaviour &&\n messageList.filter((message) => {\n const isMessageTypeDeleted = message.type === 'deleted';\n if (!isMessageTypeDeleted && message.attachments) {\n return message.attachments.some(\n (attachment) =>\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n (attachment.image_url || attachment.thumb_url),\n );\n }\n return false;\n });\n\n /**\n * This is for the useEffect to run again in the case that a message\n * gets edited with more or the same number of images\n */\n const imageString =\n legacyImageViewerSwipeBehaviour &&\n messagesWithImages &&\n messagesWithImages\n .map((message) =>\n message.attachments\n ?.map((attachment) => attachment.image_url || attachment.thumb_url || '')\n .join(),\n )\n .join();\n\n const numberOfMessagesWithImages =\n legacyImageViewerSwipeBehaviour && messagesWithImages && messagesWithImages.length;\n const threadExists = !!thread;\n\n useEffect(() => {\n if (\n legacyImageViewerSwipeBehaviour &&\n isListActive &&\n ((threadList && thread) || (!threadList && !thread))\n ) {\n setMessages(messagesWithImages as MessageType<StreamChatGenerics>[]);\n }\n }, [\n imageString,\n isListActive,\n legacyImageViewerSwipeBehaviour,\n numberOfMessagesWithImages,\n threadExists,\n threadList,\n ]);\n\n const stickyHeaderFormatDate =\n stickyHeaderDate?.getFullYear() === new Date().getFullYear() ? 'MMM D' : 'MMM D, YYYY';\n const tStickyHeaderDate =\n stickyHeaderDate && !hideStickyDateHeader ? tDateTimeParser(stickyHeaderDate) : null;\n\n const stickyHeaderDateString = useMemo(() => {\n if (tStickyHeaderDate === null || hideStickyDateHeader) return null;\n if (isDayOrMoment(tStickyHeaderDate)) return tStickyHeaderDate.format(stickyHeaderFormatDate);\n\n return new Date(tStickyHeaderDate).toDateString();\n }, [tStickyHeaderDate, stickyHeaderFormatDate, hideStickyDateHeader]);\n\n const dismissImagePicker = () => {\n if (!hasMoved && selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n }\n };\n const onScrollBeginDrag = () => !hasMoved && selectedPicker && setHasMoved(true);\n const onScrollEndDrag = () => hasMoved && selectedPicker && setHasMoved(false);\n\n const refCallback = (ref: FlatListType<MessageType<StreamChatGenerics>>) => {\n flatListRef.current = ref;\n\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n };\n\n const debugRef = useDebugContext();\n\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: thread ? 'ThreadList' : 'Messages',\n data: messageList,\n });\n }\n\n const renderListEmptyComponent = () => (\n <View style={[styles.flex, styles.invert]} testID='empty-state'>\n <EmptyStateIndicator listType='message' />\n </View>\n );\n\n if (!FlatList) return null;\n\n if (loading) {\n return (\n <View style={styles.flex}>\n <LoadingIndicator listType='message' />\n </View>\n );\n }\n\n const StickyHeaderComponent = () => {\n if (!stickyHeaderDateString) return null;\n if (StickyHeader) return <StickyHeader dateString={stickyHeaderDateString} />;\n if (messageListLengthAfterUpdate) return <DateHeader dateString={stickyHeaderDateString} />;\n return null;\n };\n\n const shouldApplyAndroidWorkaround =\n inverted && Platform.OS === 'android' && Platform.Version >= 33;\n\n return (\n <View\n style={[styles.container, { backgroundColor: white_snow }, container]}\n testID='message-flat-list-wrapper'\n >\n <FlatList\n CellRendererComponent={\n shouldApplyAndroidWorkaround ? InvertedCellRendererComponent : undefined\n }\n contentContainerStyle={[styles.contentContainer, contentContainer]}\n data={messageList}\n /** Disables the MessageList UI. Which means, message actions, reactions won't work. */\n extraData={disabled || !hasNoMoreRecentMessagesToLoad}\n inverted={shouldApplyAndroidWorkaround ? false : inverted}\n keyboardShouldPersistTaps='handled'\n keyExtractor={keyExtractor}\n ListEmptyComponent={renderListEmptyComponent}\n ListFooterComponent={FooterComponent}\n ListHeaderComponent={HeaderComponent}\n maintainVisibleContentPosition={{\n autoscrollToTopThreshold: autoscrollToTop ? 10 : undefined,\n minIndexForVisible: 1,\n }}\n maxToRenderPerBatch={30}\n onScroll={handleScroll}\n onScrollBeginDrag={onScrollBeginDrag}\n onScrollEndDrag={onScrollEndDrag}\n onScrollToIndexFailed={onScrollToIndexFailedRef.current}\n onTouchEnd={dismissImagePicker}\n onViewableItemsChanged={onViewableItemsChanged.current}\n ref={refCallback}\n renderItem={renderItem}\n scrollEnabled={overlay === 'none'}\n showsVerticalScrollIndicator={!shouldApplyAndroidWorkaround}\n style={[\n styles.listContainer,\n listContainer,\n shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined,\n ]}\n testID='message-flat-list'\n viewabilityConfig={flatListViewabilityConfig}\n {...additionalFlatListProps}\n />\n {!loading && (\n <>\n <View style={styles.stickyHeader}>\n <StickyHeaderComponent />\n </View>\n {!disableTypingIndicator && TypingIndicator && (\n <TypingIndicatorContainer>\n <TypingIndicator />\n </TypingIndicatorContainer>\n )}\n <ScrollToBottomButton\n onPress={goToNewMessages}\n showNotification={scrollToBottomButtonVisible}\n unreadCount={threadList ? 0 : channel?.countUnread()}\n />\n </>\n )}\n <NetworkDownIndicator />\n </View>\n );\n};\n\nexport type MessageListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<MessageListPropsWithContext<StreamChatGenerics>>;\n\nexport const MessageList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListProps<StreamChatGenerics>,\n) => {\n const { closePicker, selectedPicker, setSelectedPicker } = useAttachmentPickerContext();\n const {\n channel,\n disabled,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n hideStickyDateHeader,\n isChannelActive,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n markRead,\n NetworkDownIndicator,\n reloadChannel,\n scrollToFirstUnreadThreshold,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n } = useChannelContext<StreamChatGenerics>();\n const { client } = useChatContext<StreamChatGenerics>();\n const { setMessages } = useImageGalleryContext<StreamChatGenerics>();\n const {\n DateHeader,\n disableTypingIndicator,\n FlatList,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n legacyImageViewerSwipeBehaviour,\n Message,\n MessageSystem,\n myMessageTheme,\n ScrollToBottomButton,\n TypingIndicator,\n TypingIndicatorContainer,\n } = useMessagesContext<StreamChatGenerics>();\n const { hasNoMoreRecentMessagesToLoad, loadMore, loadMoreRecent } =\n usePaginatedMessageListContext<StreamChatGenerics>();\n const { overlay } = useOverlayContext();\n const { loadMoreThread, thread } = useThreadContext<StreamChatGenerics>();\n const { t, tDateTimeParser } = useTranslationContext();\n\n return (\n <MessageListWithContext\n {...{\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n FlatList,\n hasNoMoreRecentMessagesToLoad,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isListActive: isChannelActive,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n t,\n targetedMessage,\n tDateTimeParser,\n thread,\n TypingIndicator,\n TypingIndicatorContainer,\n }}\n {...props}\n noGroupByUser={!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EAAbA,aAAa;IACbC,oBAAoB,EAApBA,oBAAoB;IACpBC,4BAA4B,EAA5BA,4BAA4B;IAC5BC,cAAc,EAAdA,cAAc;IACdE,WAAW,EAAXA,WAAW;IACXC,iBAAiB,EAAjBA,iBAAiB;IACjBC,kBAAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZgL,CAAC,EAADA,CAAC;IACD/K,eAAe,EAAfA,eAAe;IACfC,eAAe,EAAfA,eAAe;IACfC,MAAM,EAANA,MAAM;IACNC,eAAe,EAAfA,eAAe;IACfC,wBAAwB,EAAxBA;EAAwB,GAEtBhE,KAAK;IACT,aAAa,EAAE,CAACiO,2BAA2B,IAAIjO,KAAK,CAAC+C,aAAc;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACnE;AAEN,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","container","alignItems","flex","width","contentContainer","flexGrow","paddingBottom","invert","transform","scaleY","invertAndroid","scaleX","listContainer","messagePadding","paddingHorizontal","stickyHeader","position","top","InvertedCellRendererComponent","props","keyExtractor","item","id","created_at","toISOString","Date","now","toString","flatListViewabilityConfig","viewAreaCoveragePercentThreshold","MessageListWithContext","LoadingMoreIndicator","threadList","InlineLoadingMoreThreadIndicator","InlineLoadingMoreIndicator","additionalFlatListProps","channel","client","closePicker","DateHeader","disabled","disableTypingIndicator","EmptyStateIndicator","FlatList","FooterComponent","hasNoMoreRecentMessagesToLoad","HeaderComponent","InlineLoadingMoreRecentIndicator","hideStickyDateHeader","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","inverted","isListActive","legacyImageViewerSwipeBehaviour","loadChannelAroundMessage","loading","LoadingIndicator","loadMore","loadMoreRecent","loadMoreThread","markRead","Message","MessageSystem","myMessageTheme","NetworkDownIndicator","noGroupByUser","onListScroll","onThreadSelect","overlay","reloadChannel","ScrollToBottomButton","scrollToFirstUnreadThreshold","selectedPicker","setFlatListRef","setMessages","setSelectedPicker","setTargetedMessage","StickyHeader","targetedMessage","tDateTimeParser","thread","TypingIndicator","TypingIndicatorContainer","useTheme","theme","white_snow","colors","messageList","modifiedTheme","useMemo","mergeThemes","style","useMessageList","messageListLengthBeforeUpdate","useRef","messageListLengthAfterUpdate","length","topMessageBeforeUpdate","topMessageAfterUpdate","useState","autoscrollToTop","setAutoscrollToTop","onStartReachedTracker","onEndReachedTracker","onStartReachedInPromise","onEndReachedInPromise","flatListRef","initialScrollSet","channelResyncScrollSet","scrollToDebounceTimeoutRef","messageIdToScrollToRef","messageIdLastScrolledToRef","hasMoved","setHasMoved","getLastReceivedMessage","lastReceivedId","setLastReceivedId","scrollToBottomButtonVisible","setScrollToBottomButtonVisible","stickyHeaderDate","setStickyHeaderDate","stickyHeaderDateRef","isUnreadMessageRef","message","lastRead","channelLastReadRef","initialized","undefined","useEffect","current","updateStickyHeaderDateIfNeeded","viewableItems","lastItem","pop","isMessageTypeDeleted","type","toDateString","onViewableItemsChanged","Platform","OS","resetPaginationTrackersRef","shouldMarkReadOnFirstLoad","countUnread","lastReceivedMessage","hasNewMessage","isMyMessage","user","userID","scrollToBottomIfNeeded","setTimeout","scrollToOffset","offset","maybeCallOnStartReached","renderItem","index","offlineMode","lastMessage","showUnreadUnderlay","insertInlineUnreadIndicator","wrapMessageInTheme","goToMessage","isMessageWithStylesReadByAndDateSeparator","groupStyles","dateSeparator","quoted_message_id","limit","callback","Promise","resolve","onError","then","maybeCallOnEndReached","handleScroll","event","nativeEvent","contentOffset","y","visibleLength","layoutMeasurement","height","contentLength","contentSize","isScrollAtStart","isScrollAtEnd","isScrollAtBottom","showScrollToBottomButton","shouldMarkRead","goToNewMessages","onScrollToIndexFailedRef","info","animated","averageItemLength","scrollToIndex","viewPosition","useCallback","messageId","indexOfParentInMessageList","findIndex","clearTimeout","messageIdToScroll","messagesWithImages","filter","attachments","some","attachment","title_link","og_scrape_url","image_url","thumb_url","imageString","map","join","numberOfMessagesWithImages","threadExists","stickyHeaderFormatDate","getFullYear","tStickyHeaderDate","stickyHeaderDateString","isDayOrMoment","format","dismissImagePicker","onScrollBeginDrag","onScrollEndDrag","refCallback","ref","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","setEventType","setSendEventParams","action","data","shouldApplyAndroidWorkaround","Version","renderListEmptyComponent","StickyHeaderComponent","backgroundColor","autoscrollToTopThreshold","minIndexForVisible","MessageList","useAttachmentPickerContext","useChannelContext","enableMessageGroupingByUser","error","isChannelActive","useChatContext","useImageGalleryContext","useMessagesContext","usePaginatedMessageListContext","useOverlayContext","useThreadContext","useTranslationContext","t"],"sources":["MessageList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n FlatListProps,\n FlatList as FlatListType,\n Platform,\n ScrollViewProps,\n StyleSheet,\n View,\n ViewToken,\n} from 'react-native';\n\nimport type { Channel as StreamChannel } from 'stream-chat';\n\nimport {\n isMessageWithStylesReadByAndDateSeparator,\n MessageType,\n useMessageList,\n} from './hooks/useMessageList';\nimport { InlineLoadingMoreIndicator } from './InlineLoadingMoreIndicator';\nimport { InlineLoadingMoreRecentIndicator } from './InlineLoadingMoreRecentIndicator';\nimport { InlineLoadingMoreThreadIndicator } from './InlineLoadingMoreThreadIndicator';\nimport { getLastReceivedMessage } from './utils/getLastReceivedMessage';\n\nimport {\n AttachmentPickerContextValue,\n useAttachmentPickerContext,\n} from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../contexts/channelContext/ChannelContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport {\n ImageGalleryContextValue,\n useImageGalleryContext,\n} from '../../contexts/imageGalleryContext/ImageGalleryContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport {\n OverlayContextValue,\n useOverlayContext,\n} from '../../contexts/overlayContext/OverlayContext';\nimport {\n PaginatedMessageListContextValue,\n usePaginatedMessageListContext,\n} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { mergeThemes, ThemeProvider, useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { ThreadContextValue, useThreadContext } from '../../contexts/threadContext/ThreadContext';\nimport {\n isDayOrMoment,\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flex: 1,\n width: '100%',\n },\n contentContainer: {\n flexGrow: 1,\n /**\n * paddingBottom is set to 4 to account for the default date\n * header and inline indicator alignment. The top margin is 8\n * on the header but 4 on the inline date, this adjusts the spacing\n * to allow the \"first\" inline date to align with the date header.\n */\n paddingBottom: 4,\n },\n flex: { flex: 1 },\n invert: { transform: [{ scaleY: -1 }] },\n invertAndroid: {\n // Invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13\n // details: https://github.com/Expensify/App/pull/12820\n transform: [{ scaleX: -1 }, { scaleY: -1 }],\n },\n listContainer: {\n flex: 1,\n width: '100%',\n },\n messagePadding: {\n paddingHorizontal: 8,\n },\n stickyHeader: {\n position: 'absolute',\n top: 0,\n },\n});\n\nconst InvertedCellRendererComponent = (props: React.PropsWithChildren<unknown>) => (\n <View {...props} style={styles.invertAndroid} />\n);\n\nconst keyExtractor = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n item: MessageType<StreamChatGenerics>,\n) => {\n if (item.id) return item.id;\n if (item.created_at)\n return typeof item.created_at === 'string' ? item.created_at : item.created_at.toISOString();\n return Date.now().toString();\n};\n\nconst flatListViewabilityConfig = {\n viewAreaCoveragePercentThreshold: 1,\n};\n\ntype MessageListPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> &\n Pick<\n ChannelContextValue<StreamChatGenerics>,\n | 'channel'\n | 'disabled'\n | 'EmptyStateIndicator'\n | 'hideStickyDateHeader'\n | 'loadChannelAroundMessage'\n | 'loading'\n | 'LoadingIndicator'\n | 'markRead'\n | 'NetworkDownIndicator'\n | 'reloadChannel'\n | 'scrollToFirstUnreadThreshold'\n | 'setTargetedMessage'\n | 'StickyHeader'\n | 'targetedMessage'\n > &\n Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &\n Pick<\n PaginatedMessageListContextValue<StreamChatGenerics>,\n 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'\n > &\n Pick<OverlayContextValue, 'overlay'> &\n Pick<\n MessagesContextValue<StreamChatGenerics>,\n | 'DateHeader'\n | 'disableTypingIndicator'\n | 'FlatList'\n | 'initialScrollToFirstUnreadMessage'\n | 'InlineDateSeparator'\n | 'InlineUnreadIndicator'\n | 'legacyImageViewerSwipeBehaviour'\n | 'Message'\n | 'ScrollToBottomButton'\n | 'MessageSystem'\n | 'myMessageTheme'\n | 'TypingIndicator'\n | 'TypingIndicatorContainer'\n > &\n Pick<ThreadContextValue<StreamChatGenerics>, 'loadMoreThread' | 'thread'> &\n Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {\n /**\n * Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want\n * to attach some additional props to underlying FlatList, you can add it to following prop.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **NOTE** Don't use `additionalFlatListProps` to get access to ref of flatlist. Use `setFlatListRef` instead.\n *\n * e.g.\n * ```js\n * <MessageList\n * additionalFlatListProps={{ bounces: true, keyboardDismissMode: true }} />\n * ```\n */\n additionalFlatListProps?: Partial<FlatListProps<MessageType<StreamChatGenerics>>>;\n /**\n * UI component for footer of message list. By default message list will use `InlineLoadingMoreIndicator`\n * as FooterComponent. If you want to implement your own inline loading indicator, you can access `loadingMore`\n * from context.\n *\n * This is a [ListHeaderComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header by default if inverted is true or defaulted\n */\n FooterComponent?: React.ComponentType;\n /**\n * UI component for header of message list. By default message list will use `InlineLoadingMoreRecentIndicator`\n * as HeaderComponent. If you want to implement your own inline loading indicator, you can access `loadingMoreRecent`\n * from context.\n *\n * This is a [ListFooterComponent](https://facebook.github.io/react-native/docs/flatlist#listheadercomponent) of FlatList\n * used in MessageList. Should be used for header if inverted is false\n */\n HeaderComponent?: React.ComponentType;\n /** Whether or not the FlatList is inverted. Defaults to true */\n inverted?: boolean;\n isListActive?: boolean;\n /** Turn off grouping of messages by user */\n noGroupByUser?: boolean;\n onListScroll?: ScrollViewProps['onScroll'];\n /**\n * Handler to open the thread on message. This is callback for touch event for replies button.\n *\n * @param message A message object to open the thread upon.\n */\n onThreadSelect?: (message: ThreadContextValue<StreamChatGenerics>['thread']) => void;\n /**\n * Use `setFlatListRef` to get access to ref to inner FlatList.\n *\n * e.g.\n * ```js\n * <MessageList\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef?: (ref: FlatListType<MessageType<StreamChatGenerics>> | null) => void;\n /**\n * Boolean whether or not the Messages in the MessageList are part of a Thread\n **/\n threadList?: boolean;\n };\n\n/**\n * The message list component renders a list of messages. It consumes the following contexts:\n *\n * [ChannelContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/channel-context/)\n * [ChatContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/chat-context/)\n * [MessagesContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/)\n * [ThreadContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/thread-context/)\n * [TranslationContext](https://getstream.io/chat/docs/sdk/reactnative/contexts/translation-context/)\n */\nconst MessageListWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListPropsWithContext<StreamChatGenerics>,\n) => {\n const LoadingMoreIndicator = props.threadList\n ? InlineLoadingMoreThreadIndicator\n : InlineLoadingMoreIndicator;\n const {\n additionalFlatListProps,\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n FlatList,\n FooterComponent = LoadingMoreIndicator,\n hasNoMoreRecentMessagesToLoad,\n HeaderComponent = InlineLoadingMoreRecentIndicator,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n inverted = true,\n isListActive = false,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n noGroupByUser,\n onListScroll,\n onThreadSelect,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setFlatListRef,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n tDateTimeParser,\n thread,\n threadList = false,\n TypingIndicator,\n TypingIndicatorContainer,\n } = props;\n\n const { theme } = useTheme();\n\n const {\n colors: { white_snow },\n messageList: { container, contentContainer, listContainer },\n } = theme;\n\n const modifiedTheme = useMemo(\n () => mergeThemes({ style: myMessageTheme, theme }),\n [myMessageTheme, theme],\n );\n\n const messageList = useMessageList<StreamChatGenerics>({\n noGroupByUser,\n threadList,\n });\n const messageListLengthBeforeUpdate = useRef(0);\n const messageListLengthAfterUpdate = messageList.length;\n\n /**\n * We need topMessage and channelLastRead values to set the initial scroll position.\n * So these values only get used if `initialScrollToFirstUnreadMessage` prop is true.\n */\n const topMessageBeforeUpdate = useRef<MessageType<StreamChatGenerics>>();\n const topMessageAfterUpdate = messageList[messageList.length - 1];\n\n const [autoscrollToTop, setAutoscrollToTop] = useState(false);\n\n /**\n * We want to call onEndReached and onStartReached only once, per content length.\n * We keep track of calls to these functions per content length, with following trackers.\n */\n const onStartReachedTracker = useRef<Record<number, boolean>>({});\n const onEndReachedTracker = useRef<Record<number, boolean>>({});\n\n const onStartReachedInPromise = useRef<Promise<void> | null>(null);\n const onEndReachedInPromise = useRef<Promise<void> | null>(null);\n\n const flatListRef = useRef<FlatListType<MessageType<StreamChatGenerics>> | null>(null);\n\n /**\n * Flag to track if the initial scroll has been set\n * If the prop `initialScrollToFirstUnreadMessage` was enabled, then we scroll to the unread msg and set it to true\n * If not, the default offset of 0 for flatList means that it has been set already\n */\n const initialScrollSet = useRef<boolean>(!initialScrollToFirstUnreadMessage);\n\n const channelResyncScrollSet = useRef<boolean>(true);\n\n /**\n * The timeout id used to debounce our scrollToIndex calls on messageList updates\n */\n const scrollToDebounceTimeoutRef = useRef<NodeJS.Timeout>();\n\n /**\n * If a messageId was requested to scroll to but was unloaded,\n * this flag keeps track of it to scroll to it after loading the message\n */\n const messageIdToScrollToRef = useRef<string>();\n /**\n * Last messageID that was scrolled to after loading a new message list,\n * this flag keeps track of it so that we dont scroll to it again on target message set\n */\n const messageIdLastScrolledToRef = useRef<string>();\n const [hasMoved, setHasMoved] = useState(false);\n const [lastReceivedId, setLastReceivedId] = useState(getLastReceivedMessage(messageList)?.id);\n const [scrollToBottomButtonVisible, setScrollToBottomButtonVisible] = useState(false);\n\n const [stickyHeaderDate, setStickyHeaderDate] = useState<Date | undefined>();\n const stickyHeaderDateRef = useRef<Date | undefined>();\n\n const isUnreadMessageRef = useRef(\n (\n message: MessageType<StreamChatGenerics> | undefined,\n lastRead?: ReturnType<StreamChannel<StreamChatGenerics>['lastRead']>,\n ) => message && lastRead && message.created_at && lastRead < message.created_at,\n );\n\n const channelLastReadRef = useRef(channel?.initialized ? channel.lastRead() : undefined);\n\n useEffect(() => {\n channelLastReadRef.current = channel?.initialized ? channel.lastRead() : undefined;\n }, [channel]);\n\n const updateStickyHeaderDateIfNeeded = (viewableItems: ViewToken[]) => {\n if (viewableItems.length) {\n const lastItem = viewableItems.pop() as {\n item: MessageType<StreamChatGenerics>;\n };\n\n const isMessageTypeDeleted = lastItem.item.type === 'deleted';\n\n if (\n lastItem?.item?.created_at &&\n !isMessageTypeDeleted &&\n typeof lastItem.item.created_at !== 'string' &&\n lastItem.item.created_at.toDateString() !== stickyHeaderDateRef.current?.toDateString()\n ) {\n stickyHeaderDateRef.current = lastItem.item.created_at;\n setStickyHeaderDate(lastItem.item.created_at);\n }\n }\n };\n\n /**\n * FlatList doesn't accept changeable function for onViewableItemsChanged prop.\n * Thus useRef.\n */\n const onViewableItemsChanged = useRef(\n ({ viewableItems }: { viewableItems: ViewToken[] | undefined }) => {\n /**\n * When a new message comes in, list scrolls down to the bottom automatically (using prop `maintainVisibleContentPosition`)\n * and we mark the channel as read from handleScroll function.\n * Although this logic is dependent on the fact that `onScroll` event gets triggered during this process.\n * But for Android, this event is not triggered when messages length is lesser than visible screen height.\n *\n * And thus we need to check if the message list length is lesser than visible screen height and mark the channel as read.\n */\n if (\n Platform.OS === 'android' &&\n viewableItems?.length &&\n viewableItems?.length >= messageListLengthBeforeUpdate.current\n ) {\n channel.markRead();\n }\n\n if (viewableItems && !hideStickyDateHeader) {\n updateStickyHeaderDateIfNeeded(viewableItems);\n }\n },\n );\n\n /**\n * Resets the pagination trackers, doing so cancels currently scheduled loading more calls\n */\n const resetPaginationTrackersRef = useRef(() => {\n onStartReachedTracker.current = {};\n onEndReachedTracker.current = {};\n });\n\n useEffect(() => {\n setScrollToBottomButtonVisible(false);\n }, [disabled]);\n\n useEffect(() => {\n /**\n * 1. !initialScrollToFirstUnreadMessage && channel.countUnread() > 0\n *\n * In this case MessageList won't scroll to first unread message when opened, so we can mark\n * the channel as read right after opening.\n *\n * 2. initialScrollToFirstUnreadMessage && channel.countUnread() <= scrollToFirstUnreadThreshold\n *\n * In this case MessageList will be opened to first unread message.\n * But if there are not enough (scrollToFirstUnreadThreshold) unread messages, then MessageList\n * won't need to scroll up. So we can safely mark the channel as read right after opening.\n */\n const shouldMarkReadOnFirstLoad =\n !loading &&\n channel &&\n ((!initialScrollToFirstUnreadMessage && channel.countUnread() > 0) ||\n (initialScrollToFirstUnreadMessage &&\n channel.countUnread() <= scrollToFirstUnreadThreshold));\n\n if (shouldMarkReadOnFirstLoad) {\n markRead();\n }\n }, [loading]);\n\n useEffect(() => {\n const lastReceivedMessage = getLastReceivedMessage(messageList);\n\n const hasNewMessage = lastReceivedId !== lastReceivedMessage?.id;\n const isMyMessage = lastReceivedMessage?.user?.id === client.userID;\n\n setLastReceivedId(lastReceivedMessage?.id);\n\n /**\n * Scroll down when\n * 1. you send a new message to channel\n * 2. new message list is small than the one before update - channel has resynced\n * 3. created_at timestamp of top message before update is lesser than created_at timestamp of top message after update - channel has resynced\n */\n const scrollToBottomIfNeeded = () => {\n if (!client || !channel || messageList.length === 0) {\n return;\n }\n if (\n (hasNewMessage && isMyMessage) ||\n messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current ||\n (topMessageBeforeUpdate.current?.created_at &&\n topMessageAfterUpdate?.created_at &&\n topMessageBeforeUpdate.current.created_at < topMessageAfterUpdate.created_at)\n ) {\n channelResyncScrollSet.current = false;\n setScrollToBottomButtonVisible(false);\n resetPaginationTrackersRef.current();\n\n setTimeout(() => {\n flatListRef.current?.scrollToOffset({\n offset: 0,\n });\n }, 50);\n setTimeout(() => {\n channelResyncScrollSet.current = true;\n if (channel.countUnread() > 0) {\n markRead();\n }\n }, 500);\n }\n };\n\n if (threadList || hasNoMoreRecentMessagesToLoad) {\n scrollToBottomIfNeeded();\n } else if (!scrollToBottomButtonVisible) {\n setScrollToBottomButtonVisible(true);\n }\n\n if (\n !hasNoMoreRecentMessagesToLoad &&\n flatListRef.current &&\n messageListLengthBeforeUpdate.current === 0 &&\n messageListLengthAfterUpdate < 10\n ) {\n /**\n * Trigger onStartReached on first load, if messages are not enough to fill the screen.\n * This is important especially for android, where you can't overscroll.\n */\n maybeCallOnStartReached(10);\n }\n\n messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;\n topMessageBeforeUpdate.current = topMessageAfterUpdate;\n }, [messageListLengthAfterUpdate, topMessageAfterUpdate?.id]);\n\n useEffect(() => {\n setAutoscrollToTop(hasNoMoreRecentMessagesToLoad);\n }, [messageList, hasNoMoreRecentMessagesToLoad]);\n\n const renderItem = ({\n index,\n item: message,\n }: {\n index: number;\n item: MessageType<StreamChatGenerics>;\n }) => {\n if (!channel || (!channel.initialized && !channel.offlineMode)) return null;\n\n const lastRead = channel.lastRead();\n\n const lastMessage = messageList?.[index + 1];\n\n const showUnreadUnderlay =\n !!isUnreadMessageRef.current(message, lastRead) && scrollToBottomButtonVisible;\n const insertInlineUnreadIndicator =\n showUnreadUnderlay && !isUnreadMessageRef.current(lastMessage, lastRead);\n\n if (message.type === 'system') {\n return (\n <>\n <View testID={`message-list-item-${index}`}>\n <MessageSystem message={message} style={styles.messagePadding} />\n </View>\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n }\n\n const wrapMessageInTheme = client.userID === message.user?.id && !!myMessageTheme;\n return wrapMessageInTheme ? (\n <>\n <ThemeProvider mergedStyle={modifiedTheme}>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={lastReceivedId === message.id ? lastReceivedId : undefined}\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n </ThemeProvider>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n ) : (\n <>\n <View testID={`message-list-item-${index}`}>\n <Message\n goToMessage={goToMessage}\n groupStyles={\n isMessageWithStylesReadByAndDateSeparator(message) ? message.groupStyles : []\n }\n isTargetedMessage={targetedMessage === message.id}\n lastReceivedId={\n lastReceivedId === message.id || message.quoted_message_id\n ? lastReceivedId\n : undefined\n }\n message={message}\n onThreadSelect={onThreadSelect}\n showUnreadUnderlay={showUnreadUnderlay}\n style={styles.messagePadding}\n threadList={threadList}\n />\n </View>\n {isMessageWithStylesReadByAndDateSeparator(message) && message.dateSeparator && (\n <InlineDateSeparator date={message.dateSeparator} />\n )}\n {/* Adding indicator below the messages, since the list is inverted */}\n {insertInlineUnreadIndicator && <InlineUnreadIndicator />}\n </>\n );\n };\n\n /**\n * We are keeping full control on message pagination, and not relying on react-native for it.\n * The reasons being,\n * 1. FlatList doesn't support onStartReached prop\n * 2. `onEndReached` function prop available on react-native, gets executed\n * once per content length (and thats actually a nice optimization strategy).\n * But it also means, we always need to prioritize onEndReached above our\n * logic for `onStartReached`.\n * 3. `onEndReachedThreshold` prop decides - at which scroll position to call `onEndReached`.\n * Its a factor of content length (which is necessary for \"real\" infinite scroll). But on\n * the other hand, it also makes calls to `onEndReached` (and this `channel.query`) way\n * too early during scroll, which we don't really need. So we are going to instead\n * keep some fixed offset distance, to decide when to call `loadMore` or `loadMoreRecent`.\n *\n * We are still gonna keep the optimization, which react-native does - only call onEndReached\n * once per content length.\n */\n\n /**\n * 1. Makes a call to `loadMoreRecent` function, which queries more recent messages.\n * 2. Ensures that we call `loadMoreRecent`, once per content length\n * 3. If the call to `loadMore` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnStartReached = async (limit?: number) => {\n // If onStartReached has already been called for given data length, then ignore.\n if (messageList?.length && onStartReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onStartReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onStartReachedInPromise.current = null;\n\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onStartReached trigger after 2 seconds, to try again */\n setTimeout(() => {\n onStartReachedTracker.current = {};\n }, 2000);\n };\n\n // If onEndReached is in progress, better to wait for it to finish for smooth UX\n if (onEndReachedInPromise.current) {\n await onEndReachedInPromise.current;\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n } else {\n onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);\n }\n };\n\n /**\n * 1. Makes a call to `loadMore` function, which queries more older messages.\n * 2. Ensures that we call `loadMore`, once per content length\n * 3. If the call to `loadMoreRecent` is in progress, we wait for it to finish to make sure scroll doesn't jump.\n */\n const maybeCallOnEndReached = async () => {\n // If onEndReached has already been called for given messageList length, then ignore.\n if (messageList?.length && onEndReachedTracker.current[messageList.length]) {\n return;\n }\n\n if (messageList?.length) {\n onEndReachedTracker.current[messageList.length] = true;\n }\n\n const callback = () => {\n onEndReachedInPromise.current = null;\n return Promise.resolve();\n };\n\n const onError = () => {\n /** Release the onEndReachedTracker trigger after 2 seconds, to try again */\n setTimeout(() => {\n onEndReachedTracker.current = {};\n }, 2000);\n };\n\n // If onStartReached is in progress, better to wait for it to finish for smooth UX\n if (onStartReachedInPromise.current) {\n await onStartReachedInPromise.current;\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n } else {\n onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())\n .then(callback)\n .catch(onError);\n }\n };\n\n /**\n * Following if condition covers following cases:\n * 1. If I scroll up -> show scrollToBottom button.\n * 2. If I scroll to bottom of screen\n * |-> hide scrollToBottom button.\n * |-> if channel is unread, call markRead().\n */\n const handleScroll: ScrollViewProps['onScroll'] = (event) => {\n if (!channel || !channelResyncScrollSet.current) {\n return;\n }\n\n const offset = event.nativeEvent.contentOffset.y;\n const visibleLength = event.nativeEvent.layoutMeasurement.height;\n const contentLength = event.nativeEvent.contentSize.height;\n // Check if scroll has reached either start of end of list.\n const isScrollAtStart = offset < 100;\n const isScrollAtEnd = contentLength - visibleLength - offset < 100;\n\n if (isScrollAtStart) {\n maybeCallOnStartReached();\n }\n\n if (isScrollAtEnd) {\n maybeCallOnEndReached();\n }\n\n // Show scrollToBottom button once scroll position goes beyond 300.\n const isScrollAtBottom = offset <= 300;\n const showScrollToBottomButton = !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad;\n\n const shouldMarkRead =\n !threadList && offset <= 0 && hasNoMoreRecentMessagesToLoad && channel.countUnread() > 0;\n\n if (shouldMarkRead) {\n markRead();\n }\n\n setScrollToBottomButtonVisible(showScrollToBottomButton);\n\n if (onListScroll) {\n onListScroll(event);\n }\n };\n\n const goToNewMessages = async () => {\n if (!hasNoMoreRecentMessagesToLoad) {\n resetPaginationTrackersRef.current();\n await reloadChannel();\n } else if (flatListRef.current) {\n flatListRef.current.scrollToOffset({\n offset: 0,\n });\n }\n\n setScrollToBottomButtonVisible(false);\n if (!threadList) {\n markRead();\n }\n };\n\n const onScrollToIndexFailedRef = useRef<\n FlatListProps<MessageType<StreamChatGenerics>>['onScrollToIndexFailed']\n >((info) => {\n // We got a failure as we tried to scroll to an item that was outside the render length\n if (flatListRef.current) {\n // we dont know the actual size of all items but we can see the average, so scroll to the closest offset\n flatListRef.current.scrollToOffset({\n animated: false,\n offset: info.averageItemLength * info.index,\n });\n // since we used only an average offset.. we wont go to the center of the item yet\n // with a little delay to wait for scroll to offset to complete, we can then scroll to the index\n setTimeout(() => {\n flatListRef.current?.scrollToIndex({\n animated: false,\n index: info.index,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n if (messageIdLastScrolledToRef.current) {\n setTargetedMessage(messageIdLastScrolledToRef.current);\n }\n }, 150);\n }\n });\n\n const goToMessage = useCallback(\n (messageId: string) => {\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageId,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: true,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // keep track of this messageId, so that we dont scroll to again in useEffect for targeted message change\n messageIdLastScrolledToRef.current = messageId;\n setTargetedMessage(messageId);\n return;\n }\n messageIdToScrollToRef.current = messageId; // keep track of the id to scroll afterwards\n loadChannelAroundMessage({ messageId }); // now try to load the message and whats around it\n resetPaginationTrackersRef.current();\n },\n [messageList],\n );\n\n /**\n * Check if a messageId needs to be scrolled to after list loads, and scroll to it\n * Note: This effect fires on every list change with a small debounce so that scrolling isnt abrupted by an immediate rerender\n */\n useEffect(() => {\n if (scrollToDebounceTimeoutRef.current) clearTimeout(scrollToDebounceTimeoutRef.current);\n scrollToDebounceTimeoutRef.current = setTimeout(() => {\n // goToMessage method might have requested to scroll to a message\n let messageIdToScroll: string | undefined = messageIdToScrollToRef.current;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n // find the first unread message, if we have to initially scroll to an unread message\n for (let index = messageList.length - 1; index >= 0; index--) {\n if (isUnreadMessageRef.current(messageList[index], channelLastReadRef.current)) {\n messageIdToScroll = messageList[index].id;\n break;\n }\n }\n } else if (targetedMessage && messageIdLastScrolledToRef.current !== targetedMessage) {\n // if some messageId was targeted but not scrolledTo yet\n // we have scroll to there after loading completes\n messageIdToScroll = targetedMessage;\n }\n if (!messageIdToScroll) return;\n const indexOfParentInMessageList = messageList.findIndex(\n (message) => message?.id === messageIdToScroll,\n );\n if (indexOfParentInMessageList !== -1 && flatListRef.current) {\n flatListRef.current.scrollToIndex({\n animated: false,\n index: indexOfParentInMessageList,\n viewPosition: 0.5, // try to place message in the center of the screen\n });\n // reset the messageId tracker to not scroll to that again\n messageIdToScrollToRef.current = undefined;\n // keep track of this messageId, so that we dont scroll to again for targeted message change\n messageIdLastScrolledToRef.current = messageIdToScroll;\n if (!initialScrollSet.current && initialScrollToFirstUnreadMessage) {\n initialScrollSet.current = true;\n } else {\n setTargetedMessage(messageIdToScroll);\n }\n }\n }, 150);\n }, [messageList, targetedMessage, initialScrollToFirstUnreadMessage]);\n\n const messagesWithImages =\n legacyImageViewerSwipeBehaviour &&\n messageList.filter((message) => {\n const isMessageTypeDeleted = message.type === 'deleted';\n if (!isMessageTypeDeleted && message.attachments) {\n return message.attachments.some(\n (attachment) =>\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url &&\n (attachment.image_url || attachment.thumb_url),\n );\n }\n return false;\n });\n\n /**\n * This is for the useEffect to run again in the case that a message\n * gets edited with more or the same number of images\n */\n const imageString =\n legacyImageViewerSwipeBehaviour &&\n messagesWithImages &&\n messagesWithImages\n .map((message) =>\n message.attachments\n ?.map((attachment) => attachment.image_url || attachment.thumb_url || '')\n .join(),\n )\n .join();\n\n const numberOfMessagesWithImages =\n legacyImageViewerSwipeBehaviour && messagesWithImages && messagesWithImages.length;\n const threadExists = !!thread;\n\n useEffect(() => {\n if (\n legacyImageViewerSwipeBehaviour &&\n isListActive &&\n ((threadList && thread) || (!threadList && !thread))\n ) {\n setMessages(messagesWithImages as MessageType<StreamChatGenerics>[]);\n }\n }, [\n imageString,\n isListActive,\n legacyImageViewerSwipeBehaviour,\n numberOfMessagesWithImages,\n threadExists,\n threadList,\n ]);\n\n const stickyHeaderFormatDate =\n stickyHeaderDate?.getFullYear() === new Date().getFullYear() ? 'MMM D' : 'MMM D, YYYY';\n const tStickyHeaderDate =\n stickyHeaderDate && !hideStickyDateHeader ? tDateTimeParser(stickyHeaderDate) : null;\n\n const stickyHeaderDateString = useMemo(() => {\n if (tStickyHeaderDate === null || hideStickyDateHeader) return null;\n if (isDayOrMoment(tStickyHeaderDate)) return tStickyHeaderDate.format(stickyHeaderFormatDate);\n\n return new Date(tStickyHeaderDate).toDateString();\n }, [tStickyHeaderDate, stickyHeaderFormatDate, hideStickyDateHeader]);\n\n const dismissImagePicker = () => {\n if (!hasMoved && selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n }\n };\n const onScrollBeginDrag = () => !hasMoved && selectedPicker && setHasMoved(true);\n const onScrollEndDrag = () => hasMoved && selectedPicker && setHasMoved(false);\n\n const refCallback = (ref: FlatListType<MessageType<StreamChatGenerics>>) => {\n flatListRef.current = ref;\n\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n };\n\n const debugRef = useDebugContext();\n\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: thread ? 'ThreadList' : 'Messages',\n data: messageList,\n });\n }\n\n const shouldApplyAndroidWorkaround =\n inverted && Platform.OS === 'android' && Platform.Version >= 33;\n\n const renderListEmptyComponent = useCallback(\n () => (\n <View\n style={[styles.flex, shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert]}\n testID='empty-state'\n >\n <EmptyStateIndicator listType='message' />\n </View>\n ),\n [EmptyStateIndicator, shouldApplyAndroidWorkaround],\n );\n\n if (!FlatList) return null;\n\n if (loading) {\n return (\n <View style={styles.flex}>\n <LoadingIndicator listType='message' />\n </View>\n );\n }\n\n const StickyHeaderComponent = () => {\n if (!stickyHeaderDateString) return null;\n if (StickyHeader) return <StickyHeader dateString={stickyHeaderDateString} />;\n if (messageListLengthAfterUpdate) return <DateHeader dateString={stickyHeaderDateString} />;\n return null;\n };\n\n return (\n <View\n style={[styles.container, { backgroundColor: white_snow }, container]}\n testID='message-flat-list-wrapper'\n >\n <FlatList\n CellRendererComponent={\n shouldApplyAndroidWorkaround ? InvertedCellRendererComponent : undefined\n }\n contentContainerStyle={[styles.contentContainer, contentContainer]}\n data={messageList}\n /** Disables the MessageList UI. Which means, message actions, reactions won't work. */\n extraData={disabled || !hasNoMoreRecentMessagesToLoad}\n inverted={shouldApplyAndroidWorkaround ? false : inverted}\n keyboardShouldPersistTaps='handled'\n keyExtractor={keyExtractor}\n ListEmptyComponent={renderListEmptyComponent}\n ListFooterComponent={FooterComponent}\n ListHeaderComponent={HeaderComponent}\n maintainVisibleContentPosition={{\n autoscrollToTopThreshold: autoscrollToTop ? 10 : undefined,\n minIndexForVisible: 1,\n }}\n maxToRenderPerBatch={30}\n onScroll={handleScroll}\n onScrollBeginDrag={onScrollBeginDrag}\n onScrollEndDrag={onScrollEndDrag}\n onScrollToIndexFailed={onScrollToIndexFailedRef.current}\n onTouchEnd={dismissImagePicker}\n onViewableItemsChanged={onViewableItemsChanged.current}\n ref={refCallback}\n renderItem={renderItem}\n scrollEnabled={overlay === 'none'}\n showsVerticalScrollIndicator={!shouldApplyAndroidWorkaround}\n style={[\n styles.listContainer,\n listContainer,\n shouldApplyAndroidWorkaround ? styles.invertAndroid : undefined,\n ]}\n testID='message-flat-list'\n viewabilityConfig={flatListViewabilityConfig}\n {...additionalFlatListProps}\n />\n {!loading && (\n <>\n <View style={styles.stickyHeader}>\n <StickyHeaderComponent />\n </View>\n {!disableTypingIndicator && TypingIndicator && (\n <TypingIndicatorContainer>\n <TypingIndicator />\n </TypingIndicatorContainer>\n )}\n <ScrollToBottomButton\n onPress={goToNewMessages}\n showNotification={scrollToBottomButtonVisible}\n unreadCount={threadList ? 0 : channel?.countUnread()}\n />\n </>\n )}\n <NetworkDownIndicator />\n </View>\n );\n};\n\nexport type MessageListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<MessageListPropsWithContext<StreamChatGenerics>>;\n\nexport const MessageList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: MessageListProps<StreamChatGenerics>,\n) => {\n const { closePicker, selectedPicker, setSelectedPicker } = useAttachmentPickerContext();\n const {\n channel,\n disabled,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n hideStickyDateHeader,\n isChannelActive,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n markRead,\n NetworkDownIndicator,\n reloadChannel,\n scrollToFirstUnreadThreshold,\n setTargetedMessage,\n StickyHeader,\n targetedMessage,\n } = useChannelContext<StreamChatGenerics>();\n const { client } = useChatContext<StreamChatGenerics>();\n const { setMessages } = useImageGalleryContext<StreamChatGenerics>();\n const {\n DateHeader,\n disableTypingIndicator,\n FlatList,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n legacyImageViewerSwipeBehaviour,\n Message,\n MessageSystem,\n myMessageTheme,\n ScrollToBottomButton,\n TypingIndicator,\n TypingIndicatorContainer,\n } = useMessagesContext<StreamChatGenerics>();\n const { hasNoMoreRecentMessagesToLoad, loadMore, loadMoreRecent } =\n usePaginatedMessageListContext<StreamChatGenerics>();\n const { overlay } = useOverlayContext();\n const { loadMoreThread, thread } = useThreadContext<StreamChatGenerics>();\n const { t, tDateTimeParser } = useTranslationContext();\n\n return (\n <MessageListWithContext\n {...{\n channel,\n client,\n closePicker,\n DateHeader,\n disabled,\n disableTypingIndicator,\n EmptyStateIndicator,\n enableMessageGroupingByUser,\n error,\n FlatList,\n hasNoMoreRecentMessagesToLoad,\n hideStickyDateHeader,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isListActive: isChannelActive,\n legacyImageViewerSwipeBehaviour,\n loadChannelAroundMessage,\n loading,\n LoadingIndicator,\n loadMore,\n loadMoreRecent,\n loadMoreThread,\n markRead,\n Message,\n MessageSystem,\n myMessageTheme,\n NetworkDownIndicator,\n overlay,\n reloadChannel,\n ScrollToBottomButton,\n scrollToFirstUnreadThreshold,\n selectedPicker,\n setMessages,\n setSelectedPicker,\n setTargetedMessage,\n StickyHeader,\n t,\n targetedMessage,\n tDateTimeParser,\n thread,\n TypingIndicator,\n TypingIndicatorContainer,\n }}\n {...props}\n noGroupByUser={!enableMessageGroupingByUser || props.noGroupByUser}\n />\n );\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AAYA;AAKA;AACA;AACA;AACA;AAEA;AAIA;AAIA;AACA;AACA;AAIA;AAIA;AAIA;AAIA;AACA;AACA;AAI8D;EAAA;AAAA;AAAA;AAI9D,IAAMA,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,U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AAkB,EAAlBA,kBAAkB;IAClBC,YAAY,EAAZA,YAAY;IACZgL,CAAC,EAADA,CAAC;IACD/K,eAAe,EAAfA,eAAe;IACfC,eAAe,EAAfA,eAAe;IACfC,MAAM,EAANA,MAAM;IACNC,eAAe,EAAfA,eAAe;IACfC,wBAAwB,EAAxBA;EAAwB,GAEtBhE,KAAK;IACT,aAAa,EAAE,CAACiO,2BAA2B,IAAIjO,KAAK,CAAC+C,aAAc;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,GACnE;AAEN,CAAC;AAAC"}
|
package/lib/module/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "5.11.
|
|
4
|
+
"version": "5.11.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -956,10 +956,19 @@ const MessageListWithContext = <
|
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
959
|
+
const shouldApplyAndroidWorkaround =
|
|
960
|
+
inverted && Platform.OS === 'android' && Platform.Version >= 33;
|
|
961
|
+
|
|
962
|
+
const renderListEmptyComponent = useCallback(
|
|
963
|
+
() => (
|
|
964
|
+
<View
|
|
965
|
+
style={[styles.flex, shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert]}
|
|
966
|
+
testID='empty-state'
|
|
967
|
+
>
|
|
968
|
+
<EmptyStateIndicator listType='message' />
|
|
969
|
+
</View>
|
|
970
|
+
),
|
|
971
|
+
[EmptyStateIndicator, shouldApplyAndroidWorkaround],
|
|
963
972
|
);
|
|
964
973
|
|
|
965
974
|
if (!FlatList) return null;
|
|
@@ -979,9 +988,6 @@ const MessageListWithContext = <
|
|
|
979
988
|
return null;
|
|
980
989
|
};
|
|
981
990
|
|
|
982
|
-
const shouldApplyAndroidWorkaround =
|
|
983
|
-
inverted && Platform.OS === 'android' && Platform.Version >= 33;
|
|
984
|
-
|
|
985
991
|
return (
|
|
986
992
|
<View
|
|
987
993
|
style={[styles.container, { backgroundColor: white_snow }, container]}
|
package/src/version.json
CHANGED