stream-chat-react-native-core 5.25.0-beta.6 → 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 (96) 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/Message/Message.js +5 -2
  8. package/lib/commonjs/components/Message/Message.js.map +1 -1
  9. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +7 -3
  10. package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
  11. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +7 -1
  12. package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  13. package/lib/commonjs/components/MessageInput/MessageInput.js +5 -5
  14. package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
  15. package/lib/commonjs/components/MessageList/MessageList.js +32 -30
  16. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  17. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  18. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
  19. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  20. package/lib/commonjs/i18n/es.json +23 -23
  21. package/lib/commonjs/i18n/fr.json +23 -23
  22. package/lib/commonjs/i18n/he.json +23 -23
  23. package/lib/commonjs/i18n/hi.json +23 -23
  24. package/lib/commonjs/i18n/it.json +23 -23
  25. package/lib/commonjs/i18n/ja.json +23 -23
  26. package/lib/commonjs/i18n/ko.json +23 -23
  27. package/lib/commonjs/i18n/nl.json +23 -23
  28. package/lib/commonjs/i18n/ru.json +20 -20
  29. package/lib/commonjs/i18n/tr.json +20 -20
  30. package/lib/commonjs/version.json +1 -1
  31. package/lib/module/components/Channel/Channel.js +20 -15
  32. package/lib/module/components/Channel/Channel.js.map +1 -1
  33. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -1
  34. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  35. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +22 -5
  36. package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
  37. package/lib/module/components/Message/Message.js +5 -2
  38. package/lib/module/components/Message/Message.js.map +1 -1
  39. package/lib/module/components/Message/MessageSimple/MessageContent.js +7 -3
  40. package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
  41. package/lib/module/components/Message/MessageSimple/MessageSimple.js +7 -1
  42. package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
  43. package/lib/module/components/MessageInput/MessageInput.js +5 -5
  44. package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
  45. package/lib/module/components/MessageList/MessageList.js +32 -30
  46. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  47. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  48. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +3 -1
  49. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  50. package/lib/module/i18n/es.json +23 -23
  51. package/lib/module/i18n/fr.json +23 -23
  52. package/lib/module/i18n/he.json +23 -23
  53. package/lib/module/i18n/hi.json +23 -23
  54. package/lib/module/i18n/it.json +23 -23
  55. package/lib/module/i18n/ja.json +23 -23
  56. package/lib/module/i18n/ko.json +23 -23
  57. package/lib/module/i18n/nl.json +23 -23
  58. package/lib/module/i18n/ru.json +20 -20
  59. package/lib/module/i18n/tr.json +20 -20
  60. package/lib/module/version.json +1 -1
  61. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +62 -1
  62. package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
  63. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +2 -2
  64. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  65. package/lib/typescript/i18n/es.json +23 -23
  66. package/lib/typescript/i18n/fr.json +23 -23
  67. package/lib/typescript/i18n/he.json +23 -23
  68. package/lib/typescript/i18n/hi.json +23 -23
  69. package/lib/typescript/i18n/it.json +23 -23
  70. package/lib/typescript/i18n/ja.json +23 -23
  71. package/lib/typescript/i18n/ko.json +23 -23
  72. package/lib/typescript/i18n/nl.json +23 -23
  73. package/lib/typescript/i18n/ru.json +20 -20
  74. package/lib/typescript/i18n/tr.json +20 -20
  75. package/package.json +2 -2
  76. package/src/components/Channel/Channel.tsx +8 -2
  77. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +11 -1
  78. package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +24 -6
  79. package/src/components/Message/Message.tsx +6 -1
  80. package/src/components/Message/MessageSimple/MessageContent.tsx +5 -0
  81. package/src/components/Message/MessageSimple/MessageSimple.tsx +8 -2
  82. package/src/components/MessageInput/MessageInput.tsx +3 -7
  83. package/src/components/MessageList/MessageList.tsx +3 -1
  84. package/src/contexts/messageInputContext/MessageInputContext.tsx +1 -1
  85. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +3 -0
  86. package/src/i18n/es.json +23 -23
  87. package/src/i18n/fr.json +23 -23
  88. package/src/i18n/he.json +23 -23
  89. package/src/i18n/hi.json +23 -23
  90. package/src/i18n/it.json +23 -23
  91. package/src/i18n/ja.json +23 -23
  92. package/src/i18n/ko.json +23 -23
  93. package/src/i18n/nl.json +23 -23
  94. package/src/i18n/ru.json +20 -20
  95. package/src/i18n/tr.json +20 -20
  96. package/src/version.json +1 -1
@@ -3,13 +3,13 @@
3
3
  "1 Thread Reply": "1 thread antwoord",
4
4
  "Allow access to your Gallery": "Geef toegang tot uw galerij",
5
5
  "Allow camera access in device settings": "Sta cameratoegang toe in de apparaatinstellingen",
6
- "Also send to channel": "Stuur ook naar kanaal",
6
+ "Also send to channel": "",
7
7
  "Are you sure you want to permanently delete this message?": "",
8
- "Are you sure?": "",
8
+ "Are you sure?": "Weet je het zeker?",
9
9
  "Block User": "",
