stream-chat-react-native-core 5.25.0-beta.5 → 5.25.0-beta.7

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.
Files changed (111) hide show
  1. package/lib/commonjs/components/Channel/Channel.js +20 -15
  2. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  3. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
  4. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  5. package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
  6. package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
  7. package/lib/commonjs/components/Chat/Chat.js +10 -6
  8. package/lib/commonjs/components/Chat/Chat.js.map +1 -1
  9. package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js +4 -3
  10. package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js.map +1 -1
  11. package/lib/commonjs/components/Message/Message.js +5 -2
  12. package/lib/commonjs/components/Message/Message.js.map +1 -1
  13. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +7 -3
  14. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  15. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +7 -1
  16. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  17. package/lib/commonjs/components/MessageInput/MessageInput.js +5 -5
  18. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  19. package/lib/commonjs/components/MessageList/MessageList.js +32 -30
  20. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  21. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  22. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
  23. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  24. package/lib/commonjs/i18n/en.json +1 -1
  25. package/lib/commonjs/i18n/es.json +57 -57
  26. package/lib/commonjs/i18n/fr.json +57 -57
  27. package/lib/commonjs/i18n/he.json +57 -57
  28. package/lib/commonjs/i18n/hi.json +57 -57
  29. package/lib/commonjs/i18n/it.json +57 -57
  30. package/lib/commonjs/i18n/ja.json +57 -57
  31. package/lib/commonjs/i18n/ko.json +57 -57
  32. package/lib/commonjs/i18n/nl.json +57 -57
  33. package/lib/commonjs/i18n/ru.json +54 -54
  34. package/lib/commonjs/i18n/tr.json +54 -54
  35. package/lib/commonjs/version.json +1 -1
  36. package/lib/module/components/Channel/Channel.js +20 -15
  37. package/lib/module/components/Channel/Channel.js.map +1 -1
  38. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
  39. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  40. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
  41. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
  42. package/lib/module/components/Chat/Chat.js +10 -6
  43. package/lib/module/components/Chat/Chat.js.map +1 -1
  44. package/lib/module/components/Chat/hooks/useSyncDatabase.js +4 -3
  45. package/lib/module/components/Chat/hooks/useSyncDatabase.js.map +1 -1
  46. package/lib/module/components/Message/Message.js +5 -2
  47. package/lib/module/components/Message/Message.js.map +1 -1
  48. package/lib/module/components/Message/MessageSimple/MessageContent.js +7 -3
  49. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  50. package/lib/module/components/Message/MessageSimple/MessageSimple.js +7 -1
  51. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  52. package/lib/module/components/MessageInput/MessageInput.js +5 -5
  53. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  54. package/lib/module/components/MessageList/MessageList.js +32 -30
  55. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  56. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  57. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
  58. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  59. package/lib/module/i18n/en.json +1 -1
  60. package/lib/module/i18n/es.json +57 -57
  61. package/lib/module/i18n/fr.json +57 -57
  62. package/lib/module/i18n/he.json +57 -57
  63. package/lib/module/i18n/hi.json +57 -57
  64. package/lib/module/i18n/it.json +57 -57
  65. package/lib/module/i18n/ja.json +57 -57
  66. package/lib/module/i18n/ko.json +57 -57
  67. package/lib/module/i18n/nl.json +57 -57
  68. package/lib/module/i18n/ru.json +54 -54
  69. package/lib/module/i18n/tr.json +54 -54
  70. package/lib/module/version.json +1 -1
  71. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +62 -1
  72. package/lib/typescript/components/Chat/hooks/useSyncDatabase.d.ts +2 -1
  73. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
  74. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +2 -2
  75. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  76. package/lib/typescript/i18n/en.json +1 -1
  77. package/lib/typescript/i18n/es.json +57 -57
  78. package/lib/typescript/i18n/fr.json +57 -57
  79. package/lib/typescript/i18n/he.json +57 -57
  80. package/lib/typescript/i18n/hi.json +57 -57
  81. package/lib/typescript/i18n/it.json +57 -57
  82. package/lib/typescript/i18n/ja.json +57 -57
  83. package/lib/typescript/i18n/ko.json +57 -57
  84. package/lib/typescript/i18n/nl.json +57 -57
  85. package/lib/typescript/i18n/ru.json +54 -54
  86. package/lib/typescript/i18n/tr.json +54 -54
  87. package/package.json +2 -2
  88. package/src/components/Channel/Channel.tsx +8 -2
  89. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +11 -1
  90. package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +24 -6
  91. package/src/components/Chat/Chat.tsx +5 -0
  92. package/src/components/Chat/hooks/useSyncDatabase.ts +4 -2
  93. package/src/components/Message/Message.tsx +6 -1
  94. package/src/components/Message/MessageSimple/MessageContent.tsx +5 -0
  95. package/src/components/Message/MessageSimple/MessageSimple.tsx +8 -2
  96. package/src/components/MessageInput/MessageInput.tsx +3 -7
  97. package/src/components/MessageList/MessageList.tsx +3 -1
  98. package/src/contexts/messageInputContext/MessageInputContext.tsx +1 -1
  99. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +3 -0
  100. package/src/i18n/en.json +1 -1
  101. package/src/i18n/es.json +57 -57
  102. package/src/i18n/fr.json +57 -57
  103. package/src/i18n/he.json +57 -57
  104. package/src/i18n/hi.json +57 -57
  105. package/src/i18n/it.json +57 -57
  106. package/src/i18n/ja.json +57 -57
  107. package/src/i18n/ko.json +57 -57
  108. package/src/i18n/nl.json +57 -57
  109. package/src/i18n/ru.json +54 -54
  110. package/src/i18n/tr.json +54 -54
  111. package/src/version.json +1 -1
