stream-chat-react-native-core 9.0.0-beta.12 → 9.0.0-beta.14
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/AttachmentPicker/AttachmentPicker.js +12 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +30 -30
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +2 -0
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +3 -2
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js +6 -3
- package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js +17 -11
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +52 -10
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +10 -8
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js +8 -2
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js.map +1 -1
- package/lib/commonjs/components/Poll/CreatePollContent.js +11 -5
- package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -1
- package/lib/commonjs/components/Poll/Poll.js +4 -2
- package/lib/commonjs/components/Poll/Poll.js.map +1 -1
- package/lib/commonjs/components/Poll/components/CreatePollOptions.js +6 -3
- package/lib/commonjs/components/Poll/components/CreatePollOptions.js.map +1 -1
- package/lib/commonjs/components/Poll/components/MultipleAnswersField.js +7 -3
- package/lib/commonjs/components/Poll/components/MultipleAnswersField.js.map +1 -1
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js +9 -4
- package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +2 -2
- package/lib/commonjs/components/Poll/components/PollAnswersList.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/Poll/components/PollOption.js +12 -5
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +7 -5
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +6 -3
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js +8 -3
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollVote.js +4 -2
- package/lib/commonjs/components/Poll/components/PollResults/PollVote.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +7 -5
- package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js +6 -4
- package/lib/commonjs/components/ProgressControl/WaveProgressBar.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +14 -7
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Reply/ReplyMessageView.js +2 -1
- package/lib/commonjs/components/Reply/ReplyMessageView.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js +2 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/commonjs/components/UIComponents/SwipableWrapper.js +41 -12
- package/lib/commonjs/components/UIComponents/SwipableWrapper.js.map +1 -1
- package/lib/commonjs/components/ui/Input/Input.js +8 -4
- package/lib/commonjs/components/ui/Input/Input.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +1 -0
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +14 -6
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/middlewares/attachments.js +33 -1
- package/lib/commonjs/middlewares/attachments.js.map +1 -1
- package/lib/commonjs/utils/createGenerateVideoThumbnails.js +41 -0
- package/lib/commonjs/utils/createGenerateVideoThumbnails.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +12 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +30 -30
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +2 -0
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/Message/Message.js +3 -2
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageBubble.js +6 -3
- package/lib/module/components/Message/MessageItemView/MessageBubble.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageReplies.js +17 -11
- package/lib/module/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +52 -10
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +10 -8
- package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js +8 -2
- package/lib/module/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js.map +1 -1
- package/lib/module/components/Poll/CreatePollContent.js +11 -5
- package/lib/module/components/Poll/CreatePollContent.js.map +1 -1
- package/lib/module/components/Poll/Poll.js +4 -2
- package/lib/module/components/Poll/Poll.js.map +1 -1
- package/lib/module/components/Poll/components/CreatePollOptions.js +6 -3
- package/lib/module/components/Poll/components/CreatePollOptions.js.map +1 -1
- package/lib/module/components/Poll/components/MultipleAnswersField.js +7 -3
- package/lib/module/components/Poll/components/MultipleAnswersField.js.map +1 -1
- package/lib/module/components/Poll/components/MultipleVotesSettings.js +9 -4
- package/lib/module/components/Poll/components/MultipleVotesSettings.js.map +1 -1
- package/lib/module/components/Poll/components/PollAnswersList.js +2 -2
- package/lib/module/components/Poll/components/PollAnswersList.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/Poll/components/PollOption.js +12 -5
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +7 -5
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js +6 -3
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResults.js +8 -3
- package/lib/module/components/Poll/components/PollResults/PollResults.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollVote.js +4 -2
- package/lib/module/components/Poll/components/PollResults/PollVote.js.map +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +7 -5
- package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
- package/lib/module/components/ProgressControl/WaveProgressBar.js +6 -4
- package/lib/module/components/ProgressControl/WaveProgressBar.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +14 -7
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Reply/ReplyMessageView.js +2 -1
- package/lib/module/components/Reply/ReplyMessageView.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js +2 -1
- package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/module/components/UIComponents/SwipableWrapper.js +41 -12
- package/lib/module/components/UIComponents/SwipableWrapper.js.map +1 -1
- package/lib/module/components/ui/Input/Input.js +8 -4
- package/lib/module/components/ui/Input/Input.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +1 -0
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +14 -6
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/middlewares/attachments.js +33 -1
- package/lib/module/middlewares/attachments.js.map +1 -1
- package/lib/module/utils/createGenerateVideoThumbnails.js +41 -0
- package/lib/module/utils/createGenerateVideoThumbnails.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/CreatePollOptions.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollInputDialog.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts.map +1 -1
- package/lib/typescript/components/ProgressControl/ProgressControl.d.ts.map +1 -1
- 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/SwipableWrapper.d.ts +4 -1
- package/lib/typescript/components/UIComponents/SwipableWrapper.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/middlewares/attachments.d.ts +1 -0
- package/lib/typescript/middlewares/attachments.d.ts.map +1 -1
- package/lib/typescript/utils/createGenerateVideoThumbnails.d.ts +8 -0
- package/lib/typescript/utils/createGenerateVideoThumbnails.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +14 -0
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +32 -34
- package/src/components/ImageGallery/ImageGallery.tsx +5 -1
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +33 -0
- package/src/components/Message/Message.tsx +15 -3
- package/src/components/Message/MessageItemView/MessageBubble.tsx +15 -4
- package/src/components/Message/MessageItemView/MessageReplies.tsx +24 -12
- package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +62 -11
- package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx +10 -9
- package/src/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.tsx +12 -2
- package/src/components/Poll/CreatePollContent.tsx +10 -2
- package/src/components/Poll/Poll.tsx +2 -0
- package/src/components/Poll/components/CreatePollOptions.tsx +12 -1
- package/src/components/Poll/components/MultipleAnswersField.tsx +4 -0
- package/src/components/Poll/components/MultipleVotesSettings.tsx +6 -1
- package/src/components/Poll/components/PollAnswersList.tsx +1 -2
- package/src/components/Poll/components/PollInputDialog.tsx +2 -0
- package/src/components/Poll/components/PollOption.tsx +47 -39
- package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +41 -37
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +63 -62
- package/src/components/Poll/components/PollResults/PollResults.tsx +39 -33
- package/src/components/Poll/components/PollResults/PollVote.tsx +27 -27
- package/src/components/ProgressControl/ProgressControl.tsx +8 -6
- package/src/components/ProgressControl/WaveProgressBar.tsx +9 -7
- package/src/components/Reply/Reply.tsx +19 -7
- package/src/components/Reply/ReplyMessageView.tsx +1 -0
- package/src/components/ThreadList/ThreadListItem.tsx +1 -0
- package/src/components/UIComponents/SwipableWrapper.tsx +54 -16
- package/src/components/UIComponents/__tests__/SwipableWrapper.test.tsx +98 -0
- package/src/components/ui/Input/Input.tsx +4 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +3 -0
- package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +14 -3
- package/src/index.ts +1 -0
- package/src/middlewares/attachments.ts +34 -0
- package/src/utils/createGenerateVideoThumbnails.ts +45 -0
- package/src/version.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { Platform, StyleSheet, Switch, Text, TextInput, View } from 'react-native';
|
|
2
|
+
import { I18nManager, Platform, StyleSheet, Switch, Text, TextInput, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import Animated, { LinearTransition, StretchInY, StretchOutY } from 'react-native-reanimated';
|
|
5
5
|
|
|
@@ -200,15 +200,19 @@ const useStyles = () => {
|
|
|
200
200
|
fontSize: primitives.typographyFontSizeMd,
|
|
201
201
|
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
202
202
|
lineHeight: primitives.typographyLineHeightNormal,
|
|
203
|
+
textAlign: 'left',
|
|
203
204
|
},
|
|
204
205
|
description: {
|
|
205
206
|
color: semantics.textTertiary,
|
|
206
207
|
fontSize: primitives.typographyFontSizeSm,
|
|
207
208
|
fontWeight: primitives.typographyFontWeightRegular,
|
|
208
209
|
lineHeight: primitives.typographyLineHeightNormal,
|
|
210
|
+
textAlign: 'left',
|
|
209
211
|
},
|
|
210
212
|
optionCardContent: {
|
|
211
213
|
gap: primitives.spacingXxs,
|
|
214
|
+
flex: 1,
|
|
215
|
+
alignItems: 'flex-start',
|
|
212
216
|
},
|
|
213
217
|
optionCard: {
|
|
214
218
|
alignItems: 'center',
|
|
@@ -229,6 +233,7 @@ const useStyles = () => {
|
|
|
229
233
|
fontSize: primitives.typographyFontSizeMd,
|
|
230
234
|
paddingHorizontal: primitives.spacingSm,
|
|
231
235
|
paddingVertical: primitives.spacingMd,
|
|
236
|
+
textAlign: I18nManager.isRTL ? 'right' : 'left',
|
|
232
237
|
},
|
|
233
238
|
});
|
|
234
239
|
}, [semantics]);
|
|
@@ -175,10 +175,9 @@ const useStyles = () => {
|
|
|
175
175
|
return useMemo(
|
|
176
176
|
() =>
|
|
177
177
|
StyleSheet.create({
|
|
178
|
-
contentContainer: { gap: primitives.spacingMd },
|
|
178
|
+
contentContainer: { gap: primitives.spacingMd, padding: primitives.spacingMd },
|
|
179
179
|
container: {
|
|
180
180
|
flex: 1,
|
|
181
|
-
padding: primitives.spacingMd,
|
|
182
181
|
backgroundColor: semantics.backgroundCoreElevation1,
|
|
183
182
|
},
|
|
184
183
|
listItemAnswerText: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
I18nManager,
|
|
3
4
|
KeyboardAvoidingView,
|
|
4
5
|
Modal,
|
|
5
6
|
Platform,
|
|
@@ -136,6 +137,7 @@ const useStyles = () => {
|
|
|
136
137
|
fontSize: primitives.typographyFontSizeMd,
|
|
137
138
|
padding: primitives.spacingSm,
|
|
138
139
|
color: semantics.textPrimary,
|
|
140
|
+
textAlign: I18nManager.isRTL ? 'right' : 'left',
|
|
139
141
|
},
|
|
140
142
|
title: {
|
|
141
143
|
color: semantics.textPrimary,
|
|
@@ -51,7 +51,11 @@ export const PollAllOptionsContent = ({
|
|
|
51
51
|
const styles = useAllOptionStyles();
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
|
-
<ScrollView
|
|
54
|
+
<ScrollView
|
|
55
|
+
contentContainerStyle={styles.allOptionsContentContainer}
|
|
56
|
+
style={[styles.allOptionsWrapper, wrapper]}
|
|
57
|
+
{...additionalScrollViewProps}
|
|
58
|
+
>
|
|
55
59
|
<View style={[styles.allOptionsTitleContainer, titleContainer]}>
|
|
56
60
|
<Text style={styles.allOptionsTitleMeta}>{t('Question')}</Text>
|
|
57
61
|
<Text style={[styles.allOptionsTitleText, titleText]}>{name}</Text>
|
|
@@ -226,6 +230,7 @@ const useStyles = () => {
|
|
|
226
230
|
fontSize: primitives.typographyFontSizeSm,
|
|
227
231
|
fontWeight: primitives.typographyFontWeightRegular,
|
|
228
232
|
lineHeight: primitives.typographyLineHeightTight,
|
|
233
|
+
textAlign: 'left',
|
|
229
234
|
},
|
|
230
235
|
info: {
|
|
231
236
|
flexGrow: 1,
|
|
@@ -237,6 +242,7 @@ const useStyles = () => {
|
|
|
237
242
|
fontSize: primitives.typographyFontSizeXs,
|
|
238
243
|
fontWeight: primitives.typographyFontWeightRegular,
|
|
239
244
|
lineHeight: primitives.typographyLineHeightTight,
|
|
245
|
+
textAlign: 'left',
|
|
240
246
|
},
|
|
241
247
|
progressBarContainer: {
|
|
242
248
|
flex: 1,
|
|
@@ -256,42 +262,44 @@ const useAllOptionStyles = () => {
|
|
|
256
262
|
const {
|
|
257
263
|
theme: { semantics },
|
|
258
264
|
} = useTheme();
|
|
259
|
-
return useMemo(
|
|
260
|
-
(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
265
|
+
return useMemo(() => {
|
|
266
|
+
return StyleSheet.create({
|
|
267
|
+
allOptionsContentContainer: {
|
|
268
|
+
padding: primitives.spacingMd,
|
|
269
|
+
},
|
|
270
|
+
allOptionsListContainer: {
|
|
271
|
+
borderRadius: primitives.radiusLg,
|
|
272
|
+
padding: primitives.spacingMd,
|
|
273
|
+
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
274
|
+
marginTop: primitives.spacing2xl,
|
|
275
|
+
},
|
|
276
|
+
allOptionsTitleContainer: {
|
|
277
|
+
borderRadius: primitives.radiusLg,
|
|
278
|
+
padding: primitives.spacingMd,
|
|
279
|
+
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
280
|
+
},
|
|
281
|
+
allOptionsTitleText: {
|
|
282
|
+
fontSize: primitives.typographyFontSizeLg,
|
|
283
|
+
lineHeight: primitives.typographyLineHeightRelaxed,
|
|
284
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
285
|
+
color: semantics.textPrimary,
|
|
286
|
+
paddingTop: primitives.spacingXs,
|
|
287
|
+
textAlign: 'left',
|
|
288
|
+
},
|
|
289
|
+
allOptionsTitleMeta: {
|
|
290
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
291
|
+
color: semantics.textTertiary,
|
|
292
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
293
|
+
fontWeight: primitives.typographyFontWeightMedium,
|
|
294
|
+
textAlign: 'left',
|
|
295
|
+
},
|
|
296
|
+
allOptionsWrapper: {
|
|
297
|
+
flex: 1,
|
|
298
|
+
backgroundColor: semantics.backgroundCoreElevation1,
|
|
299
|
+
},
|
|
300
|
+
optionWrapper: {
|
|
301
|
+
paddingVertical: primitives.spacingMd,
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
}, [semantics]);
|
|
297
305
|
};
|
|
@@ -104,41 +104,45 @@ const useStyles = () => {
|
|
|
104
104
|
const {
|
|
105
105
|
theme: { semantics },
|
|
106
106
|
} = useTheme();
|
|
107
|
-
return useMemo(
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
107
|
+
return useMemo(() => {
|
|
108
|
+
return StyleSheet.create({
|
|
109
|
+
container: { flex: 1, backgroundColor: semantics.backgroundCoreElevation1 },
|
|
110
|
+
contentContainer: {
|
|
111
|
+
margin: primitives.spacingMd,
|
|
112
|
+
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
113
|
+
borderRadius: primitives.radiusLg,
|
|
114
|
+
paddingHorizontal: primitives.spacingMd,
|
|
115
|
+
paddingTop: primitives.spacingMd,
|
|
116
|
+
paddingBottom: primitives.spacingXs,
|
|
117
|
+
},
|
|
118
|
+
headerContainer: {
|
|
119
|
+
flexDirection: 'row',
|
|
120
|
+
justifyContent: 'space-between',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
paddingBottom: primitives.spacingXs,
|
|
123
|
+
},
|
|
124
|
+
headerTitle: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
fontSize: primitives.typographyFontSizeLg,
|
|
127
|
+
lineHeight: primitives.typographyLineHeightRelaxed,
|
|
128
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
129
|
+
color: semantics.textPrimary,
|
|
130
|
+
paddingTop: primitives.spacingXs,
|
|
131
|
+
textAlign: 'left',
|
|
132
|
+
},
|
|
133
|
+
headerText: {
|
|
134
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
135
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
136
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
137
|
+
color: semantics.textPrimary,
|
|
138
|
+
paddingTop: primitives.spacingXs,
|
|
139
|
+
marginStart: primitives.spacingMd,
|
|
140
|
+
textAlign: 'left',
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}, [
|
|
144
|
+
semantics.backgroundCoreElevation1,
|
|
145
|
+
semantics.backgroundCoreSurfaceCard,
|
|
146
|
+
semantics.textPrimary,
|
|
147
|
+
]);
|
|
144
148
|
};
|
|
@@ -132,66 +132,67 @@ const useStyles = () => {
|
|
|
132
132
|
const {
|
|
133
133
|
theme: { semantics },
|
|
134
134
|
} = useTheme();
|
|
135
|
-
return useMemo(
|
|
136
|
-
(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
135
|
+
return useMemo(() => {
|
|
136
|
+
return StyleSheet.create({
|
|
137
|
+
spacer: {
|
|
138
|
+
paddingBottom: primitives.spacingXs,
|
|
139
|
+
},
|
|
140
|
+
container: {
|
|
141
|
+
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
142
|
+
borderRadius: primitives.radiusLg,
|
|
143
|
+
marginBottom: primitives.spacingMd,
|
|
144
|
+
},
|
|
145
|
+
metaContainer: {
|
|
146
|
+
paddingTop: primitives.spacingMd,
|
|
147
|
+
paddingHorizontal: primitives.spacingMd,
|
|
148
|
+
},
|
|
149
|
+
votesContainer: {
|
|
150
|
+
paddingHorizontal: primitives.spacingMd,
|
|
151
|
+
paddingVertical: primitives.spacingXs,
|
|
152
|
+
},
|
|
153
|
+
headerContainer: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
justifyContent: 'space-between',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
paddingBottom: primitives.spacingXs,
|
|
158
|
+
},
|
|
159
|
+
modalRoot: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
},
|
|
162
|
+
title: {
|
|
163
|
+
flex: 1,
|
|
164
|
+
fontSize: primitives.typographyFontSizeLg,
|
|
165
|
+
lineHeight: primitives.typographyLineHeightRelaxed,
|
|
166
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
167
|
+
color: semantics.textPrimary,
|
|
168
|
+
paddingTop: primitives.spacingXs,
|
|
169
|
+
textAlign: 'left',
|
|
170
|
+
},
|
|
171
|
+
titleMeta: {
|
|
172
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
173
|
+
color: semantics.textTertiary,
|
|
174
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
175
|
+
fontWeight: primitives.typographyFontWeightMedium,
|
|
176
|
+
textAlign: 'left',
|
|
177
|
+
},
|
|
178
|
+
voteCount: {
|
|
179
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
180
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
181
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
182
|
+
color: semantics.textPrimary,
|
|
183
|
+
marginStart: primitives.spacingMd,
|
|
184
|
+
textAlign: 'left',
|
|
185
|
+
},
|
|
186
|
+
safeArea: {
|
|
187
|
+
backgroundColor: semantics.backgroundCoreElevation1,
|
|
188
|
+
flex: 1,
|
|
189
|
+
},
|
|
190
|
+
inlineButton: {
|
|
191
|
+
borderColor: semantics.borderCoreDefault,
|
|
192
|
+
borderTopWidth: 1,
|
|
193
|
+
paddingHorizontal: primitives.spacingMd,
|
|
194
|
+
paddingVertical: primitives.spacingXs,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}, [semantics]);
|
|
197
198
|
};
|
|
@@ -44,7 +44,11 @@ export const PollResultsContent = ({
|
|
|
44
44
|
const styles = useStyles();
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<ScrollView
|
|
47
|
+
<ScrollView
|
|
48
|
+
contentContainerStyle={styles.contentContainer}
|
|
49
|
+
style={[styles.scrollView, scrollView]}
|
|
50
|
+
{...additionalScrollViewProps}
|
|
51
|
+
>
|
|
48
52
|
<View style={[styles.container, container]}>
|
|
49
53
|
<Text style={[styles.titleMeta, titleMeta]}>{t('Question')}</Text>
|
|
50
54
|
<Text style={[styles.title, title]}>{name}</Text>
|
|
@@ -77,36 +81,38 @@ const useStyles = () => {
|
|
|
77
81
|
const {
|
|
78
82
|
theme: { semantics },
|
|
79
83
|
} = useTheme();
|
|
80
|
-
return useMemo(
|
|
81
|
-
(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
84
|
+
return useMemo(() => {
|
|
85
|
+
return StyleSheet.create({
|
|
86
|
+
contentContainer: {
|
|
87
|
+
padding: primitives.spacingMd,
|
|
88
|
+
},
|
|
89
|
+
container: {
|
|
90
|
+
borderRadius: primitives.radiusLg,
|
|
91
|
+
padding: primitives.spacingMd,
|
|
92
|
+
backgroundColor: semantics.backgroundCoreSurfaceCard,
|
|
93
|
+
},
|
|
94
|
+
scrollView: {
|
|
95
|
+
flex: 1,
|
|
96
|
+
backgroundColor: semantics.backgroundCoreElevation1,
|
|
97
|
+
},
|
|
98
|
+
resultsContainer: {
|
|
99
|
+
paddingVertical: primitives.spacing2xl,
|
|
100
|
+
},
|
|
101
|
+
title: {
|
|
102
|
+
fontSize: primitives.typographyFontSizeLg,
|
|
103
|
+
lineHeight: primitives.typographyLineHeightRelaxed,
|
|
104
|
+
fontWeight: primitives.typographyFontWeightSemiBold,
|
|
105
|
+
color: semantics.textPrimary,
|
|
106
|
+
paddingTop: primitives.spacingXs,
|
|
107
|
+
textAlign: 'left',
|
|
108
|
+
},
|
|
109
|
+
titleMeta: {
|
|
110
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
111
|
+
color: semantics.textTertiary,
|
|
112
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
113
|
+
fontWeight: primitives.typographyFontWeightMedium,
|
|
114
|
+
textAlign: 'left',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}, [semantics]);
|
|
112
118
|
};
|
|
@@ -58,31 +58,31 @@ const useStyles = () => {
|
|
|
58
58
|
const {
|
|
59
59
|
theme: { semantics },
|
|
60
60
|
} = useTheme();
|
|
61
|
-
return useMemo(
|
|
62
|
-
(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
);
|
|
61
|
+
return useMemo(() => {
|
|
62
|
+
return StyleSheet.create({
|
|
63
|
+
voteContainer: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
paddingVertical: primitives.spacingXs,
|
|
68
|
+
},
|
|
69
|
+
voteDate: {
|
|
70
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
71
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
72
|
+
color: semantics.textTertiary,
|
|
73
|
+
textAlign: 'left',
|
|
74
|
+
},
|
|
75
|
+
voteUserName: {
|
|
76
|
+
fontSize: primitives.typographyFontSizeMd,
|
|
77
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
78
|
+
color: semantics.textPrimary,
|
|
79
|
+
paddingStart: primitives.spacingXs,
|
|
80
|
+
textAlign: 'left',
|
|
81
|
+
},
|
|
82
|
+
userContainer: {
|
|
83
|
+
flexDirection: 'row',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}, [semantics]);
|
|
88
88
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { I18nManager, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
4
4
|
import Animated, {
|
|
5
5
|
interpolate,
|
|
@@ -47,6 +47,8 @@ export const ProgressControl = (props: ProgressControlProps) => {
|
|
|
47
47
|
const { isPlaying, onEndDrag, onStartDrag, progress, testID } = props;
|
|
48
48
|
const styles = useStyles();
|
|
49
49
|
const [widthInNumbers, setWidthInNumbers] = useState<number>(0);
|
|
50
|
+
const isRTL = I18nManager.isRTL;
|
|
51
|
+
const thumbDirectionMultiplier = isRTL ? -1 : 1;
|
|
50
52
|
|
|
51
53
|
const state = useSharedValue(progress);
|
|
52
54
|
const {
|
|
@@ -73,8 +75,8 @@ export const ProgressControl = (props: ProgressControlProps) => {
|
|
|
73
75
|
}
|
|
74
76
|
})
|
|
75
77
|
.onUpdate((event) => {
|
|
76
|
-
const
|
|
77
|
-
state.value =
|
|
78
|
+
const nextProgress = isRTL ? 1 - event.x / widthInNumbers : event.x / widthInNumbers;
|
|
79
|
+
state.value = Math.max(0, Math.min(nextProgress, 1));
|
|
78
80
|
})
|
|
79
81
|
.onEnd(() => {
|
|
80
82
|
if (onEndDrag) {
|
|
@@ -82,7 +84,7 @@ export const ProgressControl = (props: ProgressControlProps) => {
|
|
|
82
84
|
}
|
|
83
85
|
})
|
|
84
86
|
.withTestId(testID),
|
|
85
|
-
[onEndDrag, onStartDrag, state, testID, widthInNumbers],
|
|
87
|
+
[isRTL, onEndDrag, onStartDrag, state, testID, widthInNumbers],
|
|
86
88
|
);
|
|
87
89
|
|
|
88
90
|
const thumbStyles = useAnimatedStyle(
|
|
@@ -92,13 +94,13 @@ export const ProgressControl = (props: ProgressControlProps) => {
|
|
|
92
94
|
translateX: interpolate(
|
|
93
95
|
state.value,
|
|
94
96
|
[0, 1],
|
|
95
|
-
[0, widthInNumbers - PROGRESS_THUMB_WIDTH / 2],
|
|
97
|
+
[0, (widthInNumbers - PROGRESS_THUMB_WIDTH / 2) * thumbDirectionMultiplier],
|
|
96
98
|
),
|
|
97
99
|
},
|
|
98
100
|
],
|
|
99
101
|
position: 'absolute',
|
|
100
102
|
}),
|
|
101
|
-
[widthInNumbers],
|
|
103
|
+
[thumbDirectionMultiplier, widthInNumbers],
|
|
102
104
|
);
|
|
103
105
|
|
|
104
106
|
const animatedFilledStyles = useAnimatedStyle(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { I18nManager, StyleSheet, View } from 'react-native';
|
|
3
3
|
import type { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
5
5
|
import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
@@ -98,6 +98,8 @@ export const WaveProgressBar = React.memo(
|
|
|
98
98
|
const [showInteractiveLayer, setShowInteractiveLayer] = useState(
|
|
99
99
|
() => progress > 0 || isPlaying,
|
|
100
100
|
);
|
|
101
|
+
const isRTL = I18nManager.isRTL;
|
|
102
|
+
const thumbDirectionMultiplier = isRTL ? -1 : 1;
|
|
101
103
|
const eachWaveformWidth = WAVEFORM_WIDTH + WAVEFORM_GAP;
|
|
102
104
|
const fullWidth = (amplitudesCount - 1) * eachWaveformWidth;
|
|
103
105
|
const maxThumbTranslateX = Math.max(fullWidth - eachWaveformWidth, 0);
|
|
@@ -163,7 +165,7 @@ export const WaveProgressBar = React.memo(
|
|
|
163
165
|
return;
|
|
164
166
|
}
|
|
165
167
|
const nextProgress = clampProgress(
|
|
166
|
-
dragStartProgress.value + event.translationX / fullWidth,
|
|
168
|
+
dragStartProgress.value + (event.translationX * thumbDirectionMultiplier) / fullWidth,
|
|
167
169
|
);
|
|
168
170
|
visualProgress.value = nextProgress;
|
|
169
171
|
if (onProgressDrag) {
|
|
@@ -186,6 +188,7 @@ export const WaveProgressBar = React.memo(
|
|
|
186
188
|
onEndDrag,
|
|
187
189
|
onProgressDrag,
|
|
188
190
|
onStartDrag,
|
|
191
|
+
thumbDirectionMultiplier,
|
|
189
192
|
visualProgress,
|
|
190
193
|
],
|
|
191
194
|
);
|
|
@@ -220,14 +223,13 @@ export const WaveProgressBar = React.memo(
|
|
|
220
223
|
position: 'absolute',
|
|
221
224
|
transform: [
|
|
222
225
|
{
|
|
223
|
-
translateX:
|
|
224
|
-
clampProgress(visualProgress.value) * fullWidth,
|
|
225
|
-
|
|
226
|
-
),
|
|
226
|
+
translateX:
|
|
227
|
+
Math.min(clampProgress(visualProgress.value) * fullWidth, maxThumbTranslateX) *
|
|
228
|
+
thumbDirectionMultiplier,
|
|
227
229
|
},
|
|
228
230
|
],
|
|
229
231
|
}),
|
|
230
|
-
[fullWidth, maxThumbTranslateX],
|
|
232
|
+
[fullWidth, maxThumbTranslateX, thumbDirectionMultiplier],
|
|
231
233
|
);
|
|
232
234
|
|
|
233
235
|
return (
|