stream-chat-react-native-core 5.23.1 → 5.23.2-beta.2
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/AutoCompleteInput/AutoCompleteSuggestionList.js +94 -93
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +33 -32
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +30 -37
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +41 -43
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +1 -2
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/fr.json +50 -50
- package/lib/commonjs/i18n/hi.json +50 -50
- package/lib/commonjs/i18n/it.json +50 -50
- package/lib/commonjs/i18n/nl.json +50 -50
- package/lib/commonjs/i18n/ru.json +50 -50
- package/lib/commonjs/i18n/tr.json +50 -50
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +94 -93
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +33 -32
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +30 -37
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +41 -43
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +1 -2
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/fr.json +50 -50
- package/lib/module/i18n/hi.json +50 -50
- package/lib/module/i18n/it.json +50 -50
- package/lib/module/i18n/nl.json +50 -50
- package/lib/module/i18n/ru.json +50 -50
- package/lib/module/i18n/tr.json +50 -50
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -3
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -5
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/fr.json +50 -50
- package/lib/typescript/i18n/hi.json +50 -50
- package/lib/typescript/i18n/it.json +50 -50
- package/lib/typescript/i18n/nl.json +50 -50
- package/lib/typescript/i18n/ru.json +50 -50
- package/lib/typescript/i18n/tr.json +50 -50
- package/package.json +1 -1
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +83 -74
- package/src/components/Channel/Channel.tsx +22 -17
- package/src/components/MessageInput/MessageInput.tsx +14 -16
- package/src/components/MessageList/MessageList.tsx +12 -15
- package/src/components/MessageList/hooks/useMessageList.ts +2 -2
- package/src/i18n/en.json +1 -1
- package/src/i18n/fr.json +50 -50
- package/src/i18n/hi.json +50 -50
- package/src/i18n/it.json +50 -50
- package/src/i18n/nl.json +50 -50
- package/src/i18n/ru.json +50 -50
- package/src/i18n/tr.json +50 -50
- package/src/version.json +1 -1
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
LayoutChangeEvent,
|
|
4
|
+
Pressable,
|
|
5
|
+
PressableProps,
|
|
6
|
+
PressableStateCallbackType,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
View,
|
|
9
|
+
ViewStyle,
|
|
10
|
+
} from 'react-native';
|
|
3
11
|
|
|
4
12
|
import type { AutoCompleteSuggestionHeaderProps } from './AutoCompleteSuggestionHeader';
|
|
5
13
|
import type { AutoCompleteSuggestionItemProps } from './AutoCompleteSuggestionItem';
|
|
6
14
|
|
|
7
15
|
import {
|
|
8
|
-
isSuggestionCommand,
|
|
9
|
-
isSuggestionEmoji,
|
|
10
16
|
isSuggestionUser,
|
|
11
17
|
Suggestion,
|
|
12
18
|
SuggestionsContextValue,
|
|
13
19
|
useSuggestionsContext,
|
|
14
20
|
} from '../../contexts/suggestionsContext/SuggestionsContext';
|
|
15
21
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
22
|
+
import { FlatList } from '../../native';
|
|
16
23
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
17
24
|
|
|
25
|
+
const AUTO_COMPLETE_SUGGESTION_LIST_HEADER_HEIGHT = 30;
|
|
26
|
+
|
|
18
27
|
type AutoCompleteSuggestionListComponentProps<
|
|
19
28
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
20
29
|
> = Pick<SuggestionsContextValue, 'queryText' | 'triggerType'> & {
|
|
@@ -31,9 +40,19 @@ export type AutoCompleteSuggestionListPropsWithContext<
|
|
|
31
40
|
> &
|
|
32
41
|
AutoCompleteSuggestionListComponentProps<StreamChatGenerics>;
|
|
33
42
|
|
|
34
|
-
const SuggestionsItem: React.FC<
|
|
35
|
-
const { children, ...
|
|
36
|
-
|
|
43
|
+
const SuggestionsItem: React.FC<PressableProps> = (props) => {
|
|
44
|
+
const { children, style: propsStyle, ...pressableProps } = props;
|
|
45
|
+
|
|
46
|
+
const style = ({ pressed }: PressableStateCallbackType) => [
|
|
47
|
+
propsStyle as ViewStyle,
|
|
48
|
+
{ opacity: pressed ? 0.2 : 1 },
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Pressable {...pressableProps} style={style}>
|
|
53
|
+
{children}
|
|
54
|
+
</Pressable>
|
|
55
|
+
);
|
|
37
56
|
};
|
|
38
57
|
|
|
39
58
|
SuggestionsItem.displayName = 'SuggestionsHeader{messageInput{suggestions}}';
|
|
@@ -43,6 +62,7 @@ export const AutoCompleteSuggestionListWithContext = <
|
|
|
43
62
|
>(
|
|
44
63
|
props: AutoCompleteSuggestionListPropsWithContext<StreamChatGenerics>,
|
|
45
64
|
) => {
|
|
65
|
+
const [itemHeight, setItemHeight] = useState<number>(0);
|
|
46
66
|
const {
|
|
47
67
|
active,
|
|
48
68
|
AutoCompleteSuggestionHeader,
|
|
@@ -55,6 +75,7 @@ export const AutoCompleteSuggestionListWithContext = <
|
|
|
55
75
|
|
|
56
76
|
const {
|
|
57
77
|
theme: {
|
|
78
|
+
colors: { white },
|
|
58
79
|
messageInput: {
|
|
59
80
|
container: { maxHeight },
|
|
60
81
|
suggestions: { item: itemStyle },
|
|
@@ -63,62 +84,37 @@ export const AutoCompleteSuggestionListWithContext = <
|
|
|
63
84
|
},
|
|
64
85
|
} = useTheme();
|
|
65
86
|
|
|
66
|
-
const
|
|
87
|
+
const flatlistHeight = useMemo(() => {
|
|
88
|
+
let totalItemHeight;
|
|
89
|
+
if (triggerType === 'emoji') {
|
|
90
|
+
totalItemHeight = data.length < 7 ? data.length * itemHeight : itemHeight * 6;
|
|
91
|
+
} else {
|
|
92
|
+
totalItemHeight = data.length < 4 ? data.length * itemHeight : itemHeight * 3;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return triggerType === 'emoji' || triggerType === 'command'
|
|
96
|
+
? totalItemHeight + AUTO_COMPLETE_SUGGESTION_LIST_HEADER_HEIGHT
|
|
97
|
+
: totalItemHeight;
|
|
98
|
+
}, [itemHeight, data.length]);
|
|
99
|
+
|
|
100
|
+
const renderItem = ({ item }: { item: Suggestion<StreamChatGenerics> }) => {
|
|
67
101
|
switch (triggerType) {
|
|
68
|
-
case 'mention':
|
|
69
|
-
if (isSuggestionUser(item)) {
|
|
70
|
-
return (
|
|
71
|
-
<SuggestionsItem
|
|
72
|
-
onPress={() => {
|
|
73
|
-
onSelect(item);
|
|
74
|
-
}}
|
|
75
|
-
style={[
|
|
76
|
-
{
|
|
77
|
-
paddingBottom: index === data.length - 1 ? 8 : 0,
|
|
78
|
-
paddingTop: index === 0 ? 8 : 0,
|
|
79
|
-
},
|
|
80
|
-
itemStyle,
|
|
81
|
-
]}
|
|
82
|
-
>
|
|
83
|
-
{AutoCompleteSuggestionItem && (
|
|
84
|
-
<AutoCompleteSuggestionItem itemProps={item} triggerType={triggerType} />
|
|
85
|
-
)}
|
|
86
|
-
</SuggestionsItem>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
102
|
case 'command':
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<SuggestionsItem
|
|
94
|
-
onPress={() => {
|
|
95
|
-
onSelect(item);
|
|
96
|
-
}}
|
|
97
|
-
style={[itemStyle]}
|
|
98
|
-
>
|
|
99
|
-
{AutoCompleteSuggestionItem && (
|
|
100
|
-
<AutoCompleteSuggestionItem itemProps={item} triggerType={triggerType} />
|
|
101
|
-
)}
|
|
102
|
-
</SuggestionsItem>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
103
|
+
case 'mention':
|
|
106
104
|
case 'emoji':
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
return null;
|
|
105
|
+
return (
|
|
106
|
+
<SuggestionsItem
|
|
107
|
+
onLayout={(event: LayoutChangeEvent) => setItemHeight(event.nativeEvent.layout.height)}
|
|
108
|
+
onPress={() => {
|
|
109
|
+
onSelect(item);
|
|
110
|
+
}}
|
|
111
|
+
style={itemStyle}
|
|
112
|
+
>
|
|
113
|
+
{AutoCompleteSuggestionItem && (
|
|
114
|
+
<AutoCompleteSuggestionItem itemProps={item} triggerType={triggerType} />
|
|
115
|
+
)}
|
|
116
|
+
</SuggestionsItem>
|
|
117
|
+
);
|
|
122
118
|
default:
|
|
123
119
|
return null;
|
|
124
120
|
}
|
|
@@ -127,20 +123,22 @@ export const AutoCompleteSuggestionListWithContext = <
|
|
|
127
123
|
if (!active || data.length === 0) return null;
|
|
128
124
|
|
|
129
125
|
return (
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
<View style={[styles.container, { backgroundColor: white, height: flatlistHeight }]}>
|
|
127
|
+
<FlatList
|
|
128
|
+
data={data}
|
|
129
|
+
keyboardShouldPersistTaps='always'
|
|
130
|
+
keyExtractor={(item, index) =>
|
|
131
|
+
`${item.name || (isSuggestionUser(item) ? item.id : '')}${index}`
|
|
132
|
+
}
|
|
133
|
+
ListHeaderComponent={
|
|
134
|
+
AutoCompleteSuggestionHeader ? (
|
|
135
|
+
<AutoCompleteSuggestionHeader queryText={queryText} triggerType={triggerType} />
|
|
136
|
+
) : null
|
|
137
|
+
}
|
|
138
|
+
renderItem={renderItem}
|
|
139
|
+
style={[flatlist, { maxHeight }]}
|
|
140
|
+
/>
|
|
141
|
+
</View>
|
|
144
142
|
);
|
|
145
143
|
};
|
|
146
144
|
|
|
@@ -206,5 +204,16 @@ export const AutoCompleteSuggestionList = <
|
|
|
206
204
|
);
|
|
207
205
|
};
|
|
208
206
|
|
|
207
|
+
const styles = StyleSheet.create({
|
|
208
|
+
container: {
|
|
209
|
+
borderRadius: 8,
|
|
210
|
+
elevation: 3,
|
|
211
|
+
marginHorizontal: 8,
|
|
212
|
+
marginVertical: 8,
|
|
213
|
+
shadowOffset: { height: 1, width: 0 },
|
|
214
|
+
shadowOpacity: 0.15,
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
209
218
|
AutoCompleteSuggestionList.displayName =
|
|
210
219
|
'AutoCompleteSuggestionList{messageInput{suggestions{List}}}';
|
|
@@ -777,15 +777,18 @@ const ChannelWithContext = <
|
|
|
777
777
|
useEffect(() => {
|
|
778
778
|
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
|
|
779
779
|
if (shouldSyncChannel) {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
780
|
+
const isTypingEvent = event.type === 'typing.start' || event.type === 'typing.stop';
|
|
781
|
+
if (!isTypingEvent) {
|
|
782
|
+
if (thread?.id) {
|
|
783
|
+
const updatedThreadMessages =
|
|
784
|
+
(thread.id && channel && channel.state.threads[thread.id]) || threadMessages;
|
|
785
|
+
setThreadMessages(updatedThreadMessages);
|
|
786
|
+
}
|
|
785
787
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
788
|
+
if (channel && thread?.id && event.message?.id === thread.id) {
|
|
789
|
+
const updatedThread = channel.state.formatMessage(event.message);
|
|
790
|
+
setThread(updatedThread);
|
|
791
|
+
}
|
|
789
792
|
}
|
|
790
793
|
|
|
791
794
|
// only update channel state if the events are not the previously subscribed useEffect's subscription events
|
|
@@ -1097,11 +1100,11 @@ const ChannelWithContext = <
|
|
|
1097
1100
|
channelQueryCallRef.current(async () => {
|
|
1098
1101
|
if (!channel?.initialized || !channel.state.isUpToDate) {
|
|
1099
1102
|
await channel?.watch();
|
|
1103
|
+
channel?.state.setIsUpToDate(true);
|
|
1104
|
+
setHasNoMoreRecentMessagesToLoad(true);
|
|
1100
1105
|
} else {
|
|
1101
|
-
await
|
|
1106
|
+
await channel.state.loadMessageIntoState('latest');
|
|
1102
1107
|
}
|
|
1103
|
-
channel?.state.setIsUpToDate(true);
|
|
1104
|
-
setHasNoMoreRecentMessagesToLoad(true);
|
|
1105
1108
|
});
|
|
1106
1109
|
|
|
1107
1110
|
const reloadThread = async () => {
|
|
@@ -1999,11 +2002,14 @@ const ChannelWithContext = <
|
|
|
1999
2002
|
/**
|
|
2000
2003
|
* THREAD METHODS
|
|
2001
2004
|
*/
|
|
2002
|
-
const openThread: ThreadContextValue<StreamChatGenerics>['openThread'] = (
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2005
|
+
const openThread: ThreadContextValue<StreamChatGenerics>['openThread'] = useCallback(
|
|
2006
|
+
(message) => {
|
|
2007
|
+
const newThreadMessages = message?.id ? channel?.state?.threads[message.id] || [] : [];
|
|
2008
|
+
setThread(message);
|
|
2009
|
+
setThreadMessages(newThreadMessages);
|
|
2010
|
+
},
|
|
2011
|
+
[setThread, setThreadMessages],
|
|
2012
|
+
);
|
|
2007
2013
|
|
|
2008
2014
|
const closeThread: ThreadContextValue<StreamChatGenerics>['closeThread'] = useCallback(() => {
|
|
2009
2015
|
setThread(null);
|
|
@@ -2365,7 +2371,6 @@ export const Channel = <
|
|
|
2365
2371
|
|
|
2366
2372
|
return (
|
|
2367
2373
|
<ChannelWithContext<StreamChatGenerics>
|
|
2368
|
-
key={props.channel?.cid}
|
|
2369
2374
|
{...{
|
|
2370
2375
|
client,
|
|
2371
2376
|
enableOfflineSupport,
|
|
@@ -73,20 +73,18 @@ const styles = StyleSheet.create({
|
|
|
73
73
|
replyContainer: { paddingBottom: 12, paddingHorizontal: 8 },
|
|
74
74
|
sendButtonContainer: { paddingBottom: 10, paddingLeft: 10 },
|
|
75
75
|
suggestionsListContainer: {
|
|
76
|
-
borderRadius: 10,
|
|
77
|
-
elevation: 3,
|
|
78
|
-
left: 8,
|
|
79
76
|
position: 'absolute',
|
|
80
|
-
|
|
81
|
-
shadowOffset: { height: 1, width: 0 },
|
|
82
|
-
shadowOpacity: 0.15,
|
|
77
|
+
width: '100%',
|
|
83
78
|
},
|
|
84
79
|
});
|
|
85
80
|
|
|
86
81
|
type MessageInputPropsWithContext<
|
|
87
82
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
88
83
|
> = Pick<ChatContextValue<StreamChatGenerics>, 'isOnline'> &
|
|
89
|
-
Pick<
|
|
84
|
+
Pick<
|
|
85
|
+
ChannelContextValue<StreamChatGenerics>,
|
|
86
|
+
'disabled' | 'members' | 'threadList' | 'watchers'
|
|
87
|
+
> &
|
|
90
88
|
Pick<
|
|
91
89
|
MessageInputContextValue<StreamChatGenerics>,
|
|
92
90
|
| 'additionalTextInputProps'
|
|
@@ -137,9 +135,7 @@ type MessageInputPropsWithContext<
|
|
|
137
135
|
| 'triggerType'
|
|
138
136
|
> &
|
|
139
137
|
Pick<ThreadContextValue<StreamChatGenerics>, 'thread'> &
|
|
140
|
-
Pick<TranslationContextValue, 't'
|
|
141
|
-
threadList?: boolean;
|
|
142
|
-
};
|
|
138
|
+
Pick<TranslationContextValue, 't'>;
|
|
143
139
|
|
|
144
140
|
const MessageInputWithContext = <
|
|
145
141
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -624,11 +620,7 @@ const MessageInputWithContext = <
|
|
|
624
620
|
|
|
625
621
|
{triggerType && suggestions ? (
|
|
626
622
|
<View
|
|
627
|
-
style={[
|
|
628
|
-
suggestionListContainer,
|
|
629
|
-
styles.suggestionsListContainer,
|
|
630
|
-
{ backgroundColor: white, bottom: height },
|
|
631
|
-
]}
|
|
623
|
+
style={[styles.suggestionsListContainer, suggestionListContainer, { bottom: height }]}
|
|
632
624
|
>
|
|
633
625
|
<AutoCompleteSuggestionList
|
|
634
626
|
active={!!suggestions}
|
|
@@ -800,7 +792,12 @@ export const MessageInput = <
|
|
|
800
792
|
const { isOnline } = useChatContext();
|
|
801
793
|
const ownCapabilities = useOwnCapabilitiesContext();
|
|
802
794
|
|
|
803
|
-
const {
|
|
795
|
+
const {
|
|
796
|
+
disabled = false,
|
|
797
|
+
members,
|
|
798
|
+
threadList,
|
|
799
|
+
watchers,
|
|
800
|
+
} = useChannelContext<StreamChatGenerics>();
|
|
804
801
|
|
|
805
802
|
const {
|
|
806
803
|
additionalTextInputProps,
|
|
@@ -909,6 +906,7 @@ export const MessageInput = <
|
|
|
909
906
|
suggestions,
|
|
910
907
|
t,
|
|
911
908
|
thread,
|
|
909
|
+
threadList,
|
|
912
910
|
triggerType,
|
|
913
911
|
uploadNewFile,
|
|
914
912
|
uploadNewImage,
|
|
@@ -132,6 +132,7 @@ type MessageListPropsWithContext<
|
|
|
132
132
|
| 'setTargetedMessage'
|
|
133
133
|
| 'StickyHeader'
|
|
134
134
|
| 'targetedMessage'
|
|
135
|
+
| 'threadList'
|
|
135
136
|
> &
|
|
136
137
|
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
137
138
|
Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setMessages'> &
|
|
@@ -215,10 +216,6 @@ type MessageListPropsWithContext<
|
|
|
215
216
|
* ```
|
|
216
217
|
*/
|
|
217
218
|
setFlatListRef?: (ref: FlatListType<MessageType<StreamChatGenerics>> | null) => void;
|
|
218
|
-
/**
|
|
219
|
-
* Boolean whether or not the Messages in the MessageList are part of a Thread
|
|
220
|
-
**/
|
|
221
|
-
threadList?: boolean;
|
|
222
219
|
};
|
|
223
220
|
|
|
224
221
|
/**
|
|
@@ -545,7 +542,11 @@ const MessageListWithContext = <
|
|
|
545
542
|
|
|
546
543
|
useEffect(() => {
|
|
547
544
|
if (!rawMessageList.length) return;
|
|
548
|
-
|
|
545
|
+
if (threadList) {
|
|
546
|
+
setAutoscrollToRecent(true);
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
const notLatestSet = channel.state.messages !== channel.state.latestMessages;
|
|
549
550
|
if (notLatestSet) {
|
|
550
551
|
latestNonCurrentMessageBeforeUpdateRef.current =
|
|
551
552
|
channel.state.latestMessages[channel.state.latestMessages.length - 1];
|
|
@@ -729,10 +730,8 @@ const MessageListWithContext = <
|
|
|
729
730
|
// If onEndReached is in progress, better to wait for it to finish for smooth UX
|
|
730
731
|
if (onEndReachedInPromise.current) {
|
|
731
732
|
await onEndReachedInPromise.current;
|
|
732
|
-
onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);
|
|
733
|
-
} else {
|
|
734
|
-
onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);
|
|
735
733
|
}
|
|
734
|
+
onStartReachedInPromise.current = loadMoreRecent(limit).then(callback).catch(onError);
|
|
736
735
|
};
|
|
737
736
|
|
|
738
737
|
/**
|
|
@@ -765,14 +764,10 @@ const MessageListWithContext = <
|
|
|
765
764
|
// If onStartReached is in progress, better to wait for it to finish for smooth UX
|
|
766
765
|
if (onStartReachedInPromise.current) {
|
|
767
766
|
await onStartReachedInPromise.current;
|
|
768
|
-
onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())
|
|
769
|
-
.then(callback)
|
|
770
|
-
.catch(onError);
|
|
771
|
-
} else {
|
|
772
|
-
onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())
|
|
773
|
-
.then(callback)
|
|
774
|
-
.catch(onError);
|
|
775
767
|
}
|
|
768
|
+
onEndReachedInPromise.current = (threadList ? loadMoreThread() : loadMore())
|
|
769
|
+
.then(callback)
|
|
770
|
+
.catch(onError);
|
|
776
771
|
};
|
|
777
772
|
|
|
778
773
|
const onUserScrollEvent: NonNullable<ScrollViewProps['onScroll']> = (event) => {
|
|
@@ -1226,6 +1221,7 @@ export const MessageList = <
|
|
|
1226
1221
|
setTargetedMessage,
|
|
1227
1222
|
StickyHeader,
|
|
1228
1223
|
targetedMessage,
|
|
1224
|
+
threadList,
|
|
1229
1225
|
} = useChannelContext<StreamChatGenerics>();
|
|
1230
1226
|
const { client } = useChatContext<StreamChatGenerics>();
|
|
1231
1227
|
const { setMessages } = useImageGalleryContext<StreamChatGenerics>();
|
|
@@ -1294,6 +1290,7 @@ export const MessageList = <
|
|
|
1294
1290
|
targetedMessage,
|
|
1295
1291
|
tDateTimeParser,
|
|
1296
1292
|
thread,
|
|
1293
|
+
threadList,
|
|
1297
1294
|
TypingIndicator,
|
|
1298
1295
|
TypingIndicatorContainer,
|
|
1299
1296
|
}}
|
|
@@ -106,11 +106,11 @@ export const useMessageList = <
|
|
|
106
106
|
const processedMessageList = [
|
|
107
107
|
...messagesWithStylesReadByAndDateSeparator,
|
|
108
108
|
].reverse() as MessageType<StreamChatGenerics>[];
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
return {
|
|
111
111
|
/** Messages enriched with dates/readby/groups and also reversed in order */
|
|
112
112
|
processedMessageList,
|
|
113
113
|
/** Raw messages from the channel state */
|
|
114
|
-
rawMessageList,
|
|
114
|
+
rawMessageList: messageList,
|
|
115
115
|
};
|
|
116
116
|
};
|
package/src/i18n/en.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"File type not supported": "File type not supported",
|
|
25
25
|
"Flag": "Flag",
|
|
26
26
|
"Flag Message": "Flag Message",
|
|
27
|
-
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged
|
|
27
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged",
|
|
28
28
|
"How about sending your first message to a friend?": "How about sending your first message to a friend?",
|
|
29
29
|
"Instant Commands": "Instant Commands",
|
|
30
30
|
"Let's start chatting!": "Let's start chatting!",
|
package/src/i18n/fr.json
CHANGED
|
@@ -4,73 +4,73 @@
|
|
|
4
4
|
"Allow access to your Gallery": "Autoriser l'accès à votre galerie",
|
|
5
5
|
"Allow camera access in device settings": "Autoriser l'accès à la caméra dans les paramètres de l'appareil",
|
|
6
6
|
"Also send to channel": "Envoyer également à la chaîne",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
8
|
-
"Block User": "
|
|
9
|
-
"Cancel": "
|
|
10
|
-
"Cannot Flag Message": "
|
|
11
|
-
"Copy Message": "
|
|
12
|
-
"Delete": "
|
|
13
|
-
"Delete Message": "
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
+
"Block User": "",
|
|
9
|
+
"Cancel": "",
|
|
10
|
+
"Cannot Flag Message": "",
|
|
11
|
+
"Copy Message": "",
|
|
12
|
+
"Delete": "",
|
|
13
|
+
"Delete Message": "",
|
|
14
14
|
"Device camera is used to take photos or videos.": "L'appareil photo de l'appareil est utilisé pour prendre des photos ou des vidéos.",
|
|
15
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
16
|
-
"Edit Message": "
|
|
17
|
-
"Editing Message": "
|
|
15
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
16
|
+
"Edit Message": "",
|
|
17
|
+
"Editing Message": "",
|
|
18
18
|
"Emoji matching": "Correspondance Emoji",
|
|
19
|
-
"Empty message...": "
|
|
20
|
-
"Error loading": "
|
|
21
|
-
"Error loading channel list...": "
|
|
22
|
-
"Error loading messages for this channel...": "
|
|
23
|
-
"Error while loading, please reload/refresh": "
|
|
24
|
-
"File type not supported": "
|
|
25
|
-
"Flag": "
|
|
26
|
-
"Flag Message": "
|
|
27
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
28
|
-
"How about sending your first message to a friend?": "
|
|
19
|
+
"Empty message...": "",
|
|
20
|
+
"Error loading": "",
|
|
21
|
+
"Error loading channel list...": "",
|
|
22
|
+
"Error loading messages for this channel...": "",
|
|
23
|
+
"Error while loading, please reload/refresh": "",
|
|
24
|
+
"File type not supported": "",
|
|
25
|
+
"Flag": "",
|
|
26
|
+
"Flag Message": "",
|
|
27
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
28
|
+
"How about sending your first message to a friend?": "",
|
|
29
29
|
"Instant Commands": "Commandes Instantanées",
|
|
30
|
-
"Let's start chatting!": "
|
|
30
|
+
"Let's start chatting!": "",
|
|
31
31
|
"Links are disabled": "Links are disabled",
|
|
32
32
|
"Loading channels...": "Chargement des canaux...",
|
|
33
33
|
"Loading messages...": "Chargement des messages...",
|
|
34
34
|
"Loading...": "Chargement...",
|
|
35
35
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Taille maximale de téléchargement de fichier atteinte. Veuillez télécharger un fichier inférieur à {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} Mo.",
|
|
36
|
-
"Message Reactions": "
|
|
37
|
-
"Message deleted": "
|
|
38
|
-
"Message flagged": "
|
|
39
|
-
"Mute User": "
|
|
36
|
+
"Message Reactions": "",
|
|
37
|
+
"Message deleted": "",
|
|
38
|
+
"Message flagged": "",
|
|
39
|
+
"Mute User": "",
|
|
40
40
|
"Not supported": "Non pris en charge",
|
|
41
|
-
"Nothing yet...": "
|
|
42
|
-
"Ok": "
|
|
43
|
-
"Only visible to you": "
|
|
41
|
+
"Nothing yet...": "",
|
|
42
|
+
"Ok": "",
|
|
43
|
+
"Only visible to you": "",
|
|
44
44
|
"Open Settings": "Ouvrir les paramètres",
|
|
45
|
-
"Photo": "
|
|
45
|
+
"Photo": "",
|
|
46
46
|
"Photos and Videos": "Photos et vidéos",
|
|
47
|
-
"Pin to Conversation": "
|
|
48
|
-
"Pinned by": "
|
|
47
|
+
"Pin to Conversation": "",
|
|
48
|
+
"Pinned by": "",
|
|
49
49
|
"Please enable access to your photos and videos so you can share them.": "Veuillez autoriser l'accès à vos photos et vidéos afin de pouvoir les partager.",
|
|
50
|
-
"Please select a channel first": "
|
|
51
|
-
"Reconnecting...": "
|
|
52
|
-
"Reply": "
|
|
53
|
-
"Reply to Message": "
|
|
54
|
-
"Resend": "
|
|
55
|
-
"Search GIFs": "
|
|
50
|
+
"Please select a channel first": "",
|
|
51
|
+
"Reconnecting...": "",
|
|
52
|
+
"Reply": "",
|
|
53
|
+
"Reply to Message": "",
|
|
54
|
+
"Resend": "",
|
|
55
|
+
"Search GIFs": "",
|
|
56
56
|
"Select More Photos": "Sélectionner plus de photos",
|
|
57
|
-
"Send a message": "
|
|
57
|
+
"Send a message": "",
|
|
58
58
|
"Sending links is not allowed in this conversation": "Sending links is not allowed in this conversation",
|
|
59
|
-
"Slow mode ON": "
|
|
60
|
-
"The message has been reported to a moderator.": "
|
|
61
|
-
"Thread Reply": "
|
|
62
|
-
"Unblock User": "
|
|
59
|
+
"Slow mode ON": "",
|
|
60
|
+
"The message has been reported to a moderator.": "",
|
|
61
|
+
"Thread Reply": "",
|
|
62
|
+
"Unblock User": "",
|
|
63
63
|
"Unknown User": "Utilisateur inconnu",
|
|
64
|
-
"Unmute User": "
|
|
65
|
-
"Unpin from Conversation": "
|
|
64
|
+
"Unmute User": "",
|
|
65
|
+
"Unpin from Conversation": "",
|
|
66
66
|
"Unread Messages": "Messages non lus",
|
|
67
|
-
"Video": "
|
|
68
|
-
"You": "
|
|
69
|
-
"You can't send messages in this channel": "
|
|
70
|
-
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "
|
|
67
|
+
"Video": "",
|
|
68
|
+
"You": "",
|
|
69
|
+
"You can't send messages in this channel": "",
|
|
70
|
+
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
71
71
|
"{{ index }} of {{ photoLength }}": "{{ index }} sur {{ photoLength }}",
|
|
72
72
|
"{{ replyCount }} Replies": "{{ replyCount }} Réponses",
|
|
73
73
|
"{{ replyCount }} Thread Replies": "{{replyCount}} Réponses à la discussion",
|
|
74
|
-
"{{ user }} is typing": "
|
|
75
|
-
"🏙 Attachment...": "
|
|
74
|
+
"{{ user }} is typing": "",
|
|
75
|
+
"🏙 Attachment...": ""
|
|
76
76
|
}
|