@@ -1,21 +1,21 @@
1
1
  {
2
- "1 Reply": "",
3
- "1 Thread Reply": "",
4
- "Allow access to your Gallery": "",
5
- "Allow camera access in device settings": "",
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?",
2
+ "1 Reply": "1 Cevap",
3
+ "1 Thread Reply": "1 Konu Yanıtı",
4
+ "Allow access to your Gallery": "Galerinize erişime izin verin",
5
+ "Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
6
+ "Also send to channel": "",
7
+ "Are you sure you want to permanently delete this message?": "",
8
8
  "Are you sure?": "",
9
- "Block User": "Kullanıcıyı engelle",
10
- "Cancel": "İptal",
11
- "Cannot Flag Message": "Raporlama Başarısız",
9
+ "Block User": "",
10
+ "Cancel": "",
11
+ "Cannot Flag Message": "",
12
12
  "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
13
- "Copy Message": "Mesajı Kopyala",
14
- "Delete": "Sil",
15
- "Delete Message": "Mesajı Sil",
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?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
18
- "Edit Message": "Mesajı Düzenle",
13
+ "Copy Message": "",
14
+ "Delete": "",
15
+ "Delete Message": "",
16
+ "Device camera is used to take photos or videos.": "Cihaz kamerası fotoğraf veya video çekmek için kullanılır.",
17
+ "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
+ "Edit Message": "",
19
19
  "Editing Message": "",
20
20
  "Emoji matching": "Emoji eşleştirme",
21
21
  "Empty message...": "",
@@ -24,56 +24,56 @@
24
24
  "Error loading messages for this channel...": "",
25
25
  "Error while loading, please reload/refresh": "",
26
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.",
27
+ "Flag": "",
28
+ "Flag Message": "",
29
+ "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?": "",
31
31
  "Instant Commands": "Anlık Komutlar",
32
32
  "Let's start chatting!": "",
33
- "Links are disabled": "Bağlantılar devre dışı",
34
- "Loading channels...": "",
35
- "Loading messages...": "",
36
- "Loading...": "",
37
- "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "Maksimum dosya boyutu yükleme sınırına ulaşıldı. Lütfen {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB'ın altında bir dosya yükleyin.",
38
- "Message Reactions": "Mesaj Tepkileri",
33
+ "Links are disabled": "",
34
+ "Loading channels...": "Kanallar yükleniyor...",
35
+ "Loading messages...": "Mesajlar yükleniyor...",
36
+ "Loading...": "Yükleniyor...",
37
+ "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
+ "Message Reactions": "",
39
39
  "Message deleted": "",
40
- "Message flagged": "Mesaj işaretlendi",
41
- "Mute User": "Kullanıcıyı sessize al",
42
- "Not supported": "",
40
+ "Message flagged": "",
41
+ "Mute User": "",
42
+ "Not supported": "Desteklenmiyor",
43
43
  "Nothing yet...": "",
44
- "Ok": "Tamam",
45
- "Only visible to you": "",
46
- "Open Settings": "",
44
+ "Ok": "",
45
+ "Only visible to you": "Sadece siz görebilirsiniz",
46
+ "Open Settings": "Ayarları aç",
47
47
  "Photo": "Fotoğraf",
48
- "Photos and Videos": "",
49
- "Pin to Conversation": "Konuşmaya sabitle",
48
+ "Photos and Videos": "Fotoğraflar ve Videolar",
49
+ "Pin to Conversation": "",
50
50
  "Pinned by": "",
51
- "Please enable access to your photos and videos so you can share them.": "",
52
- "Please select a channel first": "Lütfen önce bir kanal seçiniz",
51
+ "Please enable access to your photos and videos so you can share them.": "Paylaşım yapabilmek için lutfen fotoğraflarınıza ve videolarınıza erişimi etkinleştirin.",
52
+ "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
- "Reply": "Yanıtla",
54
+ "Reply": "",
55
55
  "Reply to Message": "",
56
- "Resend": "Yeniden gönder",
57
- "Search GIFs": "",
58
- "Select More Photos": "",
56
+ "Resend": "",
57
+ "Search GIFs": "GIF Ara",
58
+ "Select More Photos": "Daha Fazla Fotoğraf Seçin",
59
59
  "Send Anyway": "",
60
- "Send a message": "",
61
- "Sending links is not allowed in this conversation": "Bu konuşmada bağlantı göndermek desteklenmiyor",
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
- "Unknown User": "",
67
- "Unmute User": "Kullanıcının sesini aç",
68
- "Unpin from Conversation": "Sabitlemeyi kaldır",
69
- "Unread Messages": "Okunmamış Mesajlar",
60
+ "Send a message": "Mesaj gönder",
61
+ "Sending links is not allowed in this conversation": "",
62
+ "Slow mode ON": "Yavaş Mod Açık",
63
+ "The message has been reported to a moderator.": "",
64
+ "Thread Reply": "",
65
+ "Unblock User": "",
66
+ "Unknown User": "Bilinmeyen kullanıcı",
67
+ "Unmute User": "",
68
+ "Unpin from Conversation": "",
69
+ "Unread Messages": "",
70
70
  "Video": "Video",
71
71
  "You": "",
72
- "You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
- "{{ index }} of {{ photoLength }}": "",
75
- "{{ replyCount }} Replies": "",
76
- "{{ replyCount }} Thread Replies": "",
77
- "{{ user }} is typing": "",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} ve {{ nonSelfUserLength }} kişi daha yazıyor",
74
+ "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
75
+ "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
76
+ "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
77
+ "{{ user }} is typing": "{{ user }} yazıyor",
78
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.25.0-beta.5",
4
+ "version": "5.25.0-beta.7",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -81,7 +81,7 @@
81
81
  "path": "0.12.7",
82
82
  "react-native-markdown-package": "1.8.2",
83
83
  "react-native-url-polyfill": "^1.3.0",
84
- "stream-chat": "8.15.0"
84
+ "stream-chat": "8.17.0"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "react-native-quick-sqlite": ">=5.1.0",
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
1
+ import React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
3
3
 
4
4
  import debounce from 'lodash/debounce';
@@ -2093,6 +2093,11 @@ const ChannelWithContext = <
2093
2093
  }