10
10
  "Cancel": "",
11
11
  "Cannot Flag Message": "",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
12
+ "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Denk na over hoe jouw opmerking anderen zou kunnen laten voelen en zorg ervoor dat je onze Community-richtlijnen volgt",
13
13
  "Copy Message": "",
14
14
  "Delete": "",
15
15
  "Delete Message": "",
@@ -17,7 +17,7 @@
17
17
  "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
18
  "Edit Message": "",
19
19
  "Editing Message": "",
20
- "Emoji matching": "",
20
+ "Emoji matching": "Emoji-overeenkomsten",
21
21
  "Empty message...": "",
22
22
  "Error loading": "",
23
23
  "Error loading channel list...": "",
@@ -28,38 +28,38 @@
28
28
  "Flag Message": "",
29
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
- "Instant Commands": "",
31
+ "Instant Commands": "Directe Opdrachten",
32
32
  "Let's start chatting!": "",
33
- "Links are disabled": "Het versturen van links staat uit",
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.": "Maximale uploadlimiet voor bestandsgrootte bereikt. Upload een bestand van minder dan {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.",
33
+ "Links are disabled": "",
34
+ "Loading channels...": "Kanalen aan het laden...",
35
+ "Loading messages...": "Berichten aan het laden...",
36
+ "Loading...": "Aan het laden...",
37
+ "Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
38
38
  "Message Reactions": "",
39
39
  "Message deleted": "",
40
40
  "Message flagged": "",
41
41
  "Mute User": "",
42
- "Not supported": "",
42
+ "Not supported": "niet ondersteund",
43
43
  "Nothing yet...": "",
44
44
  "Ok": "",
45
45
  "Only visible to you": "Alleen zichtbaar voor jou",
46
46
  "Open Settings": "Open instellingen",
47
- "Photo": "",
47
+ "Photo": "Foto",
48
48
  "Photos and Videos": "Foto's en video's",
49
49
  "Pin to Conversation": "",
50
- "Pinned by": "Vastgemaakt door",
50
+ "Pinned by": "",
51
51
  "Please enable access to your photos and videos so you can share them.": "Schakel toegang tot uw foto's en video's in zodat u ze kunt delen.",
52
- "Please select a channel first": "Selecteer eerst een kanaal",
52
+ "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
54
  "Reply": "",
55
55
  "Reply to Message": "",
56
56
  "Resend": "",
57
- "Search GIFs": "",
57
+ "Search GIFs": "Zoek GIF's",
58
58
  "Select More Photos": "Selecteer Meer foto's",
59
- "Send Anyway": "",
60
- "Send a message": "",
61
- "Sending links is not allowed in this conversation": "In dit gesprek is het niet toegestaan links te versturen",
62
- "Slow mode ON": "",
59
+ "Send Anyway": "Toch verzenden",
60
+ "Send a message": "Stuur een bericht",
61
+ "Sending links is not allowed in this conversation": "",
62
+ "Slow mode ON": "Langzame modus aan",
63
63
  "The message has been reported to a moderator.": "",
64
64
  "Thread Reply": "",
65
65
  "Unblock User": "",
@@ -67,13 +67,13 @@
67
67
  "Unmute User": "",
68
68
  "Unpin from Conversation": "",
69
69
  "Unread Messages": "",
70
- "Video": "",
70
+ "Video": "Video",
71
71
  "You": "",
72
- "You can't send messages in this channel": "Je kan geen berichten sturen in dit kanaal",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} en {{ nonSelfUserLength }} anderen zijn aan het typen",
74
74
  "{{ index }} of {{ photoLength }}": "{{ index }} van {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Antwoorden",
76
76
  "{{ replyCount }} Thread Replies": "{{replyCount}} Discussiereacties",
77
- "{{ user }} is typing": "",
77
+ "{{ user }} is typing": "{{ user }} is aan het typen",
78
78
  "🏙 Attachment...": ""
79
79
  }
@@ -3,7 +3,7 @@
3
3
  "1 Thread Reply": "1 тема Ответить",
4
4
  "Allow access to your Gallery": "Разрешить доступ к вашей галерее",
5
5
  "Allow camera access in device settings": "Разрешите доступ к камере в настройках устройства.",
6
- "Also send to channel": "Также отправить на канал",
6
+ "Also send to channel": "",
7
7
  "Are you sure you want to permanently delete this message?": "",
8
8
  "Are you sure?": "",
9
9
  "Block User": "",
@@ -17,7 +17,7 @@
17
17
  "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
18
  "Edit Message": "",
19
19
  "Editing Message": "",
20
- "Emoji matching": "",
20
+ "Emoji matching": "Соответствие эмодзи",
21
21
  "Empty message...": "",
22
22
  "Error loading": "",
23
23
  "Error loading channel list...": "",
@@ -28,38 +28,38 @@
28
28
  "Flag Message": "",
29
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
- "Instant Commands": "",
31
+ "Instant Commands": "Мгновенные Команды",
32
32
  "Let's start chatting!": "",
