stream-chat-react-native-core 9.0.0-beta.6 → 9.0.0-beta.8
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 +0 -1
- package/lib/commonjs/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +2 -2
- package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +5 -8
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js +9 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +10 -78
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +83 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -0
- package/lib/commonjs/components/Channel/Channel.js +2 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +16 -9
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +4 -4
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/types.js +4 -0
- package/lib/commonjs/components/ImageGallery/components/types.js.map +1 -0
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js +2 -2
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js +6 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js +7 -29
- package/lib/commonjs/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +0 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useAudioRecorder.js +3 -14
- package/lib/commonjs/components/MessageInput/hooks/useAudioRecorder.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js +5 -5
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -8
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +1 -0
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/utils/toUnicodeScalarString.js +12 -0
- package/lib/commonjs/components/MessageMenu/utils/toUnicodeScalarString.js.map +1 -0
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +52 -45
- package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +24 -14
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +4 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +46 -19
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/commonjs/components/Poll/hooks/usePollState.js +6 -3
- package/lib/commonjs/components/Poll/hooks/usePollState.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js +46 -15
- package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItemMessagePreview.js +23 -5
- package/lib/commonjs/components/ThreadList/ThreadListItemMessagePreview.js.map +1 -1
- package/lib/commonjs/components/index.js +33 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/ui/SpeedSettingsButton.js +3 -3
- package/lib/commonjs/components/ui/SpeedSettingsButton.js.map +1 -1
- package/lib/commonjs/components/ui/VideoPlayIndicator.js +3 -3
- package/lib/commonjs/components/ui/VideoPlayIndicator.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +15 -12
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js +18 -0
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -0
- package/lib/commonjs/contexts/themeContext/utils/theme.js +4 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadsContext/ThreadListItemContext.js.map +1 -1
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js +2 -2
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/commonjs/hooks/useAttachmentPickerState.js +2 -2
- package/lib/commonjs/hooks/useAttachmentPickerState.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Audio/AudioAttachment.js +0 -1
- package/lib/module/components/Attachment/Audio/AudioAttachment.js.map +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +2 -2
- package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +5 -8
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js +9 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js.map +1 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +10 -78
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +83 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -0
- package/lib/module/components/Channel/Channel.js +2 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +16 -9
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +4 -4
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/types.js +4 -0
- package/lib/module/components/ImageGallery/components/types.js.map +1 -0
- package/lib/module/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js +2 -2
- package/lib/module/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageFooter.js +6 -1
- package/lib/module/components/Message/MessageItemView/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageStatus.js +7 -29
- package/lib/module/components/Message/MessageItemView/MessageStatus.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js +0 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useAudioRecorder.js +3 -14
- package/lib/module/components/MessageInput/hooks/useAudioRecorder.js.map +1 -1
- package/lib/module/components/MessageMenu/EmojiPickerList.js +5 -5
- package/lib/module/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -8
- package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactions.js +1 -0
- package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/module/components/MessageMenu/utils/toUnicodeScalarString.js +12 -0
- package/lib/module/components/MessageMenu/utils/toUnicodeScalarString.js.map +1 -0
- package/lib/module/components/Poll/components/PollAnswersList.js +52 -45
- package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +24 -14
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +4 -1
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js +46 -19
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/module/components/Poll/hooks/usePollState.js +6 -3
- package/lib/module/components/Poll/hooks/usePollState.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js +46 -15
- package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItemMessagePreview.js +23 -5
- package/lib/module/components/ThreadList/ThreadListItemMessagePreview.js.map +1 -1
- package/lib/module/components/index.js +33 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/ui/SpeedSettingsButton.js +3 -3
- package/lib/module/components/ui/SpeedSettingsButton.js.map +1 -1
- package/lib/module/components/ui/VideoPlayIndicator.js +3 -3
- package/lib/module/components/ui/VideoPlayIndicator.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +15 -12
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js +18 -0
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -0
- package/lib/module/contexts/themeContext/utils/theme.js +4 -1
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadsContext/ThreadListItemContext.js.map +1 -1
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js +2 -2
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/module/hooks/useAttachmentPickerState.js +2 -2
- package/lib/module/hooks/useAttachmentPickerState.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/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts +1 -8
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/shared.d.ts +8 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/shared.d.ts.map +1 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts +2 -10
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerGenericContent.d.ts +13 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerGenericContent.d.ts.map +1 -0
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +1 -11
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +1 -5
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryVideoControl.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryVideoControl.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +1 -4
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/types.d.ts +21 -0
- package/lib/typescript/components/ImageGallery/components/types.d.ts.map +1 -0
- package/lib/typescript/components/Message/MessageItemView/MessageFooter.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageStatus.d.ts +1 -5
- package/lib/typescript/components/Message/MessageItemView/MessageStatus.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/hooks/useAudioRecorder.d.ts +0 -2
- package/lib/typescript/components/MessageInput/hooks/useAudioRecorder.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts +0 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/utils/toUnicodeScalarString.d.ts +2 -0
- package/lib/typescript/components/MessageMenu/utils/toUnicodeScalarString.d.ts.map +1 -0
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts +2 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -1
- package/lib/typescript/components/Poll/hooks/usePollState.d.ts +1 -0
- package/lib/typescript/components/Poll/hooks/usePollState.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadListItem.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadListItemMessagePreview.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +3 -22
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts +19 -0
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts.map +1 -0
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +3 -0
- package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +3 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/contexts/threadsContext/ThreadListItemContext.d.ts +2 -1
- package/lib/typescript/contexts/threadsContext/ThreadListItemContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Attachment/Audio/AudioAttachment.tsx +0 -1
- package/src/components/Attachment/VideoThumbnail.tsx +1 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.tsx +3 -12
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +1 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/shared.ts +10 -0
- package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +8 -84
- package/src/components/AttachmentPicker/components/AttachmentPickerGenericContent.tsx +90 -0
- package/src/components/Channel/Channel.tsx +2 -4
- package/src/components/ChannelList/__tests__/ChannelList.test.js +43 -0
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +8 -5
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +4 -24
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +4 -12
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +1 -1
- package/src/components/ImageGallery/components/ImageGrid.tsx +4 -7
- package/src/components/ImageGallery/components/types.ts +25 -0
- package/src/components/ImageGallery/hooks/useImageGalleryVideoPlayer.ts +1 -1
- package/src/components/Message/MessageItemView/MessageFooter.tsx +9 -3
- package/src/components/Message/MessageItemView/MessageStatus.tsx +4 -37
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx +0 -1
- package/src/components/MessageInput/hooks/useAudioRecorder.tsx +4 -14
- package/src/components/MessageMenu/EmojiPickerList.tsx +2 -2
- package/src/components/MessageMenu/MessageReactionPicker.tsx +0 -8
- package/src/components/MessageMenu/MessageUserReactions.tsx +1 -0
- package/src/components/MessageMenu/utils/toUnicodeScalarString.ts +5 -0
- package/src/components/Poll/components/PollAnswersList.tsx +45 -32
- package/src/components/Poll/components/PollOption.tsx +24 -15
- package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +4 -1
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +36 -12
- package/src/components/Poll/hooks/usePollState.ts +4 -0
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +52 -0
- package/src/components/ThreadList/ThreadListItem.tsx +56 -10
- package/src/components/ThreadList/ThreadListItemMessagePreview.tsx +18 -3
- package/src/components/index.ts +3 -0
- package/src/components/ui/SpeedSettingsButton.tsx +1 -1
- package/src/components/ui/VideoPlayIndicator.tsx +1 -1
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +9 -44
- package/src/contexts/imageGalleryContext/ImageGalleryContextBase.tsx +44 -0
- package/src/contexts/themeContext/utils/theme.ts +6 -0
- package/src/contexts/threadsContext/ThreadListItemContext.tsx +2 -1
- package/src/hooks/messagePreview/useMessagePreviewText.tsx +1 -1
- package/src/hooks/useAttachmentPickerState.ts +1 -1
- package/src/version.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useEffect
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { LocalVoiceRecordingAttachment } from 'stream-chat';
|
|
4
4
|
|
|
@@ -12,14 +12,11 @@ import { resampleWaveformData } from '../utils/audioSampling';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The hook that controls all the async audio core features including start/stop or recording, player, upload/delete of the recorded audio.
|
|
15
|
-
*
|
|
16
|
-
* FIXME: Change the name to `useAudioRecorder` in the next major version as the hook will only be used for audio recording.
|
|
17
15
|
*/
|
|
18
16
|
export const useAudioRecorder = ({
|
|
19
17
|
audioRecorderManager,
|
|
20
18
|
sendMessage,
|
|
21
19
|
}: Pick<MessageInputContextValue, 'audioRecorderManager' | 'sendMessage'>) => {
|
|
22
|
-
const [isScheduledForSubmit, setIsScheduleForSubmit] = useState(false);
|
|
23
20
|
const { attachmentManager } = useMessageComposer();
|
|
24
21
|
|
|
25
22
|
/**
|
|
@@ -43,13 +40,6 @@ export const useAudioRecorder = ({
|
|
|
43
40
|
[stopVoiceRecording],
|
|
44
41
|
);
|
|
45
42
|
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (isScheduledForSubmit) {
|
|
48
|
-
sendMessage();
|
|
49
|
-
setIsScheduleForSubmit(false);
|
|
50
|
-
}
|
|
51
|
-
}, [isScheduledForSubmit, sendMessage]);
|
|
52
|
-
|
|
53
43
|
/**
|
|
54
44
|
* Function to start voice recording. Will return whether access is granted
|
|
55
45
|
* with regards to the microphone permission as that's how the underlying
|
|
@@ -113,8 +103,8 @@ export const useAudioRecorder = ({
|
|
|
113
103
|
audioRecorderManager.reset();
|
|
114
104
|
|
|
115
105
|
if (sendOnComplete) {
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
attachmentManager.upsertAttachments([audioFile]);
|
|
107
|
+
sendMessage();
|
|
118
108
|
} else {
|
|
119
109
|
await attachmentManager.uploadAttachment(audioFile);
|
|
120
110
|
}
|
|
@@ -122,7 +112,7 @@ export const useAudioRecorder = ({
|
|
|
122
112
|
console.log('Error uploading voice recording: ', error);
|
|
123
113
|
}
|
|
124
114
|
},
|
|
125
|
-
[audioRecorderManager, attachmentManager, stopVoiceRecording],
|
|
115
|
+
[audioRecorderManager, attachmentManager, sendMessage, stopVoiceRecording],
|
|
126
116
|
);
|
|
127
117
|
|
|
128
118
|
return {
|
|
@@ -5,9 +5,9 @@ import { Pressable } from 'react-native-gesture-handler';
|
|
|
5
5
|
import { emojis } from './emojis';
|
|
6
6
|
|
|
7
7
|
import { useHasOwnReaction } from './hooks/useHasOwnReaction';
|
|
8
|
-
import { toUnicodeScalarString } from './
|
|
8
|
+
import { toUnicodeScalarString } from './utils/toUnicodeScalarString';
|
|
9
9
|
|
|
10
|
-
import { useTheme } from '../../contexts';
|
|
10
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
11
11
|
import { useStableCallback } from '../../hooks';
|
|
12
12
|
import { primitives } from '../../theme';
|
|
13
13
|
import { StreamBottomSheetModalFlatList } from '../UIComponents';
|
|
@@ -133,14 +133,6 @@ export const EmojiViewerButton = ({
|
|
|
133
133
|
);
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
// TODO: V9: Move this to utils and also clean it up a bit.
|
|
137
|
-
// This was done quickly and in a bit of a hurry.
|
|
138
|
-
export const toUnicodeScalarString = (emoji: string): string => {
|
|
139
|
-
const out: number[] = [];
|
|
140
|
-
for (const ch of emoji) out.push(ch.codePointAt(0)!);
|
|
141
|
-
return out.map((cp) => `U+${cp.toString(16).toUpperCase().padStart(4, '0')}`).join('-');
|
|
142
|
-
};
|
|
143
|
-
|
|
144
136
|
/**
|
|
145
137
|
* MessageReactionPicker - A high level component which implements all the logic required for a message overlay reaction list
|
|
146
138
|
*/
|
|
@@ -291,6 +291,7 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
|
|
|
291
291
|
</Text>
|
|
292
292
|
<View style={[styles.reactionSelectorContainer, reactionSelectorContainer]}>
|
|
293
293
|
<FlatList
|
|
294
|
+
showsHorizontalScrollIndicator={false}
|
|
294
295
|
contentContainerStyle={[styles.contentContainer, contentContainer]}
|
|
295
296
|
data={selectorReactions}
|
|
296
297
|
getItemLayout={getItemLayout}
|
|
@@ -9,6 +9,7 @@ import { PollInputDialog } from './PollInputDialog';
|
|
|
9
9
|
import {
|
|
10
10
|
PollContextProvider,
|
|
11
11
|
PollContextValue,
|
|
12
|
+
useChatContext,
|
|
12
13
|
usePollContext,
|
|
13
14
|
useTheme,
|
|
14
15
|
useTranslationContext,
|
|
@@ -27,6 +28,8 @@ export const AnswerListAddCommentButton = (props: PollButtonProps) => {
|
|
|
27
28
|
const [showAddCommentDialog, setShowAddCommentDialog] = useState(false);
|
|
28
29
|
const { onPress } = props;
|
|
29
30
|
|
|
31
|
+
const styles = useStyles();
|
|
32
|
+
|
|
30
33
|
const onPressHandler = useCallback(() => {
|
|
31
34
|
if (onPress) {
|
|
32
35
|
onPress({ message, poll });
|
|
@@ -37,10 +40,10 @@ export const AnswerListAddCommentButton = (props: PollButtonProps) => {
|
|
|
37
40
|
}, [message, onPress, poll]);
|
|
38
41
|
|
|
39
42
|
return (
|
|
40
|
-
|
|
43
|
+
<View style={styles.inlineButton}>
|
|
41
44
|
<Button
|
|
42
45
|
variant={'secondary'}
|
|
43
|
-
type={'
|
|
46
|
+
type={'ghost'}
|
|
44
47
|
size={'lg'}
|
|
45
48
|
label={ownAnswer ? t('Update your comment') : t('Add a comment')}
|
|
46
49
|
onPress={onPressHandler}
|
|
@@ -54,7 +57,7 @@ export const AnswerListAddCommentButton = (props: PollButtonProps) => {
|
|
|
54
57
|
visible={showAddCommentDialog}
|
|
55
58
|
/>
|
|
56
59
|
) : null}
|
|
57
|
-
|
|
60
|
+
</View>
|
|
58
61
|
);
|
|
59
62
|
};
|
|
60
63
|
|
|
@@ -64,6 +67,7 @@ export type PollAnswersListProps = PollContextValue & {
|
|
|
64
67
|
};
|
|
65
68
|
|
|
66
69
|
export const PollAnswerListItem = ({ answer }: { answer: PollAnswer }) => {
|
|
70
|
+
const { client } = useChatContext();
|
|
67
71
|
const { t, tDateTimeParser } = useTranslationContext();
|
|
68
72
|
const { votingVisibility } = usePollState();
|
|
69
73
|
|
|
@@ -87,25 +91,32 @@ export const PollAnswerListItem = ({ answer }: { answer: PollAnswer }) => {
|
|
|
87
91
|
[answer.updated_at, t, tDateTimeParser],
|
|
88
92
|
);
|
|
89
93
|
|
|
94
|
+
const isMyAnswer = client.userID === answer.user?.id;
|
|
95
|
+
|
|
90
96
|
const isAnonymous = useMemo(
|
|
91
|
-
() => votingVisibility === VotingVisibility.anonymous,
|
|
92
|
-
[votingVisibility],
|
|
97
|
+
() => votingVisibility === VotingVisibility.anonymous && !isMyAnswer,
|
|
98
|
+
[votingVisibility, isMyAnswer],
|
|
93
99
|
);
|
|
94
100
|
|
|
101
|
+
const answerAuthorName = isMyAnswer ? t('You') : answer.user?.name;
|
|
102
|
+
|
|
95
103
|
return (
|
|
96
|
-
<View style={[styles.
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
<View style={[styles.
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
|
|
104
|
+
<View style={[styles.listItemWrapper, itemStyle.wrapper]}>
|
|
105
|
+
<View style={[styles.listItemContainer, itemStyle.container]}>
|
|
106
|
+
<Text style={[styles.listItemAnswerText, itemStyle.answerText]}>{answer.answer_text}</Text>
|
|
107
|
+
<View style={[styles.listItemInfoContainer, itemStyle.infoContainer]}>
|
|
108
|
+
<View style={[styles.listItemUserInfoContainer, itemStyle.userInfoContainer]}>
|
|
109
|
+
{!isAnonymous && answer.user?.image ? (
|
|
110
|
+
<UserAvatar user={answer.user} size='sm' showBorder />
|
|
111
|
+
) : null}
|
|
112
|
+
<Text style={styles.listItemInfoUserName}>
|
|
113
|
+
{isAnonymous ? t('Anonymous') : answerAuthorName}
|
|
114
|
+
</Text>
|
|
115
|
+
<Text style={styles.listItemInfoDate}>{dateString}</Text>
|
|
116
|
+
</View>
|
|
106
117
|
</View>
|
|
107
|
-
<Text style={styles.listItemInfoDate}>{dateString}</Text>
|
|
108
118
|
</View>
|
|
119
|
+
{isMyAnswer ? <AnswerListAddCommentButton /> : null}
|
|
109
120
|
</View>
|
|
110
121
|
);
|
|
111
122
|
};
|
|
@@ -137,7 +148,6 @@ export const PollAnswersListContent = ({
|
|
|
137
148
|
renderItem={renderPollAnswerListItem}
|
|
138
149
|
{...additionalFlatListProps}
|
|
139
150
|
/>
|
|
140
|
-
<AnswerListAddCommentButton />
|
|
141
151
|
</View>
|
|
142
152
|
);
|
|
143
153
|
};
|
|
@@ -164,14 +174,7 @@ const useStyles = () => {
|
|
|
164
174
|
return useMemo(
|
|
165
175
|
() =>
|
|
166
176
|
StyleSheet.create({
|
|
167
|
-
addCommentButtonContainer: {
|
|
168
|
-
alignItems: 'center',
|
|
169
|
-
borderRadius: 12,
|
|
170
|
-
paddingHorizontal: 16,
|
|
171
|
-
paddingVertical: 18,
|
|
172
|
-
},
|
|
173
177
|
contentContainer: { gap: primitives.spacingMd },
|
|
174
|
-
addCommentButtonText: { fontSize: 16 },
|
|
175
178
|
container: {
|
|
176
179
|
flex: 1,
|
|
177
180
|
padding: primitives.spacingMd,
|
|
@@ -179,31 +182,41 @@ const useStyles = () => {
|
|
|
179
182
|
},
|
|
180
183
|
listItemAnswerText: {
|
|
181
184
|
fontSize: primitives.typographyFontSizeMd,
|
|
182
|
-
lineHeight: primitives.
|
|
183
|
-
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
185
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
184
186
|
color: semantics.textPrimary,
|
|
185
187
|
},
|
|
186
|
-
|
|
188
|
+
listItemWrapper: {
|
|
187
189
|
borderRadius: primitives.radiusLg,
|
|
188
|
-
padding: primitives.spacingMd,
|
|
189
190
|
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
190
191
|
},
|
|
192
|
+
listItemContainer: {
|
|
193
|
+
padding: primitives.spacingMd,
|
|
194
|
+
gap: primitives.spacingXs,
|
|
195
|
+
},
|
|
191
196
|
listItemInfoContainer: {
|
|
192
197
|
flexDirection: 'row',
|
|
193
198
|
justifyContent: 'space-between',
|
|
194
199
|
alignItems: 'center',
|
|
195
|
-
marginTop: 24,
|
|
196
200
|
},
|
|
197
201
|
listItemInfoUserName: {
|
|
198
|
-
color: semantics.
|
|
202
|
+
color: semantics.chatTextUsername,
|
|
199
203
|
fontSize: primitives.typographyFontSizeSm,
|
|
200
|
-
|
|
204
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
205
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
201
206
|
},
|
|
202
207
|
listItemInfoDate: {
|
|
203
208
|
fontSize: primitives.typographyFontSizeSm,
|
|
204
209
|
color: semantics.textTertiary,
|
|
205
210
|
},
|
|
206
|
-
listItemUserInfoContainer: {
|
|
211
|
+
listItemUserInfoContainer: {
|
|
212
|
+
gap: primitives.spacingXs,
|
|
213
|
+
alignItems: 'center',
|
|
214
|
+
flexDirection: 'row',
|
|
215
|
+
},
|
|
216
|
+
inlineButton: {
|
|
217
|
+
borderColor: semantics.borderCoreDefault,
|
|
218
|
+
borderTopWidth: 1,
|
|
219
|
+
},
|
|
207
220
|
}),
|
|
208
221
|
[semantics],
|
|
209
222
|
);
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
useOwnCapabilitiesContext,
|
|
15
15
|
usePollContext,
|
|
16
16
|
useTheme,
|
|
17
|
+
useTranslationContext,
|
|
17
18
|
} from '../../../contexts';
|
|
18
19
|
|
|
19
20
|
import { Check } from '../../../icons';
|
|
@@ -26,6 +27,7 @@ import { usePollState } from '../hooks/usePollState';
|
|
|
26
27
|
export type PollOptionProps = {
|
|
27
28
|
option: PollOptionClass;
|
|
28
29
|
showProgressBar?: boolean;
|
|
30
|
+
forceIncoming?: boolean;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export type PollAllOptionsContentProps = PollContextValue & {
|
|
@@ -36,6 +38,7 @@ export type PollAllOptionsContentProps = PollContextValue & {
|
|
|
36
38
|
export const PollAllOptionsContent = ({
|
|
37
39
|
additionalScrollViewProps,
|
|
38
40
|
}: Pick<PollAllOptionsContentProps, 'additionalScrollViewProps'>) => {
|
|
41
|
+
const { t } = useTranslationContext();
|
|
39
42
|
const { name, options } = usePollState();
|
|
40
43
|
|
|
41
44
|
const {
|
|
@@ -50,12 +53,13 @@ export const PollAllOptionsContent = ({
|
|
|
50
53
|
return (
|
|
51
54
|
<ScrollView style={[styles.allOptionsWrapper, wrapper]} {...additionalScrollViewProps}>
|
|
52
55
|
<View style={[styles.allOptionsTitleContainer, titleContainer]}>
|
|
56
|
+
<Text style={styles.allOptionsTitleMeta}>{t('Question')}</Text>
|
|
53
57
|
<Text style={[styles.allOptionsTitleText, titleText]}>{name}</Text>
|
|
54
58
|
</View>
|
|
55
59
|
<View style={[styles.allOptionsListContainer, listContainer]}>
|
|
56
60
|
{options?.map((option: PollOptionClass) => (
|
|
57
61
|
<View key={`full_poll_options_${option.id}`} style={styles.optionWrapper}>
|
|
58
|
-
<PollOption key={option.id} option={option}
|
|
62
|
+
<PollOption key={option.id} option={option} forceIncoming />
|
|
59
63
|
</View>
|
|
60
64
|
))}
|
|
61
65
|
</View>
|
|
@@ -78,19 +82,15 @@ export const PollAllOptions = ({
|
|
|
78
82
|
</PollContextProvider>
|
|
79
83
|
);
|
|
80
84
|
|
|
81
|
-
export const PollOption = ({ option, showProgressBar = true }: PollOptionProps) => {
|
|
82
|
-
const { latestVotesByOption,
|
|
85
|
+
export const PollOption = ({ option, showProgressBar = true, forceIncoming }: PollOptionProps) => {
|
|
86
|
+
const { latestVotesByOption, voteCountsByOption, voteCount } = usePollState();
|
|
83
87
|
const styles = useStyles();
|
|
84
88
|
|
|
85
89
|
const relevantVotes = useMemo(
|
|
86
90
|
() => latestVotesByOption?.[option.id] || [],
|
|
87
91
|
[latestVotesByOption, option.id],
|
|
88
92
|
);
|
|
89
|
-
|
|
90
|
-
() =>
|
|
91
|
-
maxVotedOptionIds?.[0] && voteCountsByOption ? voteCountsByOption[maxVotedOptionIds[0]] : 0,
|
|
92
|
-
[maxVotedOptionIds, voteCountsByOption],
|
|
93
|
-
);
|
|
93
|
+
|
|
94
94
|
const votes = voteCountsByOption[option.id] || 0;
|
|
95
95
|
|
|
96
96
|
const {
|
|
@@ -105,13 +105,15 @@ export const PollOption = ({ option, showProgressBar = true }: PollOptionProps)
|
|
|
105
105
|
} = useTheme();
|
|
106
106
|
const isPollCreatedByClient = useIsPollCreatedByCurrentUser();
|
|
107
107
|
|
|
108
|
-
const unFilledColor =
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
const unFilledColor =
|
|
109
|
+
isPollCreatedByClient && !forceIncoming
|
|
110
|
+
? semantics.chatPollProgressTrackOutgoing
|
|
111
|
+
: semantics.chatPollProgressTrackIncoming;
|
|
111
112
|
|
|
112
|
-
const filledColor =
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const filledColor =
|
|
114
|
+
isPollCreatedByClient && !forceIncoming
|
|
115
|
+
? semantics.chatPollProgressFillOutgoing
|
|
116
|
+
: semantics.chatPollProgressFillIncoming;
|
|
115
117
|
|
|
116
118
|
return (
|
|
117
119
|
<View style={[styles.container, container]}>
|
|
@@ -133,7 +135,7 @@ export const PollOption = ({ option, showProgressBar = true }: PollOptionProps)
|
|
|
133
135
|
{showProgressBar ? (
|
|
134
136
|
<View style={styles.progressBarContainer}>
|
|
135
137
|
<ProgressBar
|
|
136
|
-
progress={votes /
|
|
138
|
+
progress={votes / voteCount}
|
|
137
139
|
filledColor={filledColor}
|
|
138
140
|
emptyColor={unFilledColor}
|
|
139
141
|
/>
|
|
@@ -273,6 +275,13 @@ const useAllOptionStyles = () => {
|
|
|
273
275
|
lineHeight: primitives.typographyLineHeightRelaxed,
|
|
274
276
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
275
277
|
color: semantics.textPrimary,
|
|
278
|
+
paddingTop: primitives.spacingXs,
|
|
279
|
+
},
|
|
280
|
+
allOptionsTitleMeta: {
|
|
281
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
282
|
+
color: semantics.textTertiary,
|
|
283
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
284
|
+
fontWeight: primitives.typographyFontWeightMedium,
|
|
276
285
|
},
|
|
277
286
|
allOptionsWrapper: {
|
|
278
287
|
flex: 1,
|
|
@@ -112,7 +112,9 @@ const useStyles = () => {
|
|
|
112
112
|
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
113
113
|
borderRadius: primitives.radiusLg,
|
|
114
114
|
marginBottom: primitives.spacingMd,
|
|
115
|
-
|
|
115
|
+
paddingHorizontal: primitives.spacingMd,
|
|
116
|
+
paddingTop: primitives.spacingMd,
|
|
117
|
+
paddingBottom: primitives.spacingXs,
|
|
116
118
|
},
|
|
117
119
|
headerContainer: {
|
|
118
120
|
flexDirection: 'row',
|
|
@@ -133,6 +135,7 @@ const useStyles = () => {
|
|
|
133
135
|
lineHeight: primitives.typographyLineHeightNormal,
|
|
134
136
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
135
137
|
color: semantics.textPrimary,
|
|
138
|
+
paddingTop: primitives.spacingXs,
|
|
136
139
|
marginLeft: primitives.spacingMd,
|
|
137
140
|
},
|
|
138
141
|
}),
|
|
@@ -57,7 +57,9 @@ export const ShowAllVotesButton = (props: ShowAllVotesButtonProps) => {
|
|
|
57
57
|
{ownCapabilities.queryPollVotes &&
|
|
58
58
|
voteCountsByOption &&
|
|
59
59
|
voteCountsByOption?.[option.id] > 5 ? (
|
|
60
|
-
<
|
|
60
|
+
<View style={styles.inlineButton}>
|
|
61
|
+
<GenericPollButton onPress={onPressHandler} label={t('Show All')} />
|
|
62
|
+
</View>
|
|
61
63
|
) : null}
|
|
62
64
|
{showAllVotes ? (
|
|
63
65
|
<Modal
|
|
@@ -103,18 +105,24 @@ export const PollResultsItem = ({ option, index }: PollResultItemProps) => {
|
|
|
103
105
|
|
|
104
106
|
return (
|
|
105
107
|
<View style={[styles.container, container]}>
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<View style={[styles.headerContainer, headerContainer]}>
|
|
110
|
-
<Text style={[styles.title, title]}>{option.text}</Text>
|
|
111
|
-
<Text style={[styles.voteCount, voteCount]}>
|
|
112
|
-
{t('{{count}} votes', { count: voteCountsByOption[option.id] ?? 0 })}
|
|
108
|
+
<View style={styles.metaContainer}>
|
|
109
|
+
<Text style={[styles.titleMeta, titleMeta]}>
|
|
110
|
+
{t('Option {{count}}', { count: index + 1 })}
|
|
113
111
|
</Text>
|
|
112
|
+
<View style={[styles.headerContainer, headerContainer]}>
|
|
113
|
+
<Text style={[styles.title, title]}>{option.text}</Text>
|
|
114
|
+
<Text style={[styles.voteCount, voteCount]}>
|
|
115
|
+
{t('{{count}} votes', { count: voteCountsByOption[option.id] ?? 0 })}
|
|
116
|
+
</Text>
|
|
117
|
+
</View>
|
|
114
118
|
</View>
|
|
115
|
-
{latestVotesByOption?.[option.id]?.length > 0
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
{latestVotesByOption?.[option.id]?.length > 0 ? (
|
|
120
|
+
<View style={styles.votesContainer}>
|
|
121
|
+
{(latestVotesByOption?.[option.id] ?? []).slice(0, 5).map(PollResultsVoteItem)}
|
|
122
|
+
</View>
|
|
123
|
+
) : (
|
|
124
|
+
<View style={styles.spacer} />
|
|
125
|
+
)}
|
|
118
126
|
<ShowAllVotesButton option={option} />
|
|
119
127
|
</View>
|
|
120
128
|
);
|
|
@@ -127,11 +135,21 @@ const useStyles = () => {
|
|
|
127
135
|
return useMemo(
|
|
128
136
|
() =>
|
|
129
137
|
StyleSheet.create({
|
|
138
|
+
spacer: {
|
|
139
|
+
paddingBottom: primitives.spacingXs,
|
|
140
|
+
},
|
|
130
141
|
container: {
|
|
131
142
|
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
132
143
|
borderRadius: primitives.radiusLg,
|
|
133
144
|
marginBottom: primitives.spacingMd,
|
|
134
|
-
|
|
145
|
+
},
|
|
146
|
+
metaContainer: {
|
|
147
|
+
paddingTop: primitives.spacingMd,
|
|
148
|
+
paddingHorizontal: primitives.spacingMd,
|
|
149
|
+
},
|
|
150
|
+
votesContainer: {
|
|
151
|
+
paddingHorizontal: primitives.spacingMd,
|
|
152
|
+
paddingVertical: primitives.spacingXs,
|
|
135
153
|
},
|
|
136
154
|
headerContainer: {
|
|
137
155
|
flexDirection: 'row',
|
|
@@ -167,6 +185,12 @@ const useStyles = () => {
|
|
|
167
185
|
backgroundColor: semantics.backgroundCoreElevation1,
|
|
168
186
|
flex: 1,
|
|
169
187
|
},
|
|
188
|
+
inlineButton: {
|
|
189
|
+
borderColor: semantics.borderCoreDefault,
|
|
190
|
+
borderTopWidth: 1,
|
|
191
|
+
paddingHorizontal: primitives.spacingMd,
|
|
192
|
+
paddingVertical: primitives.spacingXs,
|
|
193
|
+
},
|
|
170
194
|
}),
|
|
171
195
|
[semantics],
|
|
172
196
|
);
|
|
@@ -32,6 +32,7 @@ export type UsePollStateSelectorReturnType = {
|
|
|
32
32
|
ownVotesByOptionId: Record<string, PollVote>;
|
|
33
33
|
voteCountsByOption: Record<string, number>;
|
|
34
34
|
votingVisibility: VotingVisibility | undefined;
|
|
35
|
+
voteCount: number;
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export type UsePollStateReturnType = UsePollStateSelectorReturnType & {
|
|
@@ -56,6 +57,7 @@ const selector = (nextValue: PollState): UsePollStateSelectorReturnType => ({
|
|
|
56
57
|
ownVotesByOptionId: nextValue.ownVotesByOptionId,
|
|
57
58
|
voteCountsByOption: nextValue.vote_counts_by_option,
|
|
58
59
|
votingVisibility: nextValue.voting_visibility,
|
|
60
|
+
voteCount: nextValue.vote_count,
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
export const usePollState = (): UsePollStateReturnType => {
|
|
@@ -76,6 +78,7 @@ export const usePollState = (): UsePollStateReturnType => {
|
|
|
76
78
|
ownVotesByOptionId,
|
|
77
79
|
voteCountsByOption,
|
|
78
80
|
votingVisibility,
|
|
81
|
+
voteCount,
|
|
79
82
|
} = usePollStateStore(selector);
|
|
80
83
|
|
|
81
84
|
const addOption = useCallback(
|
|
@@ -109,5 +112,6 @@ export const usePollState = (): UsePollStateReturnType => {
|
|
|
109
112
|
ownVotesByOptionId,
|
|
110
113
|
voteCountsByOption,
|
|
111
114
|
votingVisibility,
|
|
115
|
+
voteCount,
|
|
112
116
|
};
|
|
113
117
|
};
|
|
@@ -620,6 +620,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
620
620
|
"flexDirection": "row",
|
|
621
621
|
"gap": 8,
|
|
622
622
|
"justifyContent": "center",
|
|
623
|
+
"maxWidth": "100%",
|
|
623
624
|
"paddingVertical": 4,
|
|
624
625
|
},
|
|
625
626
|
{},
|
|
@@ -627,6 +628,18 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
627
628
|
}
|
|
628
629
|
testID="message-status-time"
|
|
629
630
|
>
|
|
631
|
+
<Text
|
|
632
|
+
style={
|
|
633
|
+
{
|
|
634
|
+
"color": "#687385",
|
|
635
|
+
"fontSize": 13,
|
|
636
|
+
"fontWeight": 400,
|
|
637
|
+
"lineHeight": 16,
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
>
|
|
641
|
+
2:50 PM
|
|
642
|
+
</Text>
|
|
630
643
|
<Text
|
|
631
644
|
style={
|
|
632
645
|
[
|
|
@@ -944,6 +957,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
944
957
|
"flexDirection": "row",
|
|
945
958
|
"gap": 8,
|
|
946
959
|
"justifyContent": "center",
|
|
960
|
+
"maxWidth": "100%",
|
|
947
961
|
"paddingVertical": 4,
|
|
948
962
|
},
|
|
949
963
|
{},
|
|
@@ -951,6 +965,18 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
951
965
|
}
|
|
952
966
|
testID="message-status-time"
|
|
953
967
|
>
|
|
968
|
+
<Text
|
|
969
|
+
style={
|
|
970
|
+
{
|
|
971
|
+
"color": "#687385",
|
|
972
|
+
"fontSize": 13,
|
|
973
|
+
"fontWeight": 400,
|
|
974
|
+
"lineHeight": 16,
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
>
|
|
978
|
+
2:50 PM
|
|
979
|
+
</Text>
|
|
954
980
|
<Text
|
|
955
981
|
style={
|
|
956
982
|
[
|
|
@@ -1301,6 +1327,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1301
1327
|
"flexDirection": "row",
|
|
1302
1328
|
"gap": 8,
|
|
1303
1329
|
"justifyContent": "center",
|
|
1330
|
+
"maxWidth": "100%",
|
|
1304
1331
|
"paddingVertical": 4,
|
|
1305
1332
|
},
|
|
1306
1333
|
{},
|
|
@@ -1308,6 +1335,18 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1308
1335
|
}
|
|
1309
1336
|
testID="message-status-time"
|
|
1310
1337
|
>
|
|
1338
|
+
<Text
|
|
1339
|
+
style={
|
|
1340
|
+
{
|
|
1341
|
+
"color": "#687385",
|
|
1342
|
+
"fontSize": 13,
|
|
1343
|
+
"fontWeight": 400,
|
|
1344
|
+
"lineHeight": 16,
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
>
|
|
1348
|
+
2:50 PM
|
|
1349
|
+
</Text>
|
|
1311
1350
|
<Text
|
|
1312
1351
|
style={
|
|
1313
1352
|
[
|
|
@@ -1616,6 +1655,7 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1616
1655
|
"flexDirection": "row",
|
|
1617
1656
|
"gap": 8,
|
|
1618
1657
|
"justifyContent": "center",
|
|
1658
|
+
"maxWidth": "100%",
|
|
1619
1659
|
"paddingVertical": 4,
|
|
1620
1660
|
},
|
|
1621
1661
|
{},
|
|
@@ -1623,6 +1663,18 @@ exports[`Thread should match thread snapshot 1`] = `
|
|
|
1623
1663
|
}
|
|
1624
1664
|
testID="message-status-time"
|
|
1625
1665
|
>
|
|
1666
|
+
<Text
|
|
1667
|
+
style={
|
|
1668
|
+
{
|
|
1669
|
+
"color": "#687385",
|
|
1670
|
+
"fontSize": 13,
|
|
1671
|
+
"fontWeight": 400,
|
|
1672
|
+
"lineHeight": 16,
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
>
|
|
1676
|
+
2:50 PM
|
|
1677
|
+
</Text>
|
|
1626
1678
|
<Text
|
|
1627
1679
|
style={
|
|
1628
1680
|
[
|