2094
2094
  };
2095
2095
 
2096
+ const disabledValue = useMemo(
2097
+ () => !!channel?.data?.frozen && disableIfFrozenChannel,
2098
+ [channel.data?.frozen, disableIfFrozenChannel],
2099
+ );
2100
+
2096
2101
  const ownCapabilitiesContext = useCreateOwnCapabilitiesContext({
2097
2102
  channel,
2098
2103
  overrideCapabilities: overrideOwnCapabilities,
@@ -2100,7 +2105,7 @@ const ChannelWithContext = <
2100
2105
 
2101
2106
  const channelContext = useCreateChannelContext({
2102
2107
  channel,
2103
- disabled: !!channel?.data?.frozen && disableIfFrozenChannel,
2108
+ disabled: disabledValue,
2104
2109
  EmptyStateIndicator,
2105
2110
  enableMessageGroupingByUser,
2106
2111
  enforceUniqueReaction,
@@ -2147,6 +2152,7 @@ const ChannelWithContext = <
2147
2152
  CommandsButton,
2148
2153
  compressImageQuality,
2149
2154
  CooldownTimer,
2155
+ disabled: disabledValue,
2150
2156
  doDocUploadRequest,
2151
2157
  doImageUploadRequest,
2152
2158
  editing,
@@ -16,6 +16,7 @@ export const useCreateInputMessageInputContext = <
16
16
  CommandsButton,
17
17
  compressImageQuality,
18
18
  CooldownTimer,
19
+ disabled,
19
20
  doDocUploadRequest,
20
21
  doImageUploadRequest,
21
22
  editing,
@@ -72,6 +73,7 @@ export const useCreateInputMessageInputContext = <
72
73
  CommandsButton,
73
74
  compressImageQuality,
74
75
  CooldownTimer,
76
+ disabled,
75
77
  doDocUploadRequest,
76
78
  doImageUploadRequest,
77
79
  editing,
@@ -105,7 +107,15 @@ export const useCreateInputMessageInputContext = <
105
107
  ShowThreadMessageInChannelButton,
106
108
  UploadProgressIndicator,
107
109
  }),
108
- [compressImageQuality, channelId, editingDep, initialValue, maxMessageLength, quotedMessageId],
110
+ [
111
+ compressImageQuality,
112
+ channelId,
113
+ disabled,
114
+ editingDep,
115
+ initialValue,
116
+ maxMessageLength,
117
+ quotedMessageId,
118
+ ],
109
119
  );
110
120
 
111
121
  return inputMessageInputContext;
@@ -1,4 +1,4 @@
1
- import { useMemo } from 'react';
1
+ import { useEffect, useMemo, useState } from 'react';
2
2
 
3
3
  import type { Channel } from 'stream-chat';
4
4
 
@@ -18,15 +18,33 @@ export const useCreateOwnCapabilitiesContext = <
18
18
  channel: Channel<StreamChatGenerics>;
19
19
  overrideCapabilities?: Partial<OwnCapabilitiesContextValue>;
20
20
  }) => {
21
+ const [own_capabilities, setOwnCapabilites] = useState(
22
+ JSON.stringify(channel.data?.own_capabilities as Array<string>),
23
+ );
21
24
  const overrideCapabilitiesStr = overrideCapabilities
22
25
  ? JSON.stringify(Object.values(overrideCapabilities))
23
26
  : null;
24
- const ownCapabilitiesStr = channel?.data?.own_capabilities
25
- ? JSON.stringify(Object.values(channel?.data?.own_capabilities as Array<string>))
26
- : null;
27
+
28
+ // Effect to watch for changes in channel.data?.own_capabilities and update the own_capabilties state accordingly.
29
+ useEffect(() => {
30
+ setOwnCapabilites(JSON.stringify(channel.data?.own_capabilities as Array<string>));
31
+ }, [channel.data?.own_capabilities]);
32
+
33
+ // Effect to listen to the `capabilities.changed` event.
34
+ useEffect(() => {
35
+ const listener = channel.on('capabilities.changed', (event) => {
36
+ if (event.own_capabilities) {
37
+ setOwnCapabilites(JSON.stringify(event.own_capabilities as Array<string>));
38
+ }
39
+ });
40
+
41
+ return () => {
42
+ listener.unsubscribe();
43
+ };
44
+ }, []);
27
45
 
28
46
  const ownCapabilitiesContext: OwnCapabilitiesContextValue = useMemo(() => {
29
- const capabilities = (channel?.data?.own_capabilities || []) as Array<string>;
47
+ const capabilities = (own_capabilities || []) as Array<string>;
30
48
  const ownCapabilitiesContext = Object.keys(allOwnCapabilities).reduce(
31
49
  (result, capability) => ({
32
50
  ...result,
@@ -38,7 +56,7 @@ export const useCreateOwnCapabilitiesContext = <
38
56
  );
39
57
 
40
58
  return ownCapabilitiesContext;
41
- }, [channel.id, overrideCapabilitiesStr, ownCapabilitiesStr]);
59
+ }, [channel.id, overrideCapabilitiesStr, own_capabilities]);
42
60
 
43
61
  return ownCapabilitiesContext;
44
62
  };
