stream-chat-react-native-core 9.0.0-beta.10 → 9.0.0-beta.11
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/Audio/AudioAttachment.js +28 -15
- package/lib/commonjs/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +13 -17
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy/Giphy.js +21 -23
- package/lib/commonjs/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +8 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js +5 -5
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +9 -14
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +20 -7
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js +1 -1
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +8 -9
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js +3 -3
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js +80 -25
- package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +1 -0
- package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollButtons.js +2 -0
- package/lib/commonjs/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js +2 -1
- package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/StableDurationLabel.js +45 -0
- package/lib/commonjs/components/ProgressControl/StableDurationLabel.js.map +1 -0
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js +127 -40
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +3 -0
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +4 -4
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/commonjs/i18n/en.json +2 -0
- package/lib/commonjs/i18n/es.json +2 -0
- package/lib/commonjs/i18n/fr.json +2 -0
- package/lib/commonjs/i18n/he.json +2 -0
- package/lib/commonjs/i18n/hi.json +2 -0
- package/lib/commonjs/i18n/it.json +2 -0
- package/lib/commonjs/i18n/ja.json +2 -0
- package/lib/commonjs/i18n/ko.json +2 -0
- package/lib/commonjs/i18n/nl.json +2 -0
- package/lib/commonjs/i18n/pt-br.json +2 -0
- package/lib/commonjs/i18n/ru.json +2 -0
- package/lib/commonjs/i18n/tr.json +2 -0
- package/lib/commonjs/middlewares/attachments.js +5 -4
- package/lib/commonjs/middlewares/attachments.js.map +1 -1
- package/lib/commonjs/state-store/audio-player.js +29 -17
- package/lib/commonjs/state-store/audio-player.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Audio/AudioAttachment.js +28 -15
- package/lib/module/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +13 -17
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy/Giphy.js +21 -23
- package/lib/module/components/Attachment/Giphy/Giphy.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +8 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js +5 -5
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/module/components/Message/Message.js +9 -14
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +20 -7
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -1
- package/lib/module/components/MessageMenu/EmojiPickerList.js +1 -1
- package/lib/module/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactions.js +8 -9
- package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js +3 -3
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/module/components/MessageMenu/hooks/useFetchReactions.js +80 -25
- package/lib/module/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/module/components/Poll/components/PollAnswersList.js +1 -0
- package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/module/components/Poll/components/PollButtons.js +2 -0
- package/lib/module/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/module/components/Poll/components/PollInputDialog.js +2 -1
- package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
- package/lib/module/components/ProgressControl/StableDurationLabel.js +45 -0
- package/lib/module/components/ProgressControl/StableDurationLabel.js.map +1 -0
- package/lib/module/components/ProgressControl/WaveProgressBar.js +127 -40
- package/lib/module/components/ProgressControl/WaveProgressBar.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +3 -0
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +4 -4
- package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/module/i18n/en.json +2 -0
- package/lib/module/i18n/es.json +2 -0
- package/lib/module/i18n/fr.json +2 -0
- package/lib/module/i18n/he.json +2 -0
- package/lib/module/i18n/hi.json +2 -0
- package/lib/module/i18n/it.json +2 -0
- package/lib/module/i18n/ja.json +2 -0
- package/lib/module/i18n/ko.json +2 -0
- package/lib/module/i18n/nl.json +2 -0
- package/lib/module/i18n/pt-br.json +2 -0
- package/lib/module/i18n/ru.json +2 -0
- package/lib/module/i18n/tr.json +2 -0
- package/lib/module/middlewares/attachments.js +5 -4
- package/lib/module/middlewares/attachments.js.map +1 -1
- package/lib/module/state-store/audio-player.js +29 -17
- package/lib/module/state-store/audio-player.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Audio/AudioAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/Giphy/Giphy.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts +1 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts +15 -0
- package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollButtons.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollInputDialog.d.ts +2 -1
- package/lib/typescript/components/Poll/components/PollInputDialog.d.ts.map +1 -1
- package/lib/typescript/components/ProgressControl/StableDurationLabel.d.ts +19 -0
- package/lib/typescript/components/ProgressControl/StableDurationLabel.d.ts.map +1 -0
- package/lib/typescript/components/ProgressControl/WaveProgressBar.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +2 -0
- package/lib/typescript/i18n/es.json +2 -0
- package/lib/typescript/i18n/fr.json +2 -0
- package/lib/typescript/i18n/he.json +2 -0
- package/lib/typescript/i18n/hi.json +2 -0
- package/lib/typescript/i18n/it.json +2 -0
- package/lib/typescript/i18n/ja.json +2 -0
- package/lib/typescript/i18n/ko.json +2 -0
- package/lib/typescript/i18n/nl.json +2 -0
- package/lib/typescript/i18n/pt-br.json +2 -0
- package/lib/typescript/i18n/ru.json +2 -0
- package/lib/typescript/i18n/tr.json +2 -0
- package/lib/typescript/middlewares/attachments.d.ts +2 -1
- package/lib/typescript/middlewares/attachments.d.ts.map +1 -1
- package/lib/typescript/state-store/audio-player.d.ts +3 -2
- package/lib/typescript/state-store/audio-player.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +2 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Attachment/Audio/AudioAttachment.tsx +33 -27
- package/src/components/Attachment/Gallery.tsx +1 -8
- package/src/components/Attachment/Giphy/Giphy.tsx +25 -39
- package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +1 -0
- package/src/components/ChannelPreview/ChannelSwipableWrapper.tsx +3 -3
- package/src/components/Message/Message.tsx +1 -3
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx +27 -19
- package/src/components/MessageMenu/EmojiPickerList.tsx +1 -1
- package/src/components/MessageMenu/MessageUserReactions.tsx +8 -11
- package/src/components/MessageMenu/MessageUserReactionsItem.tsx +3 -3
- package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +4 -3
- package/src/components/MessageMenu/hooks/__tests__/useFetchReactions.test.ts +56 -0
- package/src/components/MessageMenu/hooks/useFetchReactions.ts +96 -11
- package/src/components/Poll/components/PollAnswersList.tsx +1 -0
- package/src/components/Poll/components/PollButtons.tsx +2 -0
- package/src/components/Poll/components/PollInputDialog.tsx +3 -1
- package/src/components/ProgressControl/StableDurationLabel.tsx +63 -0
- package/src/components/ProgressControl/WaveProgressBar.tsx +179 -60
- package/src/components/Reply/Reply.tsx +4 -0
- package/src/components/UIComponents/BottomSheetModal.tsx +3 -3
- package/src/i18n/en.json +2 -0
- package/src/i18n/es.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/he.json +2 -0
- package/src/i18n/hi.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/ko.json +2 -0
- package/src/i18n/nl.json +2 -0
- package/src/i18n/pt-br.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/middlewares/attachments.ts +5 -3
- package/src/state-store/__tests__/audio-player.test.ts +217 -0
- package/src/state-store/audio-player.ts +41 -21
- package/src/version.json +1 -1
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"Editing Message": "Bericht aanpassen",
|
|
34
34
|
"Emoji matching": "Emoji-overeenkomsten",
|
|
35
35
|
"Empty message...": "Leeg bericht...",
|
|
36
|
+
"Enter a new option": "Voer een nieuwe optie in",
|
|
36
37
|
"End Vote": "Einde stemronde",
|
|
37
38
|
"Error loading": "Probleem bij het laden",
|
|
38
39
|
"Error loading channel list...": "Probleem bij het laden van de kanalen...",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"View {{count}} comments_one": "Bekijk {{count}} reactie",
|
|
127
128
|
"View {{count}} comments_other": "Bekijk {{count}} reacties",
|
|
128
129
|
"Voice message": "Spraakbericht",
|
|
130
|
+
"Your comment": "Jouw reactie",
|
|
129
131
|
"You": "U",
|
|
130
132
|
"You can't send messages in this channel": "Je kan geen berichten sturen in dit kanaal",
|
|
131
133
|
"duration/Location end at": "{{ milliseconds | durationFormatter(withSuffix: false) }}",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"Editing Message": "Editando Mensagem",
|
|
34
34
|
"Emoji matching": "Correspondência de Emoji",
|
|
35
35
|
"Empty message...": "Mensagem vazia...",
|
|
36
|
+
"Enter a new option": "Digite uma nova opção",
|
|
36
37
|
"End Vote": "Encerrar votação",
|
|
37
38
|
"Error loading": "Erro ao carregar",
|
|
38
39
|
"Error loading channel list...": "Erro ao carregar lista de canais...",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"View {{count}} comments_one": "Ver {{count}} comentário",
|
|
127
128
|
"View {{count}} comments_other": "Ver {{count}} comentários",
|
|
128
129
|
"Voice message": "Mensagem de voz",
|
|
130
|
+
"Your comment": "Seu comentário",
|
|
129
131
|
"You": "Você",
|
|
130
132
|
"You can't send messages in this channel": "Você não pode enviar mensagens neste canal",
|
|
131
133
|
"duration/Location end at": "{{ milliseconds | durationFormatter(withSuffix: false) }}",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"Editing Message": "Редактирование сообщения",
|
|
34
34
|
"Emoji matching": "Соответствие эмодзи",
|
|
35
35
|
"Empty message...": "Пустое сообщение...",
|
|
36
|
+
"Enter a new option": "Введите новый вариант",
|
|
36
37
|
"End Vote": "Завершить голосование",
|
|
37
38
|
"Error loading": "Ошибка при загрузке",
|
|
38
39
|
"Error loading channel list...": "Ошибка загрузки списка каналов...",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"View {{count}} comments_one": "Посмотреть {{count}} комментарий",
|
|
127
128
|
"View {{count}} comments_other": "Посмотреть {{count}} комментария",
|
|
128
129
|
"Voice message": "Голосовое сообщение",
|
|
130
|
+
"Your comment": "Ваш комментарий",
|
|
129
131
|
"You": "Вы",
|
|
130
132
|
"You can't send messages in this channel": "Вы не можете отправлять сообщения в этот канал",
|
|
131
133
|
"duration/Location end at": "{{ milliseconds | durationFormatter(withSuffix: false) }}",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"Editing Message": "Mesaj Düzenleniyor",
|
|
34
34
|
"Emoji matching": "Emoji eşleştirme",
|
|
35
35
|
"Empty message...": "Boş mesaj...",
|
|
36
|
+
"Enter a new option": "Yeni bir seçenek girin",
|
|
36
37
|
"End Vote": "Oylamayı sonlandır",
|
|
37
38
|
"Error loading": "Yükleme hatası",
|
|
38
39
|
"Error loading channel list...": "Kanal listesi yüklenirken hata oluştu...",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"View {{count}} comments_one": "{{count}} yorumu görüntüle",
|
|
127
128
|
"View {{count}} comments_other": "{{count}} yorumu görüntüle",
|
|
128
129
|
"Voice message": "Sesli mesaj",
|
|
130
|
+
"Your comment": "Yorumunuz",
|
|
129
131
|
"You": "Sen",
|
|
130
132
|
"You can't send messages in this channel": "Bu konuşmaya mesaj gönderemezsiniz",
|
|
131
133
|
"duration/Location end at": "{{ milliseconds | durationFormatter(withSuffix: false) }}",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { MessageComposer, MessageCompositionMiddleware, MessageDraftCompositionMiddleware } from 'stream-chat';
|
|
1
|
+
import { Attachment, LocalAttachment, MessageComposer, MessageCompositionMiddleware, MessageDraftCompositionMiddleware } from 'stream-chat';
|
|
2
|
+
export declare const localAttachmentToAttachment: (localAttachment: LocalAttachment) => Attachment;
|
|
2
3
|
export declare const createAttachmentsCompositionMiddleware: (composer: MessageComposer) => MessageCompositionMiddleware;
|
|
3
4
|
export declare const createDraftAttachmentsCompositionMiddleware: (composer: MessageComposer) => MessageDraftCompositionMiddleware;
|
|
4
5
|
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../src/middlewares/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../src/middlewares/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGV,eAAe,EACf,eAAe,EAEf,4BAA4B,EAE5B,iCAAiC,EAElC,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,2BAA2B,GAAI,iBAAiB,eAAe,eAuB3E,CAAC;AAEF,eAAO,MAAM,sCAAsC,GACjD,UAAU,eAAe,KACxB,4BA+BD,CAAC;AAEH,eAAO,MAAM,2CAA2C,GACtD,UAAU,eAAe,KACxB,iCAwBD,CAAC"}
|
|
@@ -23,13 +23,14 @@ export type AudioPlayerOptions = AudioDescriptor & {
|
|
|
23
23
|
export declare class AudioPlayer {
|
|
24
24
|
state: StateStore<AudioPlayerState>;
|
|
25
25
|
playerRef: SoundReturnType | null;
|
|
26
|
+
private initRequestId;
|
|
26
27
|
private _id;
|
|
27
28
|
private type;
|
|
28
29
|
private isExpoCLI;
|
|
29
30
|
private _pool;
|
|
30
31
|
/**
|
|
31
|
-
* This
|
|
32
|
-
*
|
|
32
|
+
* This keeps the composer preview on the recorder-backed player until preview
|
|
33
|
+
* and attachment playback are fully unified under the same sound service.
|
|
33
34
|
*/
|
|
34
35
|
private previewVoiceRecording?;
|
|
35
36
|
constructor(options: AudioPlayerOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-player.d.ts","sourceRoot":"","sources":["../../../src/state-store/audio-player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAyD,eAAe,EAAE,MAAM,WAAW,CAAC;AAEnG,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAA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AAO,EAI/B;IAGK,kBAAkB;IAqBxB,IAAI;IAqCJ,KAAK;IAoCL,MAAM;IAQA,IAAI,CAAC,iBAAiB,EAAE,MAAM;IAgC9B,IAAI;IAMV,QAAQ;CA8BT"}
|
|
@@ -168,6 +168,7 @@ export declare class Streami18n {
|
|
|
168
168
|
"Editing Message": string;
|
|
169
169
|
"Emoji matching": string;
|
|
170
170
|
"Empty message...": string;
|
|
171
|
+
"Enter a new option": string;
|
|
171
172
|
"End Vote": string;
|
|
172
173
|
"Error loading": string;
|
|
173
174
|
"Error loading channel list...": string;
|
|
@@ -261,6 +262,7 @@ export declare class Streami18n {
|
|
|
261
262
|
"View {{count}} comments_one": string;
|
|
262
263
|
"View {{count}} comments_other": string;
|
|
263
264
|
"Voice message": string;
|
|
265
|
+
"Your comment": string;
|
|
264
266
|
You: string;
|
|
265
267
|
"You can't send messages in this channel": string;
|
|
266
268
|
"duration/Location end at": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Streami18n.d.ts","sourceRoot":"","sources":["../../../../src/utils/i18n/Streami18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,cAAc,MAAM,iBAAiB,CAAC;AAIlD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAahD,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,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AC;IASvD;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM;IAsBlC,2BAA2B,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI;;;IAW5D,8BAA8B,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI;;;IAW/D,iBAAiB,CAAC,SAAS,EAAE,SAAS;CAQvC"}
|
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": "9.0.0-beta.
|
|
4
|
+
"version": "9.0.0-beta.11",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { PlayPauseButton } from './PlayPauseButton';
|
|
16
16
|
|
|
17
17
|
import { useTheme } from '../../../contexts';
|
|
18
|
+
import { useStableCallback } from '../../../hooks';
|
|
18
19
|
import { useStateStore } from '../../../hooks';
|
|
19
20
|
import { useAudioPlayer } from '../../../hooks/useAudioPlayer';
|
|
20
21
|
import {
|
|
@@ -28,6 +29,7 @@ import { AudioPlayerState } from '../../../state-store/audio-player';
|
|
|
28
29
|
import { primitives } from '../../../theme';
|
|
29
30
|
import { AudioConfig } from '../../../types/types';
|
|
30
31
|
import { ProgressControl } from '../../ProgressControl/ProgressControl';
|
|
32
|
+
import { StableDurationLabel } from '../../ProgressControl/StableDurationLabel';
|
|
31
33
|
import { WaveProgressBar } from '../../ProgressControl/WaveProgressBar';
|
|
32
34
|
import { SpeedSettingsButton } from '../../ui/SpeedSettingsButton';
|
|
33
35
|
|
|
@@ -36,6 +38,16 @@ const ONE_SECOND_IN_MILLISECONDS = 1000;
|
|
|
36
38
|
|
|
37
39
|
dayjs.extend(duration);
|
|
38
40
|
|
|
41
|
+
const getAudioDurationLabel = (durationInMilliseconds: number) => {
|
|
42
|
+
if (!durationInMilliseconds) {
|
|
43
|
+
return '00:00';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return durationInMilliseconds / ONE_HOUR_IN_MILLISECONDS >= 1
|
|
47
|
+
? dayjs.duration(durationInMilliseconds, 'milliseconds').format('HH:mm:ss')
|
|
48
|
+
: dayjs.duration(durationInMilliseconds, 'milliseconds').format('mm:ss');
|
|
49
|
+
};
|
|
50
|
+
|
|
39
51
|
export type AudioAttachmentType = AudioConfig &
|
|
40
52
|
Pick<
|
|
41
53
|
StreamAudioAttachment | StreamVoiceRecordingAttachment,
|
|
@@ -131,7 +143,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
|
|
|
131
143
|
|
|
132
144
|
/** This is for Native CLI Apps */
|
|
133
145
|
const handleLoad = (payload: VideoPayloadData) => {
|
|
134
|
-
//
|
|
146
|
+
// Voice recordings already carry the canonical duration in the attachment payload.
|
|
135
147
|
if (isVoiceRecording) {
|
|
136
148
|
return;
|
|
137
149
|
}
|
|
@@ -157,18 +169,14 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
|
|
|
157
169
|
await audioPlayer.stop();
|
|
158
170
|
};
|
|
159
171
|
|
|
160
|
-
const dragStart = () => {
|
|
172
|
+
const dragStart = useStableCallback(() => {
|
|
161
173
|
audioPlayer.pause();
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const dragProgress = (currentProgress: number) => {
|
|
165
|
-
audioPlayer.progress = currentProgress;
|
|
166
|
-
};
|
|
174
|
+
});
|
|
167
175
|
|
|
168
|
-
const dragEnd = async (currentProgress: number) => {
|
|
176
|
+
const dragEnd = useStableCallback(async (currentProgress: number) => {
|
|
169
177
|
const positionInSeconds = (currentProgress * duration) / ONE_SECOND_IN_MILLISECONDS;
|
|
170
178
|
await audioPlayer.seek(positionInSeconds);
|
|
171
|
-
};
|
|
179
|
+
});
|
|
172
180
|
|
|
173
181
|
const onSpeedChangeHandler = async () => {
|
|
174
182
|
await audioPlayer.changePlaybackRate();
|
|
@@ -192,14 +200,13 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
|
|
|
192
200
|
},
|
|
193
201
|
} = useTheme();
|
|
194
202
|
|
|
203
|
+
const maxDurationLabel = useMemo(() => getAudioDurationLabel(duration), [duration]);
|
|
204
|
+
|
|
205
|
+
const remainingDuration = useMemo(() => Math.max(duration - position, 0), [duration, position]);
|
|
206
|
+
|
|
195
207
|
const progressDuration = useMemo(
|
|
196
|
-
() =>
|
|
197
|
-
|
|
198
|
-
? position / ONE_HOUR_IN_MILLISECONDS >= 1
|
|
199
|
-
? dayjs.duration(position, 'milliseconds').format('HH:mm:ss')
|
|
200
|
-
: dayjs.duration(position, 'milliseconds').format('mm:ss')
|
|
201
|
-
: dayjs.duration(duration, 'milliseconds').format('mm:ss'),
|
|
202
|
-
[duration, position],
|
|
208
|
+
() => getAudioDurationLabel(remainingDuration || duration),
|
|
209
|
+
[duration, remainingDuration],
|
|
203
210
|
);
|
|
204
211
|
|
|
205
212
|
return (
|
|
@@ -246,23 +253,21 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
|
|
|
246
253
|
indicator
|
|
247
254
|
) : (
|
|
248
255
|
<View style={[styles.audioInfo, audioInfo]}>
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</Text>
|
|
256
|
+
<StableDurationLabel
|
|
257
|
+
accessibilityLabel='Progress Duration'
|
|
258
|
+
reserveLabel={maxDurationLabel}
|
|
259
|
+
label={progressDuration}
|
|
260
|
+
style={[styles.progressDurationText, progressDurationText, stylesProps?.durationText]}
|
|
261
|
+
visibleStyle={{
|
|
262
|
+
color: isPlaying ? semantics.accentPrimary : semantics.textSecondary,
|
|
263
|
+
}}
|
|
264
|
+
/>
|
|
259
265
|
{!hideProgressBar && (
|
|
260
266
|
<View style={[styles.progressControlContainer, progressControlContainer]}>
|
|
261
267
|
{item.waveform_data ? (
|
|
262
268
|
<WaveProgressBar
|
|
263
269
|
isPlaying={isPlaying}
|
|
264
270
|
onEndDrag={dragEnd}
|
|
265
|
-
onProgressDrag={dragProgress}
|
|
266
271
|
onStartDrag={dragStart}
|
|
267
272
|
progress={progress}
|
|
268
273
|
waveformData={item.waveform_data}
|
|
@@ -344,6 +349,7 @@ const useStyles = () => {
|
|
|
344
349
|
},
|
|
345
350
|
progressDurationText: {
|
|
346
351
|
color: semantics.textPrimary,
|
|
352
|
+
fontVariant: ['tabular-nums'],
|
|
347
353
|
fontSize: primitives.typographyFontSizeXs,
|
|
348
354
|
fontWeight: primitives.typographyFontWeightRegular,
|
|
349
355
|
lineHeight: primitives.typographyLineHeightTight,
|
|
@@ -327,14 +327,7 @@ const GalleryThumbnail = ({
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
}}
|
|
330
|
-
style={
|
|
331
|
-
styles.imageContainer,
|
|
332
|
-
{
|
|
333
|
-
opacity: pressed ? 0.8 : 1,
|
|
334
|
-
flex: thumbnail.flex,
|
|
335
|
-
},
|
|
336
|
-
imageContainer,
|
|
337
|
-
]}
|
|
330
|
+
style={[styles.imageContainer, { flex: thumbnail.flex }, imageContainer]}
|
|
338
331
|
testID={`gallery-${invertedDirections ? 'row' : 'column'}-${colIndex}-item-${rowIndex}`}
|
|
339
332
|
{...additionalPressableProps}
|
|
340
333
|
>
|
|
@@ -17,7 +17,8 @@ import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
|
17
17
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
18
18
|
|
|
19
19
|
import { EyeOpen } from '../../../icons/EyeOpen';
|
|
20
|
-
import { primitives } from '../../../theme';
|
|
20
|
+
import { components, primitives } from '../../../theme';
|
|
21
|
+
import { Button } from '../../ui/';
|
|
21
22
|
|
|
22
23
|
export type GiphyPropsWithContext = Pick<
|
|
23
24
|
MessageContextValue,
|
|
@@ -46,14 +47,7 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => {
|
|
|
46
47
|
const {
|
|
47
48
|
theme: {
|
|
48
49
|
messageItemView: {
|
|
49
|
-
giphy: {
|
|
50
|
-
actionButtonContainer,
|
|
51
|
-
actionButton,
|
|
52
|
-
actionButtonText,
|
|
53
|
-
container,
|
|
54
|
-
giphyHeaderText,
|
|
55
|
-
header,
|
|
56
|
-
},
|
|
50
|
+
giphy: { actionButtonContainer, actionButton, container, giphyHeaderText, header },
|
|
57
51
|
},
|
|
58
52
|
semantics,
|
|
59
53
|
},
|
|
@@ -68,7 +62,10 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => {
|
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
return actions ? (
|
|
71
|
-
<View
|
|
65
|
+
<View
|
|
66
|
+
style={[styles.container, styles.actionContainer, container]}
|
|
67
|
+
testID='giphy-action-attachment'
|
|
68
|
+
>
|
|
72
69
|
<View style={[styles.header, header]}>
|
|
73
70
|
<EyeOpen height={16} width={16} fill={semantics.chatTextOutgoing} />
|
|
74
71
|
<Text style={[styles.headerText, giphyHeaderText]}>{t('Only visible to you')}</Text>
|
|
@@ -76,33 +73,23 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => {
|
|
|
76
73
|
<GiphyImage attachment={attachment} giphyVersion={giphyVersion} preview />
|
|
77
74
|
<View style={[styles.actionButtonContainer, actionButtonContainer]}>
|
|
78
75
|
{actions.map((action) => {
|
|
76
|
+
const isPrimaryAction = action.text === 'Send';
|
|
79
77
|
return (
|
|
80
|
-
<
|
|
78
|
+
<Button
|
|
81
79
|
key={action.value}
|
|
80
|
+
variant={isPrimaryAction ? 'primary' : 'secondary'}
|
|
81
|
+
type='ghost'
|
|
82
|
+
size='sm'
|
|
83
|
+
testID={`${action.value}-action-button`}
|
|
82
84
|
onPress={() => {
|
|
83
85
|
if (action?.name && action?.value && handleAction) {
|
|
84
86
|
handleAction(action.name, action.value);
|
|
85
87
|
}
|
|
86
88
|
}}
|
|
89
|
+
iconOnly={false}
|
|
90
|
+
label={action.text}
|
|
87
91
|
style={[styles.actionButton, actionButton]}
|
|
88
|
-
|
|
89
|
-
>
|
|
90
|
-
<Text
|
|
91
|
-
numberOfLines={1}
|
|
92
|
-
style={[
|
|
93
|
-
styles.actionButtonText,
|
|
94
|
-
{
|
|
95
|
-
color:
|
|
96
|
-
action.text === 'Send'
|
|
97
|
-
? semantics.buttonPrimaryText
|
|
98
|
-
: semantics.buttonSecondaryText,
|
|
99
|
-
},
|
|
100
|
-
actionButtonText,
|
|
101
|
-
]}
|
|
102
|
-
>
|
|
103
|
-
{action.text}
|
|
104
|
-
</Text>
|
|
105
|
-
</Pressable>
|
|
92
|
+
/>
|
|
106
93
|
);
|
|
107
94
|
})}
|
|
108
95
|
</View>
|
|
@@ -225,20 +212,19 @@ const useStyles = () => {
|
|
|
225
212
|
overflow: 'hidden',
|
|
226
213
|
},
|
|
227
214
|
actionButtonContainer: {
|
|
215
|
+
alignSelf: 'center',
|
|
228
216
|
flexDirection: 'row',
|
|
229
217
|
gap: primitives.spacingXs,
|
|
230
|
-
|
|
231
|
-
actionButton: {
|
|
232
|
-
alignItems: 'center',
|
|
233
|
-
flex: 1,
|
|
218
|
+
paddingHorizontal: primitives.spacingXxs,
|
|
234
219
|
justifyContent: 'center',
|
|
235
|
-
paddingVertical: primitives.spacingSm,
|
|
236
220
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
221
|
+
actionContainer: {},
|
|
222
|
+
actionButton: {
|
|
223
|
+
alignSelf: 'flex-start',
|
|
224
|
+
flexGrow: 0,
|
|
225
|
+
flexShrink: 0,
|
|
226
|
+
width: undefined,
|
|
227
|
+
minHeight: components.buttonHitTargetMinHeight,
|
|
242
228
|
},
|
|
243
229
|
header: {
|
|
244
230
|
alignItems: 'center',
|
|
@@ -223,6 +223,7 @@ export const AttachmentFilePicker = (props: AttachmentPickerContentProps) => {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
export type { AttachmentPickerContentProps } from './AttachmentPickerGenericContent';
|
|
226
|
+
export { AttachmentPickerGenericContent } from './AttachmentPickerGenericContent';
|
|
226
227
|
|
|
227
228
|
export const AttachmentPickerContent = (props: AttachmentPickerContentProps) => {
|
|
228
229
|
const { height } = props;
|
|
@@ -57,9 +57,9 @@ export const ChannelSwipableWrapper = ({
|
|
|
57
57
|
const Icon = useCallback(
|
|
58
58
|
() =>
|
|
59
59
|
isDirectChannel ? (
|
|
60
|
-
<Mute width={20} height={20} fill={semantics.textOnAccent} />
|
|
61
|
-
) : (
|
|
62
60
|
<Archive width={20} height={20} stroke={semantics.textOnAccent} />
|
|
61
|
+
) : (
|
|
62
|
+
<Mute width={20} height={20} fill={semantics.textOnAccent} />
|
|
63
63
|
),
|
|
64
64
|
[isDirectChannel, semantics.textOnAccent],
|
|
65
65
|
);
|
|
@@ -74,7 +74,7 @@ export const ChannelSwipableWrapper = ({
|
|
|
74
74
|
},
|
|
75
75
|
];
|
|
76
76
|
|
|
77
|
-
const extraItem = isDirectChannel ? channelActionsById.
|
|
77
|
+
const extraItem = isDirectChannel ? channelActionsById.archive : channelActionsById.mute;
|
|
78
78
|
|
|
79
79
|
if (extraItem) {
|
|
80
80
|
const { id, action } = extraItem;
|
|
@@ -248,7 +248,6 @@ export type MessagePropsWithContext = Pick<
|
|
|
248
248
|
* each individual Message component.
|
|
249
249
|
*/
|
|
250
250
|
const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
251
|
-
const [isErrorInMessage, setIsErrorInMessage] = useState(false);
|
|
252
251
|
const [showMessageReactions, setShowMessageReactions] = useState<boolean>(false);
|
|
253
252
|
const [selectedReaction, setSelectedReaction] = useState<string | undefined>(undefined);
|
|
254
253
|
const [isBounceDialogOpen, setIsBounceDialogOpen] = useState(false);
|
|
@@ -391,7 +390,6 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
391
390
|
}
|
|
392
391
|
const quotedMessage = message.quoted_message;
|
|
393
392
|
if (error) {
|
|
394
|
-
setIsErrorInMessage(true);
|
|
395
393
|
/**
|
|
396
394
|
* If its a Blocked message, we don't do anything as per specs.
|
|
397
395
|
*/
|
|
@@ -634,7 +632,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
634
632
|
deleteMessage,
|
|
635
633
|
dismissOverlay,
|
|
636
634
|
editMessage,
|
|
637
|
-
error:
|
|
635
|
+
error: errorOrFailed,
|
|
638
636
|
flagMessage,
|
|
639
637
|
isMyMessage,
|
|
640
638
|
isThreadMessage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
|
-
import { Pressable, StyleSheet,
|
|
2
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
|
|
@@ -11,15 +11,25 @@ import { useStateStore } from '../../../../hooks/useStateStore';
|
|
|
11
11
|
|
|
12
12
|
import { Pause } from '../../../../icons/Pause';
|
|
13
13
|
import { Play } from '../../../../icons/Play';
|
|
14
|
-
import { NativeHandlers } from '../../../../native';
|
|
15
14
|
import { AudioPlayerState } from '../../../../state-store/audio-player';
|
|
16
15
|
import { AudioRecorderManagerState } from '../../../../state-store/audio-recorder-manager';
|
|
17
16
|
import { primitives } from '../../../../theme';
|
|
17
|
+
import { StableDurationLabel } from '../../../ProgressControl/StableDurationLabel';
|
|
18
18
|
import { WaveProgressBar } from '../../../ProgressControl/WaveProgressBar';
|
|
19
19
|
|
|
20
20
|
const ONE_SECOND_IN_MILLISECONDS = 1000;
|
|
21
21
|
const ONE_HOUR_IN_MILLISECONDS = 3600 * 1000;
|
|
22
22
|
|
|
23
|
+
const getAudioDurationLabel = (durationInMilliseconds: number) => {
|
|
24
|
+
if (!durationInMilliseconds) {
|
|
25
|
+
return '00:00';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return durationInMilliseconds / ONE_HOUR_IN_MILLISECONDS >= 1
|
|
29
|
+
? dayjs.duration(durationInMilliseconds, 'milliseconds').format('HH:mm:ss')
|
|
30
|
+
: dayjs.duration(durationInMilliseconds, 'milliseconds').format('mm:ss');
|
|
31
|
+
};
|
|
32
|
+
|
|
23
33
|
const audioPlayerSelector = (state: AudioPlayerState) => ({
|
|
24
34
|
duration: state.duration,
|
|
25
35
|
isPlaying: state.isPlaying,
|
|
@@ -52,8 +62,8 @@ export const AudioRecordingPreview = () => {
|
|
|
52
62
|
const audioPlayer = useAudioPlayer({
|
|
53
63
|
duration: recordingDuration / ONE_SECOND_IN_MILLISECONDS,
|
|
54
64
|
mimeType: 'audio/aac',
|
|
55
|
-
//
|
|
56
|
-
previewVoiceRecording:
|
|
65
|
+
// The preview still uses the recorder-backed player until both playback paths are unified.
|
|
66
|
+
previewVoiceRecording: false,
|
|
57
67
|
type: 'voiceRecording',
|
|
58
68
|
uri,
|
|
59
69
|
});
|
|
@@ -91,13 +101,10 @@ export const AudioRecordingPreview = () => {
|
|
|
91
101
|
audioPlayer.toggle();
|
|
92
102
|
};
|
|
93
103
|
|
|
104
|
+
const maxDurationLabel = useMemo(() => getAudioDurationLabel(duration), [duration]);
|
|
105
|
+
|
|
94
106
|
const progressDuration = useMemo(
|
|
95
|
-
() =>
|
|
96
|
-
position
|
|
97
|
-
? position / ONE_HOUR_IN_MILLISECONDS >= 1
|
|
98
|
-
? dayjs.duration(position, 'milliseconds').format('HH:mm:ss')
|
|
99
|
-
: dayjs.duration(position, 'milliseconds').format('mm:ss')
|
|
100
|
-
: dayjs.duration(duration, 'milliseconds').format('mm:ss'),
|
|
107
|
+
() => getAudioDurationLabel(position || duration),
|
|
101
108
|
[duration, position],
|
|
102
109
|
);
|
|
103
110
|
|
|
@@ -121,15 +128,15 @@ export const AudioRecordingPreview = () => {
|
|
|
121
128
|
)}
|
|
122
129
|
</Pressable>
|
|
123
130
|
{/* `durationMillis` is for Expo apps, `currentPosition` is for Native CLI apps. */}
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
<StableDurationLabel
|
|
132
|
+
accessibilityLabel='Progress Duration'
|
|
133
|
+
reserveLabel={maxDurationLabel}
|
|
134
|
+
label={progressDuration}
|
|
135
|
+
style={[styles.durationText, currentTime]}
|
|
136
|
+
visibleStyle={{
|
|
137
|
+
color: isPlaying ? semantics.accentPrimary : semantics.textPrimary,
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
133
140
|
</View>
|
|
134
141
|
<View style={[styles.progressBar, progressBar]}>
|
|
135
142
|
{/* Since the progress is in range 0-1 we convert it in terms of 100% */}
|
|
@@ -159,6 +166,7 @@ const useStyles = () => {
|
|
|
159
166
|
gap: primitives.spacingMd,
|
|
160
167
|
},
|
|
161
168
|
durationText: {
|
|
169
|
+
fontVariant: ['tabular-nums'],
|
|
162
170
|
fontSize: primitives.typographyFontSizeMd,
|
|
163
171
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
164
172
|
lineHeight: primitives.typographyLineHeightNormal,
|
|
@@ -98,7 +98,7 @@ const useStyles = () => {
|
|
|
98
98
|
width: '100%',
|
|
99
99
|
height: 54,
|
|
100
100
|
},
|
|
101
|
-
bottomSheetContentContainer: {
|
|
101
|
+
bottomSheetContentContainer: { paddingBottom: 16 },
|
|
102
102
|
emojiContainer: {
|
|
103
103
|
alignItems: 'center',
|
|
104
104
|
justifyContent: 'center',
|
|
@@ -93,7 +93,7 @@ const renderSelectorItem = ({ index, item }: { index: number; item: ReactionSele
|
|
|
93
93
|
/>
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
const reactionsKeyExtractor = (item: Reaction) => item.id
|
|
96
|
+
const reactionsKeyExtractor = (item: Reaction) => `${item.id}-${item.type}`;
|
|
97
97
|
const reactionSelectorKeyExtractor = (item: ReactionSelectorItemType) => item.type;
|
|
98
98
|
|
|
99
99
|
export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
@@ -104,7 +104,6 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
104
104
|
MessageUserReactionsAvatar: propMessageUserReactionsAvatar,
|
|
105
105
|
MessageUserReactionsItem: propMessageUserReactionsItem,
|
|
106
106
|
reactions: propReactions,
|
|
107
|
-
selectedReaction: propSelectedReaction,
|
|
108
107
|
supportedReactions: propSupportedReactions,
|
|
109
108
|
} = props;
|
|
110
109
|
const selectorListRef = useRef<FlatList>(null);
|
|
@@ -113,9 +112,7 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
113
112
|
() => Object.keys(message?.reaction_groups ?? {}),
|
|
114
113
|
[message?.reaction_groups],
|
|
115
114
|
);
|
|
116
|
-
const [selectedReaction, setSelectedReaction] = useState<string | undefined>(
|
|
117
|
-
propSelectedReaction ?? reactionTypes[0],
|
|
118
|
-
);
|
|
115
|
+
const [selectedReaction, setSelectedReaction] = useState<string | undefined>(undefined);
|
|
119
116
|
const {
|
|
120
117
|
MessageUserReactionsAvatar: contextMessageUserReactionsAvatar,
|
|
121
118
|
MessageUserReactionsItem: contextMessageUserReactionsItem,
|
|
@@ -133,7 +130,7 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
133
130
|
|
|
134
131
|
useEffect(() => {
|
|
135
132
|
if (selectedReaction && reactionTypes.length > 0 && !reactionTypes.includes(selectedReaction)) {
|
|
136
|
-
setSelectedReaction(
|
|
133
|
+
setSelectedReaction(undefined);
|
|
137
134
|
}
|
|
138
135
|
}, [reactionTypes, selectedReaction]);
|
|
139
136
|
|
|
@@ -163,16 +160,16 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
163
160
|
);
|
|
164
161
|
|
|
165
162
|
const selectedIndex = useMemo(() => {
|
|
166
|
-
if (!
|
|
163
|
+
if (!selectedReaction) {
|
|
167
164
|
return -1;
|
|
168
165
|
}
|
|
169
|
-
return selectorReactions.findIndex((reaction) => reaction.type ===
|
|
170
|
-
}, [
|
|
166
|
+
return selectorReactions.findIndex((reaction) => reaction.type === selectedReaction);
|
|
167
|
+
}, [selectedReaction, selectorReactions]);
|
|
171
168
|
|
|
172
169
|
useEffect(() => {
|
|
173
170
|
if (selectedIndex !== -1 && selectorListRef.current) {
|
|
174
171
|
selectorListRef.current?.scrollToIndex({
|
|
175
|
-
index: selectedIndex
|
|
172
|
+
index: selectedIndex,
|
|
176
173
|
animated: true,
|
|
177
174
|
});
|
|
178
175
|
}
|
|
@@ -345,7 +342,7 @@ const useStyles = () => {
|
|
|
345
342
|
fontSize: primitives.typographyFontSizeMd,
|
|
346
343
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
347
344
|
color: semantics.textPrimary,
|
|
348
|
-
|
|
345
|
+
paddingVertical: primitives.spacingSm,
|
|
349
346
|
textAlign: 'center',
|
|
350
347
|
},
|
|
351
348
|
showMoreReactionsButton: { paddingHorizontal: primitives.spacingXs },
|