33
- "Links are disabled": "Ссылки отключены",
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.": "Достигнут предел максимального размера файла для загрузки. Загрузите файл размером менее {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} МБ.",
33
+ "Links are disabled": "",
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.": "",
38
38
  "Message Reactions": "",
39
39
  "Message deleted": "",
40
40
  "Message flagged": "",
41
41
  "Mute User": "",
42
- "Not supported": "",
42
+ "Not supported": "не поддерживается",
43
43
  "Nothing yet...": "",
44
44
  "Ok": "",
45
45
  "Only visible to you": "Видно только вам",
46
46
  "Open Settings": "Открыть настройки",
47
- "Photo": "",
47
+ "Photo": "Фото",
48
48
  "Photos and Videos": "Фото и видео",
49
49
  "Pin to Conversation": "",
50
- "Pinned by": "Закреплено пользователем",
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": "",
53
53
  "Reconnecting...": "",
54
54
  "Reply": "",
55
55
  "Reply to Message": "",
56
56
  "Resend": "",
57
- "Search GIFs": "",
57
+ "Search GIFs": "Поиск GIF",
58
58
  "Select More Photos": "Выбрать больше фотографий",
59
59
  "Send Anyway": "",
60
- "Send a message": "",
61
- "Sending links is not allowed in this conversation": "Отправка ссылок недоступна в этом чате",
62
- "Slow mode ON": "",
60
+ "Send a message": "Отправить сообщение",
61
+ "Sending links is not allowed in this conversation": "",
62
+ "Slow mode ON": "Медленный режим включен",
63
63
  "The message has been reported to a moderator.": "",
64
64
  "Thread Reply": "",
65
65
  "Unblock User": "",
@@ -67,13 +67,13 @@
67
67
  "Unmute User": "",
68
68
  "Unpin from Conversation": "",
69
69
  "Unread Messages": "",
70
- "Video": "",
70
+ "Video": "видео",
71
71
  "You": "",
72
- "You can't send messages in this channel": "Вы не можете отправлять сообщения в этот канал",
73
- "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
72
+ "You can't send messages in this channel": "",
73
+ "{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} и еще {{ nonSelfUserLength }} пишут",
74
74
  "{{ index }} of {{ photoLength }}": "{{ index }} из {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Ответов",
76
76
  "{{ replyCount }} Thread Replies": "{{replyCount}} Ответы в темах",
77
- "{{ user }} is typing": "",
77
+ "{{ user }} is typing": "{{ user }} пишет",
78
78
  "🏙 Attachment...": ""
79
79
  }
@@ -3,7 +3,7 @@
3
3
  "1 Thread Reply": "1 Konu Yanıtı",
4
4
  "Allow access to your Gallery": "Galerinize erişime izin verin",
5
5
  "Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
6
- "Also send to channel": "Kanala da gönder",
6
+ "Also send to channel": "",
7
7
  "Are you sure you want to permanently delete this message?": "",
8
8
  "Are you sure?": "",
9
9
  "Block User": "",
@@ -17,7 +17,7 @@
17
17
  "Do you want to send a copy of this message to a moderator for further investigation?": "",
18
18
  "Edit Message": "",
19
19
  "Editing Message": "",
20
- "Emoji matching": "",
20
+ "Emoji matching": "Emoji eşleştirme",
21
21
  "Empty message...": "",
22
22
  "Error loading": "",
23
23
  "Error loading channel list...": "",
@@ -28,38 +28,38 @@
28
28
  "Flag Message": "",
29
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
- "Instant Commands": "",
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.",
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
38
  "Message Reactions": "",
39
39
  "Message deleted": "",
40
40
  "Message flagged": "",
41
41
  "Mute User": "",
42
- "Not supported": "",
42
+ "Not supported": "Desteklenmiyor",
43
43
  "Nothing yet...": "",
44
44
  "Ok": "",
45
45
  "Only visible to you": "Sadece siz görebilirsiniz",
46
46
  "Open Settings": "Ayarları aç",
47
- "Photo": "",
47
+ "Photo": "Fotoğraf",
48
48
  "Photos and Videos": "Fotoğraflar ve Videolar",
49
49
  "Pin to Conversation": "",
50
- "Pinned by": "Tarafından sabitlendi",
50
+ "Pinned by": "",
51
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": "Lütfen önce bir kanal seçiniz",
52
+ "Please select a channel first": "",
53
53
  "Reconnecting...": "",
54
54
  "Reply": "",
55
55
  "Reply to Message": "",
56
56
  "Resend": "",
57
- "Search GIFs": "",
57
+ "Search GIFs": "GIF Ara",
58
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": "",
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
63
  "The message has been reported to a moderator.": "",
64
64
  "Thread Reply": "",
65
65
  "Unblock User": "",
@@ -67,13 +67,13 @@
67
67
  "Unmute User": "",
68
68
  "Unpin from Conversation": "",
69
69
  "Unread Messages": "",
70
- "Video": "",
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": "",
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
74
  "{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
75
75
  "{{ replyCount }} Replies": "{{ replyCount }} Cevap",
76
76
  "{{ replyCount }} Thread Replies": "{{responseCount}} Konu Cevapı",
77
- "{{ user }} is typing": "",
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.6",
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
  };
@@ -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,