@@ -215,8 +215,13 @@ const ChatWithContext = <
215
215
  useSyncDatabase({
216
216
  client,
217
217
  enableOfflineSupport,
218
+ initialisedDatabase,
218
219
  });
219
220
 
221
+ if (enableOfflineSupport && !initialisedDatabase) {
222
+ return null;
223
+ }
224
+
220
225
  return (
221
226
  <ChatProvider<StreamChatGenerics> value={chatContext}>
222
227
  <TranslationProvider
@@ -9,22 +9,24 @@ import type { DefaultStreamChatGenerics } from '../../../types/types';
9
9
  type Params<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
10
10
  client: StreamChat<StreamChatGenerics>;
11
11
  enableOfflineSupport: boolean;
12
+ initialisedDatabase: boolean;
12
13
  };
13
14
  export const useSyncDatabase = <
14
15
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
15
16
  >({
16
17
  client,
17
18
  enableOfflineSupport,
19
+ initialisedDatabase,
18
20
  }: Params<StreamChatGenerics>) => {
19
21
  useEffect(() => {
20
22
  let listener: ReturnType<StreamChat['on']> | undefined;
21
23
 
22
- if (enableOfflineSupport) {
24
+ if (enableOfflineSupport && initialisedDatabase) {
23
25
  listener = client?.on(handleEventToSyncDB);
24
26
  }
25
27
 
26
28
  return () => {
27
29
  listener?.unsubscribe();
28
30
  };
29
- }, [client]);
31
+ }, [client, initialisedDatabase]);
30
32
  };
