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.
Files changed (198) hide show
  1. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +12 -0
  2. package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  3. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +30 -30
  4. package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  5. package/lib/commonjs/components/ImageGallery/ImageGallery.js +2 -0
  6. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  7. package/lib/commonjs/components/Message/Message.js +3 -2
  8. package/lib/commonjs/components/Message/Message.js.map +1 -1
  9. package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js +6 -3
  10. package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js.map +1 -1
  11. package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js +17 -11
  12. package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js.map +1 -1
  13. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +52 -10
  14. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  15. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +10 -8
  16. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
  17. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js +8 -2
  18. package/lib/commonjs/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js.map +1 -1
  19. package/lib/commonjs/components/Poll/CreatePollContent.js +11 -5
  20. package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -1
  21. package/lib/commonjs/components/Poll/Poll.js +4 -2
  22. package/lib/commonjs/components/Poll/Poll.js.map +1 -1
  23. package/lib/commonjs/components/Poll/components/CreatePollOptions.js +6 -3
  24. package/lib/commonjs/components/Poll/components/CreatePollOptions.js.map +1 -1
  25. package/lib/commonjs/components/Poll/components/MultipleAnswersField.js +7 -3
  26. package/lib/commonjs/components/Poll/components/MultipleAnswersField.js.map +1 -1
  27. package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js +9 -4
  28. package/lib/commonjs/components/Poll/components/MultipleVotesSettings.js.map +1 -1
  29. package/lib/commonjs/components/Poll/components/PollAnswersList.js +2 -2
  30. package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
  31. package/lib/commonjs/components/Poll/components/PollInputDialog.js +2 -1
  32. package/lib/commonjs/components/Poll/components/PollInputDialog.js.map +1 -1
  33. package/lib/commonjs/components/Poll/components/PollOption.js +12 -5
  34. package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
  35. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +7 -5
  36. package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  37. package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +6 -3
  38. package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
  39. package/lib/commonjs/components/Poll/components/PollResults/PollResults.js +8 -3
  40. package/lib/commonjs/components/Poll/components/PollResults/PollResults.js.map +1 -1
  41. package/lib/commonjs/components/Poll/components/PollResults/PollVote.js +4 -2
  42. package/lib/commonjs/components/Poll/components/PollResults/PollVote.js.map +1 -1
  43. package/lib/commonjs/components/ProgressControl/ProgressControl.js +7 -5
  44. package/lib/commonjs/components/ProgressControl/ProgressControl.js.map +1 -1
  45. package/lib/commonjs/components/ProgressControl/WaveProgressBar.js +6 -4
  46. package/lib/commonjs/components/ProgressControl/WaveProgressBar.js.map +1 -1
  47. package/lib/commonjs/components/Reply/Reply.js +14 -7
  48. package/lib/commonjs/components/Reply/Reply.js.map +1 -1
  49. package/lib/commonjs/components/Reply/ReplyMessageView.js +2 -1
  50. package/lib/commonjs/components/Reply/ReplyMessageView.js.map +1 -1
  51. package/lib/commonjs/components/ThreadList/ThreadListItem.js +2 -1
  52. package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
  53. package/lib/commonjs/components/UIComponents/SwipableWrapper.js +41 -12
  54. package/lib/commonjs/components/UIComponents/SwipableWrapper.js.map +1 -1
  55. package/lib/commonjs/components/ui/Input/Input.js +8 -4
  56. package/lib/commonjs/components/ui/Input/Input.js.map +1 -1
  57. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +1 -0
  58. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  59. package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +14 -6
  60. package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
  61. package/lib/commonjs/index.js +12 -0
  62. package/lib/commonjs/index.js.map +1 -1
  63. package/lib/commonjs/middlewares/attachments.js +33 -1
  64. package/lib/commonjs/middlewares/attachments.js.map +1 -1
  65. package/lib/commonjs/utils/createGenerateVideoThumbnails.js +41 -0
  66. package/lib/commonjs/utils/createGenerateVideoThumbnails.js.map +1 -0
  67. package/lib/commonjs/version.json +1 -1
  68. package/lib/module/components/AttachmentPicker/AttachmentPicker.js +12 -0
  69. package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
  70. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +30 -30
  71. package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
  72. package/lib/module/components/ImageGallery/ImageGallery.js +2 -0
  73. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  74. package/lib/module/components/Message/Message.js +3 -2
  75. package/lib/module/components/Message/Message.js.map +1 -1
  76. package/lib/module/components/Message/MessageItemView/MessageBubble.js +6 -3
  77. package/lib/module/components/Message/MessageItemView/MessageBubble.js.map +1 -1
  78. package/lib/module/components/Message/MessageItemView/MessageReplies.js +17 -11
  79. package/lib/module/components/Message/MessageItemView/MessageReplies.js.map +1 -1
  80. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +52 -10
  81. package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
  82. package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +10 -8
  83. package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
  84. package/lib/module/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js +8 -2
  85. package/lib/module/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.js.map +1 -1
  86. package/lib/module/components/Poll/CreatePollContent.js +11 -5
  87. package/lib/module/components/Poll/CreatePollContent.js.map +1 -1
  88. package/lib/module/components/Poll/Poll.js +4 -2
  89. package/lib/module/components/Poll/Poll.js.map +1 -1
  90. package/lib/module/components/Poll/components/CreatePollOptions.js +6 -3
  91. package/lib/module/components/Poll/components/CreatePollOptions.js.map +1 -1
  92. package/lib/module/components/Poll/components/MultipleAnswersField.js +7 -3
  93. package/lib/module/components/Poll/components/MultipleAnswersField.js.map +1 -1
  94. package/lib/module/components/Poll/components/MultipleVotesSettings.js +9 -4
  95. package/lib/module/components/Poll/components/MultipleVotesSettings.js.map +1 -1
  96. package/lib/module/components/Poll/components/PollAnswersList.js +2 -2
  97. package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
  98. package/lib/module/components/Poll/components/PollInputDialog.js +2 -1
  99. package/lib/module/components/Poll/components/PollInputDialog.js.map +1 -1
  100. package/lib/module/components/Poll/components/PollOption.js +12 -5
  101. package/lib/module/components/Poll/components/PollOption.js.map +1 -1
  102. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +7 -5
  103. package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
  104. package/lib/module/components/Poll/components/PollResults/PollResultItem.js +6 -3
  105. package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
  106. package/lib/module/components/Poll/components/PollResults/PollResults.js +8 -3
  107. package/lib/module/components/Poll/components/PollResults/PollResults.js.map +1 -1
  108. package/lib/module/components/Poll/components/PollResults/PollVote.js +4 -2
  109. package/lib/module/components/Poll/components/PollResults/PollVote.js.map +1 -1
  110. package/lib/module/components/ProgressControl/ProgressControl.js +7 -5
  111. package/lib/module/components/ProgressControl/ProgressControl.js.map +1 -1
  112. package/lib/module/components/ProgressControl/WaveProgressBar.js +6 -4
  113. package/lib/module/components/ProgressControl/WaveProgressBar.js.map +1 -1
  114. package/lib/module/components/Reply/Reply.js +14 -7
  115. package/lib/module/components/Reply/Reply.js.map +1 -1
  116. package/lib/module/components/Reply/ReplyMessageView.js +2 -1
  117. package/lib/module/components/Reply/ReplyMessageView.js.map +1 -1
  118. package/lib/module/components/ThreadList/ThreadListItem.js +2 -1
  119. package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
  120. package/lib/module/components/UIComponents/SwipableWrapper.js +41 -12
  121. package/lib/module/components/UIComponents/SwipableWrapper.js.map +1 -1
  122. package/lib/module/components/ui/Input/Input.js +8 -4
  123. package/lib/module/components/ui/Input/Input.js.map +1 -1
  124. package/lib/module/contexts/messageInputContext/MessageInputContext.js +1 -0
  125. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  126. package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +14 -6
  127. package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
  128. package/lib/module/index.js +12 -0
  129. package/lib/module/index.js.map +1 -1
  130. package/lib/module/middlewares/attachments.js +33 -1
  131. package/lib/module/middlewares/attachments.js.map +1 -1
  132. package/lib/module/utils/createGenerateVideoThumbnails.js +41 -0
  133. package/lib/module/utils/createGenerateVideoThumbnails.js.map +1 -0
  134. package/lib/module/version.json +1 -1
  135. package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
  136. package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
  137. package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
  138. package/lib/typescript/components/Message/Message.d.ts.map +1 -1
  139. package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts.map +1 -1
  140. package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts +1 -1
  141. package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts.map +1 -1
  142. package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
  143. package/lib/typescript/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.d.ts.map +1 -1
  144. package/lib/typescript/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.d.ts.map +1 -1
  145. package/lib/typescript/components/Poll/components/CreatePollOptions.d.ts.map +1 -1
  146. package/lib/typescript/components/Poll/components/PollInputDialog.d.ts.map +1 -1
  147. package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
  148. package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts.map +1 -1
  149. package/lib/typescript/components/ProgressControl/ProgressControl.d.ts.map +1 -1
  150. package/lib/typescript/components/ProgressControl/WaveProgressBar.d.ts.map +1 -1
  151. package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
  152. package/lib/typescript/components/UIComponents/SwipableWrapper.d.ts +4 -1
  153. package/lib/typescript/components/UIComponents/SwipableWrapper.d.ts.map +1 -1
  154. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
  155. package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
  156. package/lib/typescript/index.d.ts +1 -0
  157. package/lib/typescript/index.d.ts.map +1 -1
  158. package/lib/typescript/middlewares/attachments.d.ts +1 -0
  159. package/lib/typescript/middlewares/attachments.d.ts.map +1 -1
  160. package/lib/typescript/utils/createGenerateVideoThumbnails.d.ts +8 -0
  161. package/lib/typescript/utils/createGenerateVideoThumbnails.d.ts.map +1 -0
  162. package/package.json +1 -1
  163. package/src/components/AttachmentPicker/AttachmentPicker.tsx +14 -0
  164. package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +32 -34
  165. package/src/components/ImageGallery/ImageGallery.tsx +5 -1
  166. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +33 -0
  167. package/src/components/Message/Message.tsx +15 -3
  168. package/src/components/Message/MessageItemView/MessageBubble.tsx +15 -4
  169. package/src/components/Message/MessageItemView/MessageReplies.tsx +24 -12
  170. package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +62 -11
  171. package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx +10 -9
  172. package/src/components/MessageInput/components/AttachmentPreview/VideoAttachmentUploadPreview.tsx +12 -2
  173. package/src/components/Poll/CreatePollContent.tsx +10 -2
  174. package/src/components/Poll/Poll.tsx +2 -0
  175. package/src/components/Poll/components/CreatePollOptions.tsx +12 -1
  176. package/src/components/Poll/components/MultipleAnswersField.tsx +4 -0
  177. package/src/components/Poll/components/MultipleVotesSettings.tsx +6 -1
  178. package/src/components/Poll/components/PollAnswersList.tsx +1 -2
  179. package/src/components/Poll/components/PollInputDialog.tsx +2 -0
  180. package/src/components/Poll/components/PollOption.tsx +47 -39
  181. package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +41 -37
  182. package/src/components/Poll/components/PollResults/PollResultItem.tsx +63 -62
  183. package/src/components/Poll/components/PollResults/PollResults.tsx +39 -33
  184. package/src/components/Poll/components/PollResults/PollVote.tsx +27 -27
  185. package/src/components/ProgressControl/ProgressControl.tsx +8 -6
  186. package/src/components/ProgressControl/WaveProgressBar.tsx +9 -7
  187. package/src/components/Reply/Reply.tsx +19 -7
  188. package/src/components/Reply/ReplyMessageView.tsx +1 -0
  189. package/src/components/ThreadList/ThreadListItem.tsx +1 -0
  190. package/src/components/UIComponents/SwipableWrapper.tsx +54 -16
  191. package/src/components/UIComponents/__tests__/SwipableWrapper.test.tsx +98 -0
  192. package/src/components/ui/Input/Input.tsx +4 -0
  193. package/src/contexts/messageInputContext/MessageInputContext.tsx +3 -0
  194. package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +14 -3
  195. package/src/index.ts +1 -0
  196. package/src/middlewares/attachments.ts +34 -0
  197. package/src/utils/createGenerateVideoThumbnails.ts +45 -0
  198. 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 style={[styles.allOptionsWrapper, wrapper]} {...additionalScrollViewProps}>
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
- StyleSheet.create({
262
- allOptionsListContainer: {
263
- borderRadius: primitives.radiusLg,
264
- padding: primitives.spacingMd,
265
- backgroundColor: semantics.backgroundCoreSurfaceCard,
266
- marginTop: primitives.spacing2xl,
267
- },
268
- allOptionsTitleContainer: {
269
- borderRadius: primitives.radiusLg,
270
- padding: primitives.spacingMd,
271
- backgroundColor: semantics.backgroundCoreSurfaceCard,
272
- },
273
- allOptionsTitleText: {
274
- fontSize: primitives.typographyFontSizeLg,
275
- lineHeight: primitives.typographyLineHeightRelaxed,
276
- fontWeight: primitives.typographyFontWeightSemiBold,
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,
285
- },
286
- allOptionsWrapper: {
287
- flex: 1,
288
- padding: primitives.spacingMd,
289
- backgroundColor: semantics.backgroundCoreElevation1,
290
- },
291
- optionWrapper: {
292
- paddingVertical: primitives.spacingMd,
293
- },
294
- }),
295
- [semantics],
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
- StyleSheet.create({
110
- container: { flex: 1, padding: primitives.spacingMd },
111
- contentContainer: {
112
- backgroundColor: semantics.backgroundCoreSurfaceCard,
113
- borderRadius: primitives.radiusLg,
114
- marginBottom: primitives.spacingMd,
115
- paddingHorizontal: primitives.spacingMd,
116
- paddingTop: primitives.spacingMd,
117
- paddingBottom: primitives.spacingXs,
118
- },
119
- headerContainer: {
120
- flexDirection: 'row',
121
- justifyContent: 'space-between',
122
- alignItems: 'center',
123
- paddingBottom: primitives.spacingXs,
124
- },
125
- headerTitle: {
126
- flex: 1,
127
- fontSize: primitives.typographyFontSizeLg,
128
- lineHeight: primitives.typographyLineHeightRelaxed,
129
- fontWeight: primitives.typographyFontWeightSemiBold,
130
- color: semantics.textPrimary,
131
- paddingTop: primitives.spacingXs,
132
- },
133
- headerText: {
134
- fontSize: primitives.typographyFontSizeMd,
135
- lineHeight: primitives.typographyLineHeightNormal,
136
- fontWeight: primitives.typographyFontWeightSemiBold,
137
- color: semantics.textPrimary,
138
- paddingTop: primitives.spacingXs,
139
- marginLeft: primitives.spacingMd,
140
- },
141
- }),
142
- [semantics.backgroundCoreSurfaceCard, semantics.textPrimary],
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
- StyleSheet.create({
138
- spacer: {
139
- paddingBottom: primitives.spacingXs,
140
- },
141
- container: {
142
- backgroundColor: semantics.backgroundCoreSurfaceCard,
143
- borderRadius: primitives.radiusLg,
144
- marginBottom: primitives.spacingMd,
145
- },
146
- metaContainer: {
147
- paddingTop: primitives.spacingMd,
148
- paddingHorizontal: primitives.spacingMd,
149
- },
150
- votesContainer: {
151
- paddingHorizontal: primitives.spacingMd,
152
- paddingVertical: primitives.spacingXs,
153
- },
154
- headerContainer: {
155
- flexDirection: 'row',
156
- justifyContent: 'space-between',
157
- alignItems: 'center',
158
- paddingBottom: primitives.spacingXs,
159
- },
160
- modalRoot: {
161
- flex: 1,
162
- },
163
- title: {
164
- flex: 1,
165
- fontSize: primitives.typographyFontSizeLg,
166
- lineHeight: primitives.typographyLineHeightRelaxed,
167
- fontWeight: primitives.typographyFontWeightSemiBold,
168
- color: semantics.textPrimary,
169
- paddingTop: primitives.spacingXs,
170
- },
171
- titleMeta: {
172
- fontSize: primitives.typographyFontSizeSm,
173
- color: semantics.textTertiary,
174
- lineHeight: primitives.typographyLineHeightNormal,
175
- fontWeight: primitives.typographyFontWeightMedium,
176
- },
177
- voteCount: {
178
- fontSize: primitives.typographyFontSizeMd,
179
- lineHeight: primitives.typographyLineHeightNormal,
180
- fontWeight: primitives.typographyFontWeightSemiBold,
181
- color: semantics.textPrimary,
182
- marginLeft: primitives.spacingMd,
183
- },
184
- safeArea: {
185
- backgroundColor: semantics.backgroundCoreElevation1,
186
- flex: 1,
187
- },
188
- inlineButton: {
189
- borderColor: semantics.borderCoreDefault,
190
- borderTopWidth: 1,
191
- paddingHorizontal: primitives.spacingMd,
192
- paddingVertical: primitives.spacingXs,
193
- },
194
- }),
195
- [semantics],
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 style={[styles.scrollView, scrollView]} {...additionalScrollViewProps}>
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
- StyleSheet.create({
83
- container: {
84
- borderRadius: primitives.radiusLg,
85
- padding: primitives.spacingMd,
86
- backgroundColor: semantics.backgroundCoreSurfaceCard,
87
- },
88
- scrollView: {
89
- flex: 1,
90
- padding: primitives.spacingMd,
91
- backgroundColor: semantics.backgroundCoreElevation1,
92
- },
93
- resultsContainer: {
94
- paddingVertical: primitives.spacing2xl,
95
- },
96
- title: {
97
- fontSize: primitives.typographyFontSizeLg,
98
- lineHeight: primitives.typographyLineHeightRelaxed,
99
- fontWeight: primitives.typographyFontWeightSemiBold,
100
- color: semantics.textPrimary,
101
- paddingTop: primitives.spacingXs,
102
- },
103
- titleMeta: {
104
- fontSize: primitives.typographyFontSizeSm,
105
- color: semantics.textTertiary,
106
- lineHeight: primitives.typographyLineHeightNormal,
107
- fontWeight: primitives.typographyFontWeightMedium,
108
- },
109
- }),
110
- [semantics],
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
- StyleSheet.create({
64
- voteContainer: {
65
- flexDirection: 'row',
66
- justifyContent: 'space-between',
67
- alignItems: 'center',
68
- paddingVertical: primitives.spacingXs,
69
- },
70
- voteDate: {
71
- fontSize: primitives.typographyFontSizeMd,
72
- lineHeight: primitives.typographyLineHeightNormal,
73
- color: semantics.textTertiary,
74
- },
75
- voteUserName: {
76
- fontSize: primitives.typographyFontSizeMd,
77
- lineHeight: primitives.typographyLineHeightNormal,
78
- color: semantics.textPrimary,
79
- paddingLeft: primitives.spacingXs,
80
- },
81
- userContainer: {
82
- flexDirection: 'row',
83
- alignItems: 'center',
84
- },
85
- }),
86
- [semantics],
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 newProgress = Math.max(0, Math.min(event.x / widthInNumbers, 1));
77
- state.value = newProgress;
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: Math.min(
224
- clampProgress(visualProgress.value) * fullWidth,
225
- maxThumbTranslateX,
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 (