stream-chat-react-native-core 5.27.0-beta.1 → 5.27.0-beta.10
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/Attachment/Gallery.js +6 -7
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js +30 -5
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +25 -16
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js +18 -12
- package/lib/commonjs/components/Chat/hooks/useAppSettings.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +8 -2
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +3 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +45 -40
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +73 -56
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/es.json +46 -46
- package/lib/commonjs/i18n/fr.json +46 -46
- package/lib/commonjs/i18n/he.json +46 -46
- package/lib/commonjs/i18n/hi.json +47 -47
- package/lib/commonjs/i18n/it.json +47 -47
- package/lib/commonjs/i18n/ja.json +47 -47
- package/lib/commonjs/i18n/ko.json +47 -47
- package/lib/commonjs/i18n/nl.json +47 -47
- package/lib/commonjs/i18n/pt-BR.json +47 -47
- package/lib/commonjs/i18n/ru.json +47 -47
- package/lib/commonjs/i18n/tr.json +47 -47
- package/lib/commonjs/utils/addReactionToLocalState.js +3 -2
- package/lib/commonjs/utils/addReactionToLocalState.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Gallery.js +6 -7
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js +30 -5
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +25 -16
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useAppSettings.js +18 -12
- package/lib/module/components/Chat/hooks/useAppSettings.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +8 -2
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +3 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +45 -40
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +73 -56
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/es.json +46 -46
- package/lib/module/i18n/fr.json +46 -46
- package/lib/module/i18n/he.json +46 -46
- package/lib/module/i18n/hi.json +47 -47
- package/lib/module/i18n/it.json +47 -47
- package/lib/module/i18n/ja.json +47 -47
- package/lib/module/i18n/ko.json +47 -47
- package/lib/module/i18n/nl.json +47 -47
- package/lib/module/i18n/pt-BR.json +47 -47
- package/lib/module/i18n/ru.json +47 -47
- package/lib/module/i18n/tr.json +47 -47
- package/lib/module/utils/addReactionToLocalState.js +3 -2
- package/lib/module/utils/addReactionToLocalState.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +3 -1
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/es.json +46 -46
- package/lib/typescript/i18n/fr.json +46 -46
- package/lib/typescript/i18n/he.json +46 -46
- package/lib/typescript/i18n/hi.json +47 -47
- package/lib/typescript/i18n/it.json +47 -47
- package/lib/typescript/i18n/ja.json +47 -47
- package/lib/typescript/i18n/ko.json +47 -47
- package/lib/typescript/i18n/nl.json +47 -47
- package/lib/typescript/i18n/pt-BR.json +47 -47
- package/lib/typescript/i18n/ru.json +47 -47
- package/lib/typescript/i18n/tr.json +47 -47
- package/package.json +1 -1
- package/src/components/Attachment/Gallery.tsx +9 -9
- package/src/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.tsx +24 -2
- package/src/components/Chat/Chat.tsx +17 -6
- package/src/components/Chat/hooks/useAppSettings.ts +3 -1
- package/src/components/ImageGallery/ImageGallery.tsx +1 -1
- package/src/components/Indicators/LoadingIndicator.tsx +3 -3
- package/src/components/MessageInput/SendButton.tsx +1 -1
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +2 -1
- package/src/components/MessageList/MessageList.tsx +19 -13
- package/src/contexts/messageInputContext/MessageInputContext.tsx +9 -3
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +46 -46
- package/src/i18n/fr.json +46 -46
- package/src/i18n/he.json +46 -46
- package/src/i18n/hi.json +47 -47
- package/src/i18n/it.json +47 -47
- package/src/i18n/ja.json +47 -47
- package/src/i18n/ko.json +47 -47
- package/src/i18n/nl.json +47 -47
- package/src/i18n/pt-BR.json +47 -47
- package/src/i18n/ru.json +47 -47
- package/src/i18n/tr.json +47 -47
- package/src/utils/addReactionToLocalState.ts +7 -2
- package/src/version.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "
|
|
2
|
+
"1 Reply": "",
|
|
3
3
|
"1 Thread Reply": "",
|
|
4
4
|
"Allow access to your Gallery": "",
|
|
5
5
|
"Allow camera access in device settings": "",
|
|
6
|
-
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "",
|
|
6
|
+
"Also send to channel": "Kanala da gönder",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
|
|
8
8
|
"Are you sure?": "",
|
|
9
|
-
"Block User": "",
|
|
10
|
-
"Cancel": "",
|
|
11
|
-
"Cannot Flag Message": "",
|
|
9
|
+
"Block User": "Kullanıcıyı engelle",
|
|
10
|
+
"Cancel": "İptal",
|
|
11
|
+
"Cannot Flag Message": "Raporlama Başarısız",
|
|
12
12
|
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
-
"Copy Message": "",
|
|
14
|
-
"Delete": "",
|
|
15
|
-
"Delete Message": "",
|
|
13
|
+
"Copy Message": "Mesajı Kopyala",
|
|
14
|
+
"Delete": "Sil",
|
|
15
|
+
"Delete Message": "Mesajı Sil",
|
|
16
16
|
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
-
"Edit Message": "",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
|
|
18
|
+
"Edit Message": "Mesajı Düzenle",
|
|
19
19
|
"Editing Message": "",
|
|
20
20
|
"Emoji matching": "",
|
|
21
|
-
"Empty message...": "
|
|
21
|
+
"Empty message...": "",
|
|
22
22
|
"Error loading": "Yükleme hatası",
|
|
23
|
-
"Error loading channel list...": "
|
|
23
|
+
"Error loading channel list...": "",
|
|
24
24
|
"Error loading messages for this channel...": "Bu kanal için mesajlar yüklenirken hata oluştu...",
|
|
25
|
-
"Error while loading, please reload/refresh": "
|
|
26
|
-
"File type not supported": "
|
|
27
|
-
"Flag": "",
|
|
28
|
-
"Flag Message": "",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
|
-
"How about sending your first message to a friend?": "
|
|
25
|
+
"Error while loading, please reload/refresh": "",
|
|
26
|
+
"File type not supported": "",
|
|
27
|
+
"Flag": "Raporla",
|
|
28
|
+
"Flag Message": "Mesajı Raporla",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Mesajın daha önce raporlanmış olması veya bir ağ bağlantısı sorunu nedeniyle raporlama işlemi başarısız oldu.",
|
|
30
|
+
"How about sending your first message to a friend?": "",
|
|
31
31
|
"Instant Commands": "",
|
|
32
|
-
"Let's start chatting!": "
|
|
32
|
+
"Let's start chatting!": "",
|
|
33
33
|
"Links are disabled": "",
|
|
34
|
-
"Loading channels...": "
|
|
35
|
-
"Loading messages...": "
|
|
36
|
-
"Loading...": "
|
|
34
|
+
"Loading channels...": "",
|
|
35
|
+
"Loading messages...": "",
|
|
36
|
+
"Loading...": "",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
38
|
"Message Reactions": "Mesaj Tepkileri",
|
|
39
39
|
"Message deleted": "Mesaj silindi",
|
|
40
|
-
"Message flagged": "",
|
|
41
|
-
"Mute User": "",
|
|
40
|
+
"Message flagged": "Mesaj işaretlendi",
|
|
41
|
+
"Mute User": "Kullanıcıyı sessize al",
|
|
42
42
|
"Not supported": "",
|
|
43
|
-
"Nothing yet...": "
|
|
44
|
-
"Ok": "",
|
|
45
|
-
"Only visible to you": "
|
|
43
|
+
"Nothing yet...": "",
|
|
44
|
+
"Ok": "Tamam",
|
|
45
|
+
"Only visible to you": "",
|
|
46
46
|
"Open Settings": "",
|
|
47
47
|
"Photo": "Fotoğraf",
|
|
48
48
|
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "",
|
|
50
|
-
"Pinned by": "
|
|
49
|
+
"Pin to Conversation": "Konuşmaya sabitle",
|
|
50
|
+
"Pinned by": "",
|
|
51
51
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "",
|
|
52
|
+
"Please select a channel first": "Lütfen önce bir kanal seçiniz",
|
|
53
53
|
"Reconnecting...": "Yeniden Bağlanılıyor...",
|
|
54
|
-
"Reply": "",
|
|
55
|
-
"Reply to Message": "
|
|
56
|
-
"Resend": "",
|
|
57
|
-
"Search GIFs": "
|
|
54
|
+
"Reply": "Yanıtla",
|
|
55
|
+
"Reply to Message": "",
|
|
56
|
+
"Resend": "Yeniden gönder",
|
|
57
|
+
"Search GIFs": "",
|
|
58
58
|
"Select More Photos": "",
|
|
59
59
|
"Send Anyway": "",
|
|
60
|
-
"Send a message": "
|
|
60
|
+
"Send a message": "",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
62
|
-
"Slow mode ON": "
|
|
63
|
-
"The message has been reported to a moderator.": "",
|
|
64
|
-
"Thread Reply": "",
|
|
65
|
-
"Unblock User": "",
|
|
62
|
+
"Slow mode ON": "",
|
|
63
|
+
"The message has been reported to a moderator.": "Mesaj moderatöre bildirildi.",
|
|
64
|
+
"Thread Reply": "Konu Yanıtı",
|
|
65
|
+
"Unblock User": "Kullanıcının engelini kaldır",
|
|
66
66
|
"Unknown User": "",
|
|
67
|
-
"Unmute User": "",
|
|
68
|
-
"Unpin from Conversation": "",
|
|
69
|
-
"Unread Messages": "
|
|
67
|
+
"Unmute User": "Kullanıcının sesini aç",
|
|
68
|
+
"Unpin from Conversation": "Sabitlemeyi kaldır",
|
|
69
|
+
"Unread Messages": "",
|
|
70
70
|
"Video": "Video",
|
|
71
|
-
"You": "
|
|
72
|
-
"You can't send messages in this channel": "
|
|
71
|
+
"You": "",
|
|
72
|
+
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
|
|
74
74
|
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "
|
|
75
|
+
"{{ replyCount }} Replies": "",
|
|
76
76
|
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "{{ user }} yazıyor",
|
|
78
|
-
"🏙 Attachment...": "
|
|
78
|
+
"🏙 Attachment...": ""
|
|
79
79
|
}
|
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.27.0-beta.
|
|
4
|
+
"version": "5.27.0-beta.10",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -309,15 +309,15 @@ const GalleryThumbnail = <
|
|
|
309
309
|
};
|
|
310
310
|
|
|
311
311
|
const defaultOnPress = () => {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
312
|
+
// If the url is defined then only try to open the file.
|
|
313
|
+
if (thumbnail.url) {
|
|
314
|
+
if (thumbnail.type === 'video' && !isVideoPackageAvailable()) {
|
|
315
|
+
// This condition is kinda unreachable, since we render videos as file attachment if the video
|
|
316
|
+
// library is not installed. But doesn't hurt to have extra safeguard, in case of some customizations.
|
|
317
|
+
openUrlSafely(thumbnail.url);
|
|
318
|
+
} else {
|
|
319
|
+
openImageViewer();
|
|
320
|
+
}
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Pressable, StyleSheet, Text } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
4
5
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
5
6
|
import { iOS14RefreshGallerySelection } from '../../../native';
|
|
6
7
|
|
|
7
8
|
export const AttachmentPickerIOSSelectMorePhotos = () => {
|
|
8
9
|
const { t } = useTranslationContext();
|
|
9
|
-
|
|
10
|
+
const {
|
|
11
|
+
theme: {
|
|
12
|
+
colors: { accent_blue, white },
|
|
13
|
+
},
|
|
14
|
+
} = useTheme();
|
|
15
|
+
return (
|
|
16
|
+
<Pressable
|
|
17
|
+
onPress={iOS14RefreshGallerySelection}
|
|
18
|
+
style={[styles.container, { backgroundColor: white }]}
|
|
19
|
+
>
|
|
20
|
+
<Text style={[styles.text, { color: accent_blue }]}>{t('Select More Photos')}</Text>
|
|
21
|
+
</Pressable>
|
|
22
|
+
);
|
|
10
23
|
};
|
|
24
|
+
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
container: {},
|
|
27
|
+
text: {
|
|
28
|
+
fontSize: 16,
|
|
29
|
+
paddingVertical: 10,
|
|
30
|
+
textAlign: 'center',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -160,7 +160,12 @@ const ChatWithContext = <
|
|
|
160
160
|
closeConnectionOnBackground,
|
|
161
161
|
);
|
|
162
162
|
|
|
163
|
-
const [
|
|
163
|
+
const [initialisedDatabaseConfig, setInitialisedDatabaseConfig] = useState<{
|
|
164
|
+
initialised: boolean;
|
|
165
|
+
userID?: string;
|
|
166
|
+
}>({
|
|
167
|
+
initialised: false,
|
|
168
|
+
});
|
|
164
169
|
|
|
165
170
|
/**
|
|
166
171
|
* Setup muted user listener
|
|
@@ -171,6 +176,8 @@ const ChatWithContext = <
|
|
|
171
176
|
const debugRef = useDebugContext();
|
|
172
177
|
const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;
|
|
173
178
|
|
|
179
|
+
const userID = client.userID;
|
|
180
|
+
|
|
174
181
|
// Set the `resizableCDNHosts` as per the prop.
|
|
175
182
|
StreamChatRN.setConfig({ resizableCDNHosts });
|
|
176
183
|
|
|
@@ -195,13 +202,16 @@ const ChatWithContext = <
|
|
|
195
202
|
const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);
|
|
196
203
|
|
|
197
204
|
useEffect(() => {
|
|
198
|
-
if (
|
|
199
|
-
|
|
205
|
+
if (userID && enableOfflineSupport) {
|
|
206
|
+
setInitialisedDatabaseConfig({ initialised: false, userID });
|
|
200
207
|
QuickSqliteClient.initializeDatabase();
|
|
201
208
|
DBSyncManager.init(client as unknown as StreamChat);
|
|
202
|
-
|
|
209
|
+
setInitialisedDatabaseConfig({ initialised: true, userID });
|
|
203
210
|
}
|
|
204
|
-
}, [
|
|
211
|
+
}, [userID, enableOfflineSupport]);
|
|
212
|
+
|
|
213
|
+
const initialisedDatabase =
|
|
214
|
+
initialisedDatabaseConfig.initialised && userID === initialisedDatabaseConfig.userID;
|
|
205
215
|
|
|
206
216
|
const appSettings = useAppSettings(client, isOnline, enableOfflineSupport, initialisedDatabase);
|
|
207
217
|
|
|
@@ -224,7 +234,8 @@ const ChatWithContext = <
|
|
|
224
234
|
initialisedDatabase,
|
|
225
235
|
});
|
|
226
236
|
|
|
227
|
-
if (enableOfflineSupport && !initialisedDatabase) {
|
|
237
|
+
if (userID && enableOfflineSupport && !initialisedDatabase) {
|
|
238
|
+
// if user id has been set and offline support is enabled, we need to wait for database to be initialised
|
|
228
239
|
return null;
|
|
229
240
|
}
|
|
230
241
|
|
|
@@ -19,7 +19,9 @@ export const useAppSettings = <
|
|
|
19
19
|
async function enforeAppSettings() {
|
|
20
20
|
if (!client.userID) return;
|
|
21
21
|
|
|
22
|
-
if (
|
|
22
|
+
if (enableOfflineSupport && !initialisedDatabase) return;
|
|
23
|
+
|
|
24
|
+
if (!isOnline && enableOfflineSupport) {
|
|
23
25
|
const appSettings = dbApi.getAppSettings({ currentUserId: client.userID });
|
|
24
26
|
setAppSettings(appSettings);
|
|
25
27
|
return;
|
|
@@ -272,7 +272,7 @@ export const ImageGallery = <
|
|
|
272
272
|
!attachment.title_link &&
|
|
273
273
|
!attachment.og_scrape_url &&
|
|
274
274
|
getUrlOfImageAttachment(attachment)) ||
|
|
275
|
-
(
|
|
275
|
+
(isVideoPackageAvailable() && attachment.type === 'video'),
|
|
276
276
|
)
|
|
277
277
|
.reverse() || [];
|
|
278
278
|
|
|
@@ -21,14 +21,14 @@ const styles = StyleSheet.create({
|
|
|
21
21
|
const LoadingIndicatorWrapper: React.FC<{ text: string }> = ({ text }) => {
|
|
22
22
|
const {
|
|
23
23
|
theme: {
|
|
24
|
-
colors: { black },
|
|
24
|
+
colors: { black, white_snow },
|
|
25
25
|
loadingIndicator: { container, loadingText },
|
|
26
26
|
},
|
|
27
27
|
} = useTheme();
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<View style={[styles.container, container]}>
|
|
31
|
-
<Spinner />
|
|
30
|
+
<View style={[styles.container, { backgroundColor: white_snow }, container]}>
|
|
31
|
+
<Spinner height={20} width={20} />
|
|
32
32
|
<Text style={[styles.loadingText, { color: black }, loadingText]} testID='loading'>
|
|
33
33
|
{text}
|
|
34
34
|
</Text>
|
|
@@ -21,7 +21,7 @@ export const SendMessageDisallowedIndicator = () => {
|
|
|
21
21
|
const { t } = useTranslationContext();
|
|
22
22
|
const {
|
|
23
23
|
theme: {
|
|
24
|
-
colors: { border, grey_dark },
|
|
24
|
+
colors: { border, grey_dark, white },
|
|
25
25
|
messageInput: {
|
|
26
26
|
sendMessageDisallowedIndicator: { container, text },
|
|
27
27
|
},
|
|
@@ -33,6 +33,7 @@ export const SendMessageDisallowedIndicator = () => {
|
|
|
33
33
|
style={[
|
|
34
34
|
styles.container,
|
|
35
35
|
{
|
|
36
|
+
backgroundColor: white,
|
|
36
37
|
borderTopColor: border,
|
|
37
38
|
height: 50,
|
|
38
39
|
},
|
|
@@ -525,7 +525,7 @@ const MessageListWithContext = <
|
|
|
525
525
|
if (threadList || hasNoMoreRecentMessagesToLoad) {
|
|
526
526
|
scrollToBottomIfNeeded();
|
|
527
527
|
} else {
|
|
528
|
-
setScrollToBottomButtonVisible(
|
|
528
|
+
setScrollToBottomButtonVisible(false);
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
if (
|
|
@@ -805,13 +805,15 @@ const MessageListWithContext = <
|
|
|
805
805
|
|
|
806
806
|
const handleScroll: ScrollViewProps['onScroll'] = (event) => {
|
|
807
807
|
const offset = event.nativeEvent.contentOffset.y;
|
|
808
|
+
const messageListHasMessages = processedMessageList.length > 0;
|
|
808
809
|
// Show scrollToBottom button once scroll position goes beyond 150.
|
|
809
810
|
const isScrollAtBottom = offset <= 150;
|
|
810
811
|
|
|
811
812
|
const notLatestSet = channel.state.messages !== channel.state.latestMessages;
|
|
812
813
|
|
|
813
814
|
const showScrollToBottomButton =
|
|
814
|
-
|
|
815
|
+
messageListHasMessages &&
|
|
816
|
+
((!threadList && notLatestSet) || !isScrollAtBottom || !hasNoMoreRecentMessagesToLoad);
|
|
815
817
|
|
|
816
818
|
/**
|
|
817
819
|
* 1. If I scroll up -> show scrollToBottom button.
|
|
@@ -1072,7 +1074,11 @@ const MessageListWithContext = <
|
|
|
1072
1074
|
const renderListEmptyComponent = useCallback(
|
|
1073
1075
|
() => (
|
|
1074
1076
|
<View
|
|
1075
|
-
style={[
|
|
1077
|
+
style={[
|
|
1078
|
+
styles.flex,
|
|
1079
|
+
{ backgroundColor: white_snow },
|
|
1080
|
+
shouldApplyAndroidWorkaround ? styles.invertAndroid : styles.invert,
|
|
1081
|
+
]}
|
|
1076
1082
|
testID='empty-state'
|
|
1077
1083
|
>
|
|
1078
1084
|
<EmptyStateIndicator listType='message' />
|
|
@@ -1099,16 +1105,6 @@ const MessageListWithContext = <
|
|
|
1099
1105
|
[shouldApplyAndroidWorkaround, HeaderComponent],
|
|
1100
1106
|
);
|
|
1101
1107
|
|
|
1102
|
-
if (!FlatList) return null;
|
|
1103
|
-
|
|
1104
|
-
if (loading) {
|
|
1105
|
-
return (
|
|
1106
|
-
<View style={styles.flex}>
|
|
1107
|
-
<LoadingIndicator listType='message' />
|
|
1108
|
-
</View>
|
|
1109
|
-
);
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
1108
|
const StickyHeaderComponent = () => {
|
|
1113
1109
|
if (!stickyHeaderDateString) return null;
|
|
1114
1110
|
if (StickyHeader) return <StickyHeader dateString={stickyHeaderDateString} />;
|
|
@@ -1127,6 +1123,16 @@ const MessageListWithContext = <
|
|
|
1127
1123
|
additionalFlatListPropsExcludingStyle = rest;
|
|
1128
1124
|
}
|
|
1129
1125
|
|
|
1126
|
+
if (!FlatList) return null;
|
|
1127
|
+
|
|
1128
|
+
if (loading) {
|
|
1129
|
+
return (
|
|
1130
|
+
<View style={[styles.container, { backgroundColor: white_snow }, container]}>
|
|
1131
|
+
<LoadingIndicator listType='message' />
|
|
1132
|
+
</View>
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1130
1136
|
return (
|
|
1131
1137
|
<View
|
|
1132
1138
|
style={[styles.container, { backgroundColor: white_snow }, container]}
|
|
@@ -165,7 +165,9 @@ export type LocalMessageInputContext<
|
|
|
165
165
|
resetInput: (pendingAttachments?: Attachment<StreamChatGenerics>[]) => void;
|
|
166
166
|
selectedPicker: string | undefined;
|
|
167
167
|
sending: React.MutableRefObject<boolean>;
|
|
168
|
-
sendMessage: (
|
|
168
|
+
sendMessage: (params?: {
|
|
169
|
+
customMessageData?: Partial<Message<StreamChatGenerics>>;
|
|
170
|
+
}) => Promise<void>;
|
|
169
171
|
sendMessageAsync: (id: string) => void;
|
|
170
172
|
sendThreadMessageInChannel: boolean;
|
|
171
173
|
setAsyncIds: React.Dispatch<React.SetStateAction<string[]>>;
|
|
@@ -706,8 +708,12 @@ export const MessageInputProvider = <
|
|
|
706
708
|
};
|
|
707
709
|
|
|
708
710
|
// TODO: Figure out why this is async, as it doesn't await any promise.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
+
const sendMessage = async ({
|
|
712
|
+
customMessageData,
|
|
713
|
+
}: {
|
|
714
|
+
customMessageData?: Partial<Message<StreamChatGenerics>>;
|
|
715
|
+
// eslint-disable-next-line require-await
|
|
716
|
+
} = {}) => {
|
|
711
717
|
if (sending.current) {
|
|
712
718
|
return;
|
|
713
719
|
}
|
package/src/i18n/en.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"File type not supported": "File type not supported",
|
|
27
27
|
"Flag": "Flag",
|
|
28
28
|
"Flag Message": "Flag Message",
|
|
29
|
-
"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",
|
|
29
|
+
"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.",
|
|
30
30
|
"How about sending your first message to a friend?": "How about sending your first message to a friend?",
|
|
31
31
|
"Instant Commands": "Instant Commands",
|
|
32
32
|
"Let's start chatting!": "Let's start chatting!",
|
package/src/i18n/es.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "
|
|
2
|
+
"1 Reply": "",
|
|
3
3
|
"1 Thread Reply": "",
|
|
4
4
|
"Allow access to your Gallery": "",
|
|
5
5
|
"Allow camera access in device settings": "",
|
|
6
|
-
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "",
|
|
6
|
+
"Also send to channel": "También enviar al canal",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "¿Estás seguro de que deseas eliminar permanentemente este mensaje?",
|
|
8
8
|
"Are you sure?": "",
|
|
9
|
-
"Block User": "",
|
|
10
|
-
"Cancel": "",
|
|
11
|
-
"Cannot Flag Message": "",
|
|
9
|
+
"Block User": "Bloquear usuario",
|
|
10
|
+
"Cancel": "Cancelar",
|
|
11
|
+
"Cannot Flag Message": "No se puede reportar el mensaje",
|
|
12
12
|
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
-
"Copy Message": "",
|
|
14
|
-
"Delete": "",
|
|
15
|
-
"Delete Message": "",
|
|
13
|
+
"Copy Message": "Copiar mensaje",
|
|
14
|
+
"Delete": "Eliminar",
|
|
15
|
+
"Delete Message": "Eliminar mensaje",
|
|
16
16
|
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
-
"Edit Message": "",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "¿Deseas enviar una copia de este mensaje a un moderador para una investigación adicional?",
|
|
18
|
+
"Edit Message": "Editar mensaje",
|
|
19
19
|
"Editing Message": "",
|
|
20
20
|
"Emoji matching": "",
|
|
21
|
-
"Empty message...": "
|
|
21
|
+
"Empty message...": "",
|
|
22
22
|
"Error loading": "Error al cargar",
|
|
23
|
-
"Error loading channel list...": "
|
|
23
|
+
"Error loading channel list...": "",
|
|
24
24
|
"Error loading messages for this channel...": "Error al cargar los mensajes de este canal...",
|
|
25
|
-
"Error while loading, please reload/refresh": "
|
|
26
|
-
"File type not supported": "
|
|
27
|
-
"Flag": "",
|
|
28
|
-
"Flag Message": "",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
|
-
"How about sending your first message to a friend?": "
|
|
25
|
+
"Error while loading, please reload/refresh": "",
|
|
26
|
+
"File type not supported": "",
|
|
27
|
+
"Flag": "Reportar",
|
|
28
|
+
"Flag Message": "Reportar mensaje",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "El reporte falló debido a un problema de red o el mensaje ya fue reportado.",
|
|
30
|
+
"How about sending your first message to a friend?": "",
|
|
31
31
|
"Instant Commands": "",
|
|
32
|
-
"Let's start chatting!": "
|
|
32
|
+
"Let's start chatting!": "",
|
|
33
33
|
"Links are disabled": "",
|
|
34
|
-
"Loading channels...": "
|
|
35
|
-
"Loading messages...": "
|
|
36
|
-
"Loading...": "
|
|
34
|
+
"Loading channels...": "",
|
|
35
|
+
"Loading messages...": "",
|
|
36
|
+
"Loading...": "",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
38
|
"Message Reactions": "Reacciones al mensaje",
|
|
39
39
|
"Message deleted": "Mensaje eliminado",
|
|
40
|
-
"Message flagged": "",
|
|
41
|
-
"Mute User": "",
|
|
40
|
+
"Message flagged": "Mensaje reportado",
|
|
41
|
+
"Mute User": "Silenciar usuario",
|
|
42
42
|
"Not supported": "",
|
|
43
|
-
"Nothing yet...": "
|
|
44
|
-
"Ok": "",
|
|
45
|
-
"Only visible to you": "
|
|
43
|
+
"Nothing yet...": "",
|
|
44
|
+
"Ok": "Aceptar",
|
|
45
|
+
"Only visible to you": "",
|
|
46
46
|
"Open Settings": "",
|
|
47
47
|
"Photo": "Foto",
|
|
48
48
|
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "",
|
|
50
|
-
"Pinned by": "
|
|
49
|
+
"Pin to Conversation": "Fijar a la conversación",
|
|
50
|
+
"Pinned by": "",
|
|
51
51
|
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
|
-
"Please select a channel first": "",
|
|
52
|
+
"Please select a channel first": "Por favor, selecciona primero un canal",
|
|
53
53
|
"Reconnecting...": "Reconectando...",
|
|
54
|
-
"Reply": "",
|
|
55
|
-
"Reply to Message": "
|
|
56
|
-
"Resend": "",
|
|
57
|
-
"Search GIFs": "
|
|
54
|
+
"Reply": "Responder",
|
|
55
|
+
"Reply to Message": "",
|
|
56
|
+
"Resend": "Reenviar",
|
|
57
|
+
"Search GIFs": "",
|
|
58
58
|
"Select More Photos": "",
|
|
59
59
|
"Send Anyway": "",
|
|
60
|
-
"Send a message": "
|
|
60
|
+
"Send a message": "",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
62
|
-
"Slow mode ON": "
|
|
63
|
-
"The message has been reported to a moderator.": "",
|
|
64
|
-
"Thread Reply": "",
|
|
65
|
-
"Unblock User": "",
|
|
62
|
+
"Slow mode ON": "",
|
|
63
|
+
"The message has been reported to a moderator.": "El mensaje ha sido reportado a un moderador.",
|
|
64
|
+
"Thread Reply": "Respuesta de hilo",
|
|
65
|
+
"Unblock User": "Desbloquear usuario",
|
|
66
66
|
"Unknown User": "",
|
|
67
|
-
"Unmute User": "",
|
|
68
|
-
"Unpin from Conversation": "",
|
|
67
|
+
"Unmute User": "Activar sonido del usuario",
|
|
68
|
+
"Unpin from Conversation": "Desmarcar de la conversación",
|
|
69
69
|
"Unread Messages": "",
|
|
70
70
|
"Video": "Video",
|
|
71
|
-
"You": "
|
|
72
|
-
"You can't send messages in this channel": "
|
|
71
|
+
"You": "",
|
|
72
|
+
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo",
|
|
74
74
|
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "
|
|
75
|
+
"{{ replyCount }} Replies": "",
|
|
76
76
|
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "{{ user }} está escribiendo",
|
|
78
|
-
"🏙 Attachment...": "
|
|
78
|
+
"🏙 Attachment...": ""
|
|
79
79
|
}
|