@@ -590,7 +590,7 @@ const MessageWithContext = <
590
590
  images: attachments.images,
591
591
  message,
592
592
  messageActions: messageActions?.filter(Boolean) as MessageActionListItemProps[] | undefined,
593
- messageContext: { ...messageContext, disabled: true, preventPress: true },
593
+ messageContext: { ...messageContext, preventPress: true },
594
594
  messageReactionTitle: !error && messageReactions ? t('Message Reactions') : undefined,
595
595
  messagesContext: { ...messagesContext, messageContentOrder },
596
596
  onlyEmojis,
@@ -768,6 +768,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
768
768
  ) => {
769
769
  const {
770
770
  chatContext: { mutedUsers: prevMutedUsers },
771
+ disabled: prevDisabled,
771
772
  goToMessage: prevGoToMessage,
772
773
  groupStyles: prevGroupStyles,
773
774
  isAttachmentEqual,
@@ -781,6 +782,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
781
782
  } = prevProps;
782
783
  const {
783
784
  chatContext: { mutedUsers: nextMutedUsers },
785
+ disabled: nextDisabled,
784
786
  goToMessage: nextGoToMessage,
785
787
  groupStyles: nextGroupStyles,
786
788
  isTargetedMessage: nextIsTargetedMessage,
@@ -792,6 +794,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
792
794
  t: nextT,
793
795
  } = nextProps;
794
796
 
797
+ const disabledEqual = prevDisabled === nextDisabled;
798
+ if (!disabledEqual) return false;
799
+
795
800
  const membersEqual = Object.keys(prevMembers).length === Object.keys(nextMembers).length;
796
801
  if (!membersEqual) return false;
797
802
 
@@ -410,6 +410,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
410
410
  nextProps: MessageContentPropsWithContext<StreamChatGenerics>,
411
411
  ) => {
412
412
  const {
413
+ disabled: prevDisabled,
413
414
  goToMessage: prevGoToMessage,
414
415
  groupStyles: prevGroupStyles,
415
416
  hasReactions: prevHasReactions,
@@ -425,6 +426,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
425
426
  tDateTimeParser: prevTDateTimeParser,
426
427
  } = prevProps;
427
428
  const {
429
+ disabled: nextDisabled,
428
430
  goToMessage: nextGoToMessage,
429
431
  groupStyles: nextGroupStyles,
430
432
  hasReactions: nextHasReactions,
@@ -439,6 +441,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
439
441
  tDateTimeParser: nextTDateTimeParser,
440
442
  } = nextProps;
441
443
 
444
+ const disabledEqual = prevDisabled === nextDisabled;
445
+ if (!disabledEqual) return false;
446
+
442
447
  const hasReactionsEqual = prevHasReactions === nextHasReactions;
443
448
  if (!hasReactionsEqual) return false;
444
449
 
@@ -24,7 +24,7 @@ export type MessageSimplePropsWithContext<
24
24
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
25
25
  > = Pick<
26
26
  MessageContextValue<StreamChatGenerics>,
27
- 'alignment' | 'channel' | 'groupStyles' | 'hasReactions' | 'message'
27
+ 'alignment' | 'channel' | 'disabled' | 'groupStyles' | 'hasReactions' | 'message'
28
28
  > &
29
29
  Pick<
30
30
  MessagesContextValue<StreamChatGenerics>,
@@ -102,6 +102,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
102
102
  ) => {
103
103
  const {
104
104
  channel: prevChannel,
105
+ disabled: prevDisabled,
105
106
  groupStyles: prevGroupStyles,
106
107
  hasReactions: prevHasReactions,
107
108
  message: prevMessage,
@@ -109,12 +110,16 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
109
110
  } = prevProps;
110
111
  const {
111
112
  channel: nextChannel,
113
+ disabled: nextDisabled,
112
114
  groupStyles: nextGroupStyles,
113
115
  hasReactions: nextHasReactions,
114
116
  message: nextMessage,
115
117
  myMessageTheme: nextMyMessageTheme,
116
118
  } = nextProps;
117
119
 
120
+ const disabledEqual = prevDisabled === nextDisabled;
121
+ if (!disabledEqual) return false;
122
+
118
123
  const hasReactionsEqual = prevHasReactions === nextHasReactions;
119
124
  if (!hasReactionsEqual) return false;
120
125
 
@@ -197,7 +202,7 @@ export const MessageSimple = <
197
202
  >(
198
203
  props: MessageSimpleProps<StreamChatGenerics>,
199
204
  ) => {
200
- const { alignment, channel, groupStyles, hasReactions, message } =
205
+ const { alignment, channel, disabled, groupStyles, hasReactions, message } =
201
206
  useMessageContext<StreamChatGenerics>();
202
207
  const {
203
208
  enableMessageGroupingByUser,
@@ -213,6 +218,7 @@ export const MessageSimple = <
213
218
  {...{
214
219
  alignment,
215
220
  channel,
221
+ disabled,
216
222
  enableMessageGroupingByUser,
217
223
  groupStyles,
218
224
  hasReactions,
@@ -792,12 +792,7 @@ export const MessageInput = <
792
792
  const { isOnline } = useChatContext();
793
793
  const ownCapabilities = useOwnCapabilitiesContext();
794
794
 
795
- const {
796
- disabled = false,
797
- members,
798
- threadList,
799
- watchers,
800
- } = useChannelContext<StreamChatGenerics>();
795
+ const { disabled, members, threadList, watchers } = useChannelContext<StreamChatGenerics>();
801
796
 
802
797
  const {
803
798
  additionalTextInputProps,
@@ -854,7 +849,7 @@ export const MessageInput = <
854
849
 
855
850
  const { t } = useTranslationContext();
856
851
 
857
- if (!ownCapabilities.sendMessage && SendMessageDisallowedIndicator) {
852
+ if ((disabled || !ownCapabilities.sendMessage) && SendMessageDisallowedIndicator) {
858
853
  return <SendMessageDisallowedIndicator />;
859
854
  }
860
855
 
@@ -899,6 +894,7 @@ export const MessageInput = <
899
894
  SendButton,
900
895
  sending,
901
896
  sendMessageAsync,
897
+ SendMessageDisallowedIndicator,
902
898
  setGiphyActive,
903
899
  setShowMoreOptions,
904
900
  showMoreOptions,
@@ -439,7 +439,9 @@ const MessageListWithContext = <
439
439
  });
440
440
 
441
441
  useEffect(() => {
442
- setScrollToBottomButtonVisible(false);
442
+ if (disabled) {
443
+ setScrollToBottomButtonVisible(false);
444
+ }
443
445
  }, [disabled]);
444
446
 
445
447
  useEffect(() => {
@@ -210,7 +210,7 @@ export type LocalMessageInputContext<
210
210
 
211
211
  export type InputMessageInputContextValue<
212
212
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
213
- > = {
213
+ > = Pick<ChannelContextValue<StreamChatGenerics>, 'disabled'> & {
214
214
  /**
215
215
  * Custom UI component for attach button.
216
216
  *
@@ -20,6 +20,7 @@ export const useCreateMessageInputContext = <
20
20
  compressImageQuality,
21
21
  cooldownEndsAt,
22
22
  CooldownTimer,
23
+ disabled,
23
24
  doDocUploadRequest,
24
25
  doImageUploadRequest,
25
26
  editing,
@@ -124,6 +125,7 @@ export const useCreateMessageInputContext = <
124
125
  compressImageQuality,
125
126
  cooldownEndsAt,
126
127
  CooldownTimer,
128
+ disabled,
127
129
  doDocUploadRequest,
128
130
  doImageUploadRequest,
129
131
  editing,
@@ -200,6 +202,7 @@ export const useCreateMessageInputContext = <
200
202
  }),
201
203
  [
202
204
  cooldownEndsAt,
205
+ disabled,
203
206
  editingdep,
204
207
  fileUploadsValue,
205
208
  giphyActive,
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,21 +1,21 @@
1
1
  {
2
- "1 Reply": "",
3
- "1 Thread Reply": "",
4
- "Allow access to your Gallery": "",
5
- "Allow camera access in device settings": "",
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
- "Are you sure?": "",
9
- "Block User": "Bloquear usuario",
10
- "Cancel": "Cancelar",
11
- "Cannot Flag Message": "No se puede reportar el mensaje",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
13
- "Copy Message": "Copiar mensaje",
14
- "Delete": "Eliminar",
15
- "Delete Message": "Eliminar mensaje",
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?": "¿Deseas enviar una copia de este mensaje a un moderador para una investigación adicional?",
18
- "Edit Message": "Editar mensaje",
2
+ "1 Reply": "1 respuesta",
3
+ "1 Thread Reply": "1 respuesta de hilo",
4
+ "Allow access to your Gallery": "Permitir acceso a tu galería",
5
+ "Allow camera access in device settings": "Permitir el acceso a la cámara en la configuración del dispositivo",
6
+ "Also send to channel": "",
7
+ "Are you sure you want to permanently delete this message?": "",
8
+ "Are you sure?": "¿Estás seguro?",
9
+ "Block User": "",
10
+ "Cancel": "",
11
+ "Cannot Flag Message": "",
12
+ "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Considera cómo tu comentario podría hacer sentir a los demás y asegúrate de seguir nuestras Normas de la Comunidad",
13
+ "Copy Message": "",
14
+ "Delete": "",
15
+ "Delete Message": "",
16
+ "Device camera is used to take photos or videos.": "La cámara del dispositivo se utiliza para tomar fotografías o vídeos.",
17
+ "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
+ "Edit Message": "",
19
19
  "Editing Message": "",
20
20
  "Emoji matching": "Coincidencia de emoji",
21
21
  "Empty message...": "",
@@ -24,56 +24,56 @@
24
24
  "Error loading messages for this channel...": "",
25
25
  "Error while loading, please reload/refresh": "",
26
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.",
27
+ "Flag": "",
28
+ "Flag Message": "",
29
+ "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?": "",
31
31
  "Instant Commands": "Comandos instantáneos",
32
32
  "Let's start chatting!": "",
33
- "Links are disabled": "Los enlaces están desactivados",
34
- "Loading channels...": "",
35
- "Loading messages...": "",
36
- "Loading...": "",
37
- "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.",
38
- "Message Reactions": "Reacciones al mensaje",
33
+ "Links are disabled": "",
34
+ "Loading channels...": "Cargando canales...",
35
+ "Loading messages...": "Cargando mensajes...",
36
+ "Loading...": "Cargando...",
37
+ "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
+ "Message Reactions": "",
39
39
  "Message deleted": "",
40
- "Message flagged": "Mensaje reportado",
41
- "Mute User": "Silenciar usuario",
42
- "Not supported": "",
40
+ "Message flagged": "",
41
+ "Mute User": "",
42
+ "Not supported": "No admitido",
43
43
  "Nothing yet...": "",
44
- "Ok": "Aceptar",
45
- "Only visible to you": "",
46
- "Open Settings": "",
44
+ "Ok": "",
45
+ "Only visible to you": "Solo visible para ti",
46
+ "Open Settings": "Configuración abierta",
47
47
  "Photo": "Foto",
48
- "Photos and Videos": "",
49
- "Pin to Conversation": "Fijar a la conversación",
48
+ "Photos and Videos": "Fotos y videos",
49
+ "Pin to Conversation": "",
50
50
  "Pinned by": "",
51
- "Please enable access to your photos and videos so you can share them.": "",
52
- "Please select a channel first": "Por favor, selecciona primero un canal",
51
+ "Please enable access to your photos and videos so you can share them.": "Por favor, habilita el acceso a tus fotos y videos para poder compartirlos.",
52
+ "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
- "Reply": "Responder",
54
+ "Reply": "",
55
55
  "Reply to Message": "",
56
- "Resend": "Reenviar",
57
- "Search GIFs": "",
58
- "Select More Photos": "",
59
- "Send Anyway": "",
60
- "Send a message": "",
61
- "Sending links is not allowed in this conversation": "No está permitido enviar enlaces en esta conversación",
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
- "Unknown User": "",
67
- "Unmute User": "Activar sonido del usuario",
68
- "Unpin from Conversation": "Desmarcar de la conversación",
69
- "Unread Messages": "Mensajes no leídos",
56
+ "Resend": "",
57
+ "Search GIFs": "Buscar GIFs",
58
+ "Select More Photos": "Seleccionar más fotos",
59
+ "Send Anyway": "Enviar de todos modos",
60
+ "Send a message": "Enviar un mensaje",
61
+ "Sending links is not allowed in this conversation": "",
62
+ "Slow mode ON": "Modo lento ACTIVADO",
63
+ "The message has been reported to a moderator.": "",
64
+ "Thread Reply": "",
65
+ "Unblock User": "",
66
+ "Unknown User": "Usuario desconocido",
67
+ "Unmute User": "",
68
+ "Unpin from Conversation": "",
69
+ "Unread Messages": "",
70
70
  "Video": "Video",
71
71
  "You": "",
72
- "You can't send messages in this channel": "No puedes enviar mensajes en este canal",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
74
- "{{ index }} of {{ photoLength }}": "",
75
- "{{ replyCount }} Replies": "",
76
- "{{ replyCount }} Thread Replies": "",
77
- "{{ user }} is typing": "",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo",
74
+ "{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}",
75
+ "{{ replyCount }} Replies": "{{ replyCount }} Respuestas",
76
+ "{{ replyCount }} Thread Replies": "{{ replyCount }} respuestas de hilo",
77
+ "{{ user }} is typing": "{{ user }} está escribiendo",
78
78
  "🏙 Attachment...": ""
79
79
  }