stream-chat-react-native-core 5.0.0-offline-support.12 → 5.0.0

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 (264) hide show
  1. package/lib/commonjs/components/{MessageInput/AudioAttachmentUploadPreview.js → Attachment/AudioAttachment.js} +38 -64
  2. package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -0
  3. package/lib/commonjs/components/Attachment/Card.js +1 -0
  4. package/lib/commonjs/components/Attachment/Card.js.map +1 -1
  5. package/lib/commonjs/components/Attachment/FileAttachment.js +16 -7
  6. package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
  7. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +132 -12
  8. package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
  9. package/lib/commonjs/components/Attachment/Gallery.js +41 -35
  10. package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
  11. package/lib/commonjs/components/Attachment/Giphy.js +17 -13
  12. package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
  13. package/lib/commonjs/components/Attachment/VideoThumbnail.js +12 -6
  14. package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
  15. package/lib/commonjs/components/Attachment/utils/getGiphyMimeType.js +15 -0
  16. package/lib/commonjs/components/Attachment/utils/getGiphyMimeType.js.map +1 -0
  17. package/lib/commonjs/components/Channel/Channel.js +19 -19
  18. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  19. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +0 -2
  20. package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  21. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -0
  22. package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  23. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +16 -4
  24. package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  25. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +12 -7
  26. package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  27. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +10 -6
  28. package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
  29. package/lib/commonjs/components/ImageGallery/ImageGallery.js +38 -30
  30. package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
  31. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +11 -10
  32. package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  33. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +2 -2
  34. package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
  35. package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js +6 -0
  36. package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
  37. package/lib/commonjs/components/Message/Message.js +7 -7
  38. package/lib/commonjs/components/Message/Message.js.map +1 -1
  39. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +7 -3
  40. package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  41. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +1 -1
  42. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  43. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  44. package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  45. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +1 -1
  46. package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  47. package/lib/commonjs/components/MessageInput/FileUploadPreview.js +38 -44
  48. package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
  49. package/lib/commonjs/components/MessageList/MessageList.js +5 -5
  50. package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
  51. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +10 -9
  52. package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
  53. package/lib/commonjs/components/index.js +13 -13
  54. package/lib/commonjs/components/index.js.map +1 -1
  55. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +13 -14
  56. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  57. package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.md +1 -1
  58. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +2 -2
  59. package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  60. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +0 -2
  61. package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  62. package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
  63. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  64. package/lib/commonjs/contexts/themeContext/utils/theme.js +2 -2
  65. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  66. package/lib/commonjs/index.js +13 -1
  67. package/lib/commonjs/index.js.map +1 -1
  68. package/lib/commonjs/mock-builders/DB/mock.js +1 -13
  69. package/lib/commonjs/mock-builders/DB/mock.js.map +1 -1
  70. package/lib/commonjs/mock-builders/event/messageNew.js +2 -0
  71. package/lib/commonjs/mock-builders/event/messageNew.js.map +1 -1
  72. package/lib/commonjs/store/QuickSqliteClient.js +7 -3
  73. package/lib/commonjs/store/QuickSqliteClient.js.map +1 -1
  74. package/lib/commonjs/store/apis/getChannels.js +2 -15
  75. package/lib/commonjs/store/apis/getChannels.js.map +1 -1
  76. package/lib/commonjs/store/apis/getChannelsForFilterSort.js +37 -0
  77. package/lib/commonjs/store/apis/getChannelsForFilterSort.js.map +1 -0
  78. package/lib/commonjs/store/apis/index.js +264 -0
  79. package/lib/commonjs/store/apis/index.js.map +1 -0
  80. package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js +1 -1
  81. package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -1
  82. package/lib/commonjs/store/apis/queries/selectChannels.js +2 -2
  83. package/lib/commonjs/store/apis/queries/selectChannels.js.map +1 -1
  84. package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js +1 -2
  85. package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js.map +1 -1
  86. package/lib/commonjs/test-utils/BetterSqlite.js +54 -0
  87. package/lib/commonjs/test-utils/BetterSqlite.js.map +1 -0
  88. package/lib/commonjs/version.json +1 -1
  89. package/lib/module/components/{MessageInput/AudioAttachmentUploadPreview.js → Attachment/AudioAttachment.js} +38 -64
  90. package/lib/module/components/Attachment/AudioAttachment.js.map +1 -0
  91. package/lib/module/components/Attachment/Card.js +1 -0
  92. package/lib/module/components/Attachment/Card.js.map +1 -1
  93. package/lib/module/components/Attachment/FileAttachment.js +16 -7
  94. package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
  95. package/lib/module/components/Attachment/FileAttachmentGroup.js +132 -12
  96. package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
  97. package/lib/module/components/Attachment/Gallery.js +41 -35
  98. package/lib/module/components/Attachment/Gallery.js.map +1 -1
  99. package/lib/module/components/Attachment/Giphy.js +17 -13
  100. package/lib/module/components/Attachment/Giphy.js.map +1 -1
  101. package/lib/module/components/Attachment/VideoThumbnail.js +12 -6
  102. package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
  103. package/lib/module/components/Attachment/utils/getGiphyMimeType.js +15 -0
  104. package/lib/module/components/Attachment/utils/getGiphyMimeType.js.map +1 -0
  105. package/lib/module/components/Channel/Channel.js +19 -19
  106. package/lib/module/components/Channel/Channel.js.map +1 -1
  107. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +0 -2
  108. package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
  109. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -0
  110. package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
  111. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +16 -4
  112. package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
  113. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +12 -7
  114. package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
  115. package/lib/module/components/ChannelPreview/ChannelPreview.js +10 -6
  116. package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
  117. package/lib/module/components/ImageGallery/ImageGallery.js +38 -30
  118. package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
  119. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +11 -10
  120. package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js.map +1 -1
  121. package/lib/module/components/ImageGallery/components/ImageGrid.js +2 -2
  122. package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
  123. package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js +6 -0
  124. package/lib/module/components/ImageGallery/hooks/useImageGalleryGestures.js.map +1 -1
  125. package/lib/module/components/Message/Message.js +7 -7
  126. package/lib/module/components/Message/Message.js.map +1 -1
  127. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +7 -3
  128. package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
  129. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +1 -1
  130. package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -1
  131. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +1 -1
  132. package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -1
  133. package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
  134. package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
  135. package/lib/module/components/MessageInput/FileUploadPreview.js +38 -44
  136. package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
  137. package/lib/module/components/MessageList/MessageList.js +5 -5
  138. package/lib/module/components/MessageList/MessageList.js.map +1 -1
  139. package/lib/module/components/MessageOverlay/MessageOverlay.js +10 -9
  140. package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
  141. package/lib/module/components/index.js +13 -13
  142. package/lib/module/components/index.js.map +1 -1
  143. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +13 -14
  144. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
  145. package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.md +1 -1
  146. package/lib/module/contexts/messageInputContext/MessageInputContext.js +2 -2
  147. package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
  148. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +0 -2
  149. package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
  150. package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
  151. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  152. package/lib/module/contexts/themeContext/utils/theme.js +2 -2
  153. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  154. package/lib/module/index.js +13 -1
  155. package/lib/module/index.js.map +1 -1
  156. package/lib/module/mock-builders/DB/mock.js +1 -13
  157. package/lib/module/mock-builders/DB/mock.js.map +1 -1
  158. package/lib/module/mock-builders/event/messageNew.js +2 -0
  159. package/lib/module/mock-builders/event/messageNew.js.map +1 -1
  160. package/lib/module/store/QuickSqliteClient.js +7 -3
  161. package/lib/module/store/QuickSqliteClient.js.map +1 -1
  162. package/lib/module/store/apis/getChannels.js +2 -15
  163. package/lib/module/store/apis/getChannels.js.map +1 -1
  164. package/lib/module/store/apis/getChannelsForFilterSort.js +37 -0
  165. package/lib/module/store/apis/getChannelsForFilterSort.js.map +1 -0
  166. package/lib/module/store/apis/index.js +264 -0
  167. package/lib/module/store/apis/index.js.map +1 -0
  168. package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js +1 -1
  169. package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -1
  170. package/lib/module/store/apis/queries/selectChannels.js +2 -2
  171. package/lib/module/store/apis/queries/selectChannels.js.map +1 -1
  172. package/lib/module/store/sqlite-utils/appendWhereCluase.js +1 -2
  173. package/lib/module/store/sqlite-utils/appendWhereCluase.js.map +1 -1
  174. package/lib/module/test-utils/BetterSqlite.js +54 -0
  175. package/lib/module/test-utils/BetterSqlite.js.map +1 -0
  176. package/lib/module/version.json +1 -1
  177. package/lib/typescript/components/Attachment/AudioAttachment.d.ts +23 -0
  178. package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +1 -1
  179. package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
  180. package/lib/typescript/components/Attachment/Giphy.d.ts +1 -1
  181. package/lib/typescript/components/Attachment/utils/getGiphyMimeType.d.ts +6 -0
  182. package/lib/typescript/components/Channel/Channel.d.ts +1 -1
  183. package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
  184. package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
  185. package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +1 -1
  186. package/lib/typescript/components/ImageGallery/hooks/useImageGalleryGestures.d.ts +2 -1
  187. package/lib/typescript/components/Message/Message.d.ts +9 -3
  188. package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +1 -1
  189. package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
  190. package/lib/typescript/components/index.d.ts +1 -1
  191. package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +9 -10
  192. package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
  193. package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -4
  194. package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
  195. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -0
  196. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +2 -2
  197. package/lib/typescript/index.d.ts +2 -0
  198. package/lib/typescript/store/QuickSqliteClient.d.ts +4 -0
  199. package/lib/typescript/store/apis/getChannels.d.ts +13 -5
  200. package/lib/typescript/store/apis/getChannelsForFilterSort.d.ts +17 -0
  201. package/lib/typescript/store/apis/index.d.ts +20 -0
  202. package/lib/typescript/store/apis/queries/selectChannelIdsForFilterSort.d.ts +10 -1
  203. package/lib/typescript/{__tests__/utils → test-utils}/BetterSqlite.d.ts +1 -1
  204. package/package.json +5 -4
  205. package/src/__tests__/offline-feature.test.js +1 -2
  206. package/src/components/{MessageInput/AudioAttachmentUploadPreview.tsx → Attachment/AudioAttachment.tsx} +82 -131
  207. package/src/components/Attachment/Card.tsx +1 -0
  208. package/src/components/Attachment/FileAttachment.tsx +3 -0
  209. package/src/components/Attachment/FileAttachmentGroup.tsx +119 -9
  210. package/src/components/Attachment/Gallery.tsx +30 -19
  211. package/src/components/Attachment/Giphy.tsx +15 -8
  212. package/src/components/Attachment/VideoThumbnail.tsx +3 -2
  213. package/src/components/Attachment/utils/getGiphyMimeType.ts +13 -0
  214. package/src/components/Channel/Channel.tsx +5 -4
  215. package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +0 -2
  216. package/src/components/Channel/hooks/useCreateMessagesContext.ts +2 -0
  217. package/src/components/ChannelList/__tests__/ChannelList.test.js +28 -0
  218. package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +18 -5
  219. package/src/components/ChannelList/hooks/usePaginatedChannels.ts +19 -10
  220. package/src/components/ChannelPreview/ChannelPreview.tsx +6 -3
  221. package/src/components/ImageGallery/ImageGallery.tsx +32 -19
  222. package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +6 -6
  223. package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +3 -3
  224. package/src/components/ImageGallery/__tests__/ImageGalleryGrid.test.tsx +3 -3
  225. package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +3 -3
  226. package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +12 -7
  227. package/src/components/ImageGallery/components/ImageGrid.tsx +3 -3
  228. package/src/components/ImageGallery/hooks/useImageGalleryGestures.tsx +16 -0
  229. package/src/components/Message/Message.tsx +10 -2
  230. package/src/components/Message/MessageSimple/MessageTextContainer.tsx +22 -2
  231. package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +4 -2
  232. package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -0
  233. package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +4 -0
  234. package/src/components/Message/MessageSimple/utils/parseLinks.ts +1 -1
  235. package/src/components/Message/MessageSimple/utils/renderText.tsx +1 -1
  236. package/src/components/MessageInput/FileUploadPreview.tsx +34 -26
  237. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewExpo.test.tsx +15 -8
  238. package/src/components/MessageInput/__tests__/AudioAttachmentUploadPreviewNative.test.tsx +15 -8
  239. package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +5 -5
  240. package/src/components/MessageList/MessageList.tsx +6 -6
  241. package/src/components/MessageOverlay/MessageOverlay.tsx +1 -0
  242. package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +4 -0
  243. package/src/components/index.ts +1 -1
  244. package/src/contexts/imageGalleryContext/ImageGalleryContext.md +1 -1
  245. package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +19 -14
  246. package/src/contexts/messageInputContext/MessageInputContext.tsx +0 -6
  247. package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +0 -2
  248. package/src/contexts/messagesContext/MessagesContext.tsx +3 -0
  249. package/src/contexts/themeContext/utils/theme.ts +4 -4
  250. package/src/index.ts +3 -0
  251. package/src/mock-builders/DB/mock.ts +4 -9
  252. package/src/mock-builders/event/messageNew.js +2 -0
  253. package/src/store/QuickSqliteClient.ts +11 -7
  254. package/src/store/apis/getChannels.ts +17 -14
  255. package/src/store/apis/getChannelsForFilterSort.ts +45 -0
  256. package/src/store/apis/index.ts +20 -0
  257. package/src/store/apis/queries/selectChannelIdsForFilterSort.ts +12 -2
  258. package/src/store/apis/queries/selectChannels.ts +9 -3
  259. package/src/store/sqlite-utils/appendWhereCluase.ts +1 -2
  260. package/src/{__tests__/utils → test-utils}/BetterSqlite.js +1 -1
  261. package/src/version.json +1 -1
  262. package/lib/commonjs/components/MessageInput/AudioAttachmentUploadPreview.js.map +0 -1
  263. package/lib/module/components/MessageInput/AudioAttachmentUploadPreview.js.map +0 -1
  264. package/lib/typescript/components/MessageInput/AudioAttachmentUploadPreview.d.ts +0 -26
@@ -134,7 +134,7 @@ const styles = StyleSheet.create({
134
134
 
135
135
  export type GiphyPropsWithContext<
136
136
  StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
137
- > = Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setImage' | 'setImages'> &
137
+ > = Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setSelectedMessage' | 'setMessages'> &
138
138
  Pick<
139
139
  MessageContextValue<StreamChatGenerics>,
140
140
  | 'handleAction'
@@ -173,9 +173,9 @@ const GiphyWithContext = <
173
173
  onPress,
174
174
  onPressIn,
175
175
  preventPress,
176
- setImage,
177
- setImages,
176
+ setMessages,
178
177
  setOverlay,
178
+ setSelectedMessage,
179
179
  } = props;
180
180
 
181
181
  const { actions, giphy: giphyData, image_url, thumb_url, title, type } = attachment;
@@ -210,8 +210,8 @@ const GiphyWithContext = <
210
210
  const giphyDimensions: { height?: number; width?: number } = {};
211
211
 
212
212
  const defaultOnPress = () => {
213
- setImages([message]);
214
- setImage({ messageId: message.id, url: uri });
213
+ setMessages([message]);
214
+ setSelectedMessage({ messageId: message.id, url: uri });
215
215
  setOverlay('gallery');
216
216
  };
217
217
 
@@ -391,11 +391,13 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
391
391
  attachment: { actions: prevActions, image_url: prevImageUrl, thumb_url: prevThumbUrl },
392
392
  giphyVersion: prevGiphyVersion,
393
393
  isMyMessage: prevIsMyMessage,
394
+ message: prevMessage,
394
395
  } = prevProps;
395
396
  const {
396
397
  attachment: { actions: nextActions, image_url: nextImageUrl, thumb_url: nextThumbUrl },
397
398
  giphyVersion: nextGiphyVersion,
398
399
  isMyMessage: nextIsMyMessage,
400
+ message: nextMessage,
399
401
  } = nextProps;
400
402
 
401
403
  const imageUrlEqual = prevImageUrl === nextImageUrl;
@@ -418,6 +420,11 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
418
420
  const isMyMessageEqual = prevIsMyMessage === nextIsMyMessage;
419
421
  if (!isMyMessageEqual) return false;
420
422
 
423
+ const messageEqual =
424
+ prevMessage?.id === nextMessage?.id &&
425
+ `${prevMessage?.updated_at}` === `${nextMessage?.updated_at}`;
426
+
427
+ if (!messageEqual) return false;
421
428
  return true;
422
429
  };
423
430
 
@@ -440,7 +447,7 @@ export const Giphy = <
440
447
  const { handleAction, isMyMessage, message, onLongPress, onPress, onPressIn, preventPress } =
441
448
  useMessageContext<StreamChatGenerics>();
442
449
  const { additionalTouchableProps, giphyVersion } = useMessagesContext<StreamChatGenerics>();
443
- const { setImage, setImages } = useImageGalleryContext<StreamChatGenerics>();
450
+ const { setMessages, setSelectedMessage } = useImageGalleryContext<StreamChatGenerics>();
444
451
  const { setOverlay } = useOverlayContext();
445
452
 
446
453
  const {
@@ -465,9 +472,9 @@ export const Giphy = <
465
472
  onPress,
466
473
  onPressIn,
467
474
  preventPress,
468
- setImage,
469
- setImages,
475
+ setMessages,
470
476
  setOverlay,
477
+ setSelectedMessage,
471
478
  }}
472
479
  {...props}
473
480
  />
@@ -40,6 +40,7 @@ export type VideoThumbnailProps = {
40
40
  export const VideoThumbnail: React.FC<VideoThumbnailProps> = (props) => {
41
41
  const {
42
42
  theme: {
43
+ colors: { static_black, static_white },
43
44
  messageSimple: {
44
45
  videoThumbnail: { container, roundedView },
45
46
  },
@@ -53,8 +54,8 @@ export const VideoThumbnail: React.FC<VideoThumbnailProps> = (props) => {
53
54
  source={{ uri: thumb_url }}
54
55
  style={[styles.container, container, style]}
55
56
  >
56
- <View style={[styles.roundedView, roundedView]}>
57
- <Play height={24} pathFill={'#000'} width={24} />
57
+ <View style={[styles.roundedView, roundedView, { backgroundColor: static_white }]}>
58
+ <Play height={24} pathFill={static_black} width={24} />
58
59
  </View>
59
60
  </ImageBackground>
60
61
  );
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * @param giphyUrl The giphy attachment url
4
+ * @returns mimeType for the giphy attachment
5
+ */
6
+ export function getGiphyMimeType(giphyUrl: string): string {
7
+ if (giphyUrl.includes('.mp4')) {
8
+ return 'video/mp4';
9
+ } else if (giphyUrl.includes('.webp')) {
10
+ return 'image/webp';
11
+ }
12
+ return 'image/gif';
13
+ }
@@ -76,6 +76,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types';
76
76
  import { generateRandomId, MessageStatusTypes, ReactionData } from '../../utils/utils';
77
77
  import { Attachment as AttachmentDefault } from '../Attachment/Attachment';
78
78
  import { AttachmentActions as AttachmentActionsDefault } from '../Attachment/AttachmentActions';
79
+ import { AudioAttachment as AudioAttachmentDefault } from '../Attachment/AudioAttachment';
79
80
  import { Card as CardDefault } from '../Attachment/Card';
80
81
  import { FileAttachment as FileAttachmentDefault } from '../Attachment/FileAttachment';
81
82
  import { FileAttachmentGroup as FileAttachmentGroupDefault } from '../Attachment/FileAttachmentGroup';
@@ -107,7 +108,6 @@ import { MessageSimple as MessageSimpleDefault } from '../Message/MessageSimple/
107
108
  import { MessageStatus as MessageStatusDefault } from '../Message/MessageSimple/MessageStatus';
108
109
  import { ReactionList as ReactionListDefault } from '../Message/MessageSimple/ReactionList';
109
110
  import { AttachButton as AttachButtonDefault } from '../MessageInput/AttachButton';
110
- import { AudioAttachmentUploadPreview as AudioAttachmentUploadPreviewDefault } from '../MessageInput/AudioAttachmentUploadPreview';
111
111
  import { CommandsButton as CommandsButtonDefault } from '../MessageInput/CommandsButton';
112
112
  import { InputEditingStateHeader as InputEditingStateHeaderDefault } from '../MessageInput/components/InputEditingStateHeader';
113
113
  import { InputGiphySearch as InputGiphyCommandInputDefault } from '../MessageInput/components/InputGiphySearch';
@@ -223,6 +223,7 @@ export type ChannelPropsWithContext<
223
223
  | 'additionalTouchableProps'
224
224
  | 'Attachment'
225
225
  | 'AttachmentActions'
226
+ | 'AudioAttachment'
226
227
  | 'Card'
227
228
  | 'CardCover'
228
229
  | 'CardFooter'
@@ -391,7 +392,7 @@ const ChannelWithContext = <
391
392
  AttachButton = AttachButtonDefault,
392
393
  Attachment = AttachmentDefault,
393
394
  AttachmentActions = AttachmentActionsDefault,
394
- AudioAttachmentUploadPreview = AudioAttachmentUploadPreviewDefault,
395
+ AudioAttachment = AudioAttachmentDefault,
395
396
  AutoCompleteSuggestionHeader = AutoCompleteSuggestionHeaderDefault,
396
397
  AutoCompleteSuggestionItem = AutoCompleteSuggestionItemDefault,
397
398
  AutoCompleteSuggestionList = AutoCompleteSuggestionListDefault,
@@ -576,7 +577,7 @@ const ChannelWithContext = <
576
577
  const channelId = channel?.id || '';
577
578
  useEffect(() => {
578
579
  const initChannel = () => {
579
- if (!channel || !shouldSyncChannel || channel.staticState) return;
580
+ if (!channel || !shouldSyncChannel || channel.offlineMode) return;
580
581
  /**
581
582
  * Loading channel at first unread message requires channel to be initialized in the first place,
582
583
  * since we use read state on channel to decide what offset to load channel at.
@@ -1584,7 +1585,6 @@ const ChannelWithContext = <
1584
1585
  const inputMessageInputContext = useCreateInputMessageInputContext<StreamChatGenerics>({
1585
1586
  additionalTextInputProps,
1586
1587
  AttachButton,
1587
- AudioAttachmentUploadPreview,
1588
1588
  autoCompleteSuggestionsLimit,
1589
1589
  autoCompleteTriggerSettings,
1590
1590
  channelId,
@@ -1644,6 +1644,7 @@ const ChannelWithContext = <
1644
1644
  additionalTouchableProps,
1645
1645
  Attachment,
1646
1646
  AttachmentActions,
1647
+ AudioAttachment,
1647
1648
  Card,
1648
1649
  CardCover,
1649
1650
  CardFooter,
@@ -8,7 +8,6 @@ export const useCreateInputMessageInputContext = <
8
8
  >({
9
9
  additionalTextInputProps,
10
10
  AttachButton,
11
- AudioAttachmentUploadPreview,
12
11
  autoCompleteSuggestionsLimit,
13
12
  autoCompleteTriggerSettings,
14
13
  channelId,
@@ -65,7 +64,6 @@ export const useCreateInputMessageInputContext = <
65
64
  () => ({
66
65
  additionalTextInputProps,
67
66
  AttachButton,
68
- AudioAttachmentUploadPreview,
69
67
  autoCompleteSuggestionsLimit,
70
68
  autoCompleteTriggerSettings,
71
69
  clearEditingState,
@@ -9,6 +9,7 @@ export const useCreateMessagesContext = <
9
9
  additionalTouchableProps,
10
10
  Attachment,
11
11
  AttachmentActions,
12
+ AudioAttachment,
12
13
  Card,
13
14
  CardCover,
14
15
  CardFooter,
@@ -99,6 +100,7 @@ export const useCreateMessagesContext = <
99
100
  additionalTouchableProps,
100
101
  Attachment,
101
102
  AttachmentActions,
103
+ AudioAttachment,
102
104
  Card,
103
105
  CardCover,
104
106
  CardFooter,
@@ -246,6 +246,34 @@ describe('ChannelList', () => {
246
246
  });
247
247
  });
248
248
 
249
+ it('should add channel to top if channel is hidden from the list', async () => {
250
+ const { getAllByRole, getByTestId, getByText } = render(
251
+ <Chat client={chatClient}>
252
+ <ChannelList {...props} />
253
+ </Chat>,
254
+ );
255
+
256
+ await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
257
+ act(() => dispatchChannelHiddenEvent(chatClient, testChannel3.channel));
258
+
259
+ const newItems = getAllByRole('list-item');
260
+ await waitFor(() => {
261
+ expect(newItems).toHaveLength(2);
262
+ });
263
+
264
+ const newMessage = sendNewMessageOnChannel3();
265
+
266
+ await waitFor(() => {
267
+ expect(getByText(newMessage.text)).toBeTruthy();
268
+ });
269
+
270
+ const items = getAllByRole('list-item');
271
+
272
+ await waitFor(() => {
273
+ expect(within(items[0]).getByText(newMessage.text)).toBeTruthy();
274
+ });
275
+ });
276
+
249
277
  it('should not alter order if `lockChannelOrder` prop is true', async () => {
250
278
  const { getAllByRole, getByTestId, getByText } = render(
251
279
  <Chat client={chatClient}>
@@ -24,11 +24,24 @@ export const useNewMessage = <
24
24
  useEffect(() => {
25
25
  const handleEvent = (event: Event<StreamChatGenerics>) => {
26
26
  setChannels((channels) => {
27
- if (!lockChannelOrder && event.cid) {
28
- return moveChannelUp<StreamChatGenerics>({
29
- channels,
30
- cid: event.cid,
31
- });
27
+ if (!lockChannelOrder && event.cid && event.channel_type && event.channel_id) {
28
+ const targetChannelIndex = channels.findIndex((c) => c.cid === event.cid);
29
+
30
+ if (targetChannelIndex >= 0) {
31
+ return moveChannelUp<StreamChatGenerics>({
32
+ channels,
33
+ cid: event.cid,
34
+ });
35
+ }
36
+
37
+ // If channel doesn't exist in existing list, check in activeChannels as well.
38
+ // It may happen that channel was hidden using channel.hide(). In that case
39
+ // We remove it from `channels` state, but its still being watched and exists in client.activeChannels.
40
+ const channel = client.channel(event.channel_type, event.channel_id);
41
+
42
+ if (channel.initialized) {
43
+ return [channel, ...channels];
44
+ }
32
45
  }
33
46
 
34
47
  return [...channels];
@@ -6,7 +6,7 @@ import { useActiveChannelsRefContext } from '../../../contexts/activeChannelsRef
6
6
  import { useChatContext } from '../../../contexts/chatContext/ChatContext';
7
7
  import { useIsMountedRef } from '../../../hooks/useIsMountedRef';
8
8
 
9
- import { getChannels } from '../../../store/apis/getChannels';
9
+ import { getChannelsForFilterSort } from '../../../store/apis/getChannelsForFilterSort';
10
10
  import type { DefaultStreamChatGenerics } from '../../../types/types';
11
11
  import { ONE_SECOND_IN_MS } from '../../../utils/date';
12
12
  import { MAX_QUERY_CHANNELS_LIMIT } from '../utils';
@@ -44,8 +44,10 @@ export const usePaginatedChannels = <
44
44
  sort = {},
45
45
  }: Parameters<StreamChatGenerics>) => {
46
46
  const { client } = useChatContext<StreamChatGenerics>();
47
-
48
- const [channels, setChannels] = useState<Channel<StreamChatGenerics>[]>([]);
47
+ const initialChannelsStateRef = useRef([]);
48
+ const [channels, setChannels] = useState<Channel<StreamChatGenerics>[]>(
49
+ initialChannelsStateRef.current,
50
+ );
49
51
  const [staticChannelsActive, setStaticChannelsActive] = useState<boolean>(true);
50
52
  const activeChannels = useActiveChannelsRefContext();
51
53
 
@@ -181,12 +183,19 @@ export const usePaginatedChannels = <
181
183
  if (!client?.user?.id) return;
182
184
  if (enableOfflineSupport) {
183
185
  try {
184
- const channelsFromDB = getChannels({ currentUserId: client.user.id, filters, sort });
185
- setChannels(
186
- client.hydrateActiveChannels(channelsFromDB, {
187
- staticState: true,
188
- }),
189
- );
186
+ const channelsFromDB = getChannelsForFilterSort({
187
+ currentUserId: client.user.id,
188
+ filters,
189
+ sort,
190
+ });
191
+
192
+ if (channelsFromDB) {
193
+ setChannels(
194
+ client.hydrateActiveChannels(channelsFromDB, {
195
+ offlineMode: true,
196
+ }),
197
+ );
198
+ }
190
199
  } catch (e) {
191
200
  console.warn('Failed to get channels from database: ', e);
192
201
  }
@@ -205,7 +214,7 @@ export const usePaginatedChannels = <
205
214
  loadingChannels:
206
215
  activeQueryType === 'queryLocalDB'
207
216
  ? true
208
- : activeQueryType === 'reload' && channels.length === 0,
217
+ : activeQueryType === 'reload' && channels === initialChannelsStateRef.current,
209
218
  loadingNextPage: activeQueryType === 'loadChannels',
210
219
  loadNextPage,
211
220
  refreshing: activeQueryType === 'refresh',
@@ -78,9 +78,12 @@ const ChannelPreviewWithContext = <
78
78
  };
79
79
 
80
80
  const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {
81
- if (event.message?.id === lastMessage?.id) {
82
- setLastMessage(event.message);
83
- }
81
+ setLastMessage((prevLastMessage) => {
82
+ if (prevLastMessage?.id === event.message?.id) {
83
+ return event.message;
84
+ }
85
+ return prevLastMessage;
86
+ });
84
87
  };
85
88
 
86
89
  const listeners = [
@@ -65,6 +65,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types';
65
65
  import { getResizedImageUrl } from '../../utils/getResizedImageUrl';
66
66
  import { getUrlOfImageAttachment } from '../../utils/getUrlOfImageAttachment';
67
67
  import { vh, vw } from '../../utils/utils';
68
+ import { getGiphyMimeType } from '../Attachment/utils/getGiphyMimeType';
68
69
 
69
70
  const isAndroid = Platform.OS === 'android';
70
71
  const fullScreenHeight = Dimensions.get('screen').height;
@@ -161,7 +162,8 @@ export const ImageGallery = <
161
162
  } = useTheme();
162
163
  const [gridPhotos, setGridPhotos] = useState<Photo<StreamChatGenerics>[]>([]);
163
164
  const { overlay, translucentStatusBar } = useOverlayContext();
164
- const { image, images, setImage } = useImageGalleryContext<StreamChatGenerics>();
165
+ const { messages, selectedMessage, setSelectedMessage } =
166
+ useImageGalleryContext<StreamChatGenerics>();
165
167
 
166
168
  /**
167
169
  * Height constants
@@ -256,20 +258,22 @@ export const ImageGallery = <
256
258
  * photo attachments
257
259
  */
258
260
 
259
- const photos = images.reduce((acc: Photo<StreamChatGenerics>[], cur) => {
261
+ const photos = messages.reduce((acc: Photo<StreamChatGenerics>[], cur) => {
260
262
  const attachmentImages =
261
- cur.attachments?.filter(
262
- (attachment) =>
263
- (attachment.type === 'giphy' &&
264
- (attachment.giphy?.[giphyVersion]?.url ||
265
- attachment.thumb_url ||
266
- attachment.image_url)) ||
267
- (attachment.type === 'image' &&
268
- !attachment.title_link &&
269
- !attachment.og_scrape_url &&
270
- getUrlOfImageAttachment(attachment)) ||
271
- (isVideoPackageAvailable() && attachment.type === 'video'),
272
- ) || [];
263
+ cur.attachments
264
+ ?.filter(
265
+ (attachment) =>
266
+ (attachment.type === 'giphy' &&
267
+ (attachment.giphy?.[giphyVersion]?.url ||
268
+ attachment.thumb_url ||
269
+ attachment.image_url)) ||
270
+ (attachment.type === 'image' &&
271
+ !attachment.title_link &&
272
+ !attachment.og_scrape_url &&
273
+ getUrlOfImageAttachment(attachment)) ||
274
+ (isVideoPackageAvailable() && attachment.type === 'video'),
275
+ )
276
+ .reverse() || [];
273
277
 
274
278
  const attachmentPhotos = attachmentImages.map((a) => {
275
279
  const imageUrl = getUrlOfImageAttachment(a) as string;
@@ -280,7 +284,7 @@ export const ImageGallery = <
280
284
  created_at: cur.created_at,
281
285
  id: `photoId-${cur.id}-${imageUrl}`,
282
286
  messageId: cur.id,
283
- mime_type: a.type === 'giphy' ? 'image/gif' : a.mime_type,
287
+ mime_type: a.type === 'giphy' ? getGiphyMimeType(giphyURL ?? '') : a.mime_type,
284
288
  original_height: a.original_height,
285
289
  original_width: a.original_width,
286
290
  type: a.type,
@@ -297,7 +301,7 @@ export const ImageGallery = <
297
301
  };
298
302
  });
299
303
 
300
- return [...acc, ...attachmentPhotos] as Photo<StreamChatGenerics>[];
304
+ return [...attachmentPhotos, ...acc] as Photo<StreamChatGenerics>[];
301
305
  }, []);
302
306
 
303
307
  /**
@@ -308,6 +312,12 @@ export const ImageGallery = <
308
312
  */
309
313
  const photoLength = photos.length;
310
314
 
315
+ /**
316
+ * The URL for the images may differ because of dimensions passed as
317
+ * part of the query.
318
+ */
319
+ const stripQueryFromUrl = (url: string) => url.split('?')[0];
320
+
311
321
  /**
312
322
  * Set selected photo when changed via pressing in the message list
313
323
  */
@@ -323,7 +333,9 @@ export const ImageGallery = <
323
333
  };
324
334
 
325
335
  const newIndex = photos.findIndex(
326
- (photo) => photo.messageId === image?.messageId && photo.uri === image?.url,
336
+ (photo) =>
337
+ photo.messageId === selectedMessage?.messageId &&
338
+ stripQueryFromUrl(photo.uri) === stripQueryFromUrl(selectedMessage?.url || ''),
327
339
  );
328
340
 
329
341
  if (photoLength > 1) {
@@ -331,7 +343,7 @@ export const ImageGallery = <
331
343
  }
332
344
 
333
345
  runOnUI(updatePosition)(newIndex);
334
- }, [image, photoLength]);
346
+ }, [selectedMessage, photoLength]);
335
347
 
336
348
  /**
337
349
  * Image heights are not provided and therefore need to be calculated.
@@ -370,6 +382,7 @@ export const ImageGallery = <
370
382
  scale,
371
383
  screenHeight,
372
384
  screenWidth,
385
+ selectedIndex,
373
386
  setSelectedIndex,
374
387
  translateX,
375
388
  translateY,
@@ -664,7 +677,7 @@ export const ImageGallery = <
664
677
  closeGridView={closeGridView}
665
678
  numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}
666
679
  photos={gridPhotos}
667
- setImage={setImage}
680
+ setSelectedMessage={setSelectedMessage}
668
681
  {...imageGalleryCustomComponents?.grid}
669
682
  />
670
683
  </BottomSheetModal>
@@ -48,7 +48,7 @@ describe('ImageGallery', () => {
48
48
  it('render image gallery component', () => {
49
49
  const { queryAllByA11yLabel } = render(
50
50
  getComponent({
51
- images: [
51
+ messages: [
52
52
  generateMessage({
53
53
  attachments: [
54
54
  generateImageAttachment(),
@@ -66,7 +66,7 @@ describe('ImageGallery', () => {
66
66
  it('handle handleLoad function when video item present and payload duration is available', () => {
67
67
  const { getByA11yLabel } = render(
68
68
  getComponent({
69
- images: [
69
+ messages: [
70
70
  generateMessage({
71
71
  attachments: [generateVideoAttachment({ type: 'video' })],
72
72
  }),
@@ -89,7 +89,7 @@ describe('ImageGallery', () => {
89
89
  it('handle handleLoad function when video item present and payload duration is undefined', () => {
90
90
  const { getByA11yLabel } = render(
91
91
  getComponent({
92
- images: [
92
+ messages: [
93
93
  generateMessage({
94
94
  attachments: [generateVideoAttachment({ type: 'video' })],
95
95
  }),
@@ -112,7 +112,7 @@ describe('ImageGallery', () => {
112
112
  it('handle handleProgress function when video item present and payload is well defined', () => {
113
113
  const { getByA11yLabel } = render(
114
114
  getComponent({
115
- images: [
115
+ messages: [
116
116
  generateMessage({
117
117
  attachments: [generateVideoAttachment({ type: 'video' })],
118
118
  }),
@@ -140,7 +140,7 @@ describe('ImageGallery', () => {
140
140
  it('handle handleProgress function when video item present and payload is not defined', () => {
141
141
  const { getByA11yLabel } = render(
142
142
  getComponent({
143
- images: [
143
+ messages: [
144
144
  generateMessage({
145
145
  attachments: [generateVideoAttachment({ type: 'video' })],
146
146
  }),
@@ -168,7 +168,7 @@ describe('ImageGallery', () => {
168
168
  it('handle handleEnd function when video item present', () => {
169
169
  const { getByA11yLabel } = render(
170
170
  getComponent({
171
- images: [
171
+ messages: [
172
172
  generateMessage({
173
173
  attachments: [generateVideoAttachment({ type: 'video' })],
174
174
  }),
@@ -71,7 +71,7 @@ describe('ImageGalleryFooter', () => {
71
71
  <ImageGalleryContext.Provider
72
72
  value={
73
73
  {
74
- images: [
74
+ messages: [
75
75
  generateMessage({
76
76
  attachments: [generateVideoAttachment({ type: 'video' })],
77
77
  }),
@@ -123,7 +123,7 @@ describe('ImageGalleryFooter', () => {
123
123
  <ImageGalleryContext.Provider
124
124
  value={
125
125
  {
126
- images: [
126
+ messages: [
127
127
  generateMessage({
128
128
  attachments: [generateVideoAttachment({ type: 'video' })],
129
129
  }),
@@ -162,7 +162,7 @@ describe('ImageGalleryFooter', () => {
162
162
  <ImageGalleryContext.Provider
163
163
  value={
164
164
  {
165
- images: [
165
+ messages: [
166
166
  generateMessage({
167
167
  attachments: [generateImageAttachment()],
168
168
  }),
@@ -76,13 +76,13 @@ describe('ImageGalleryOverlay', () => {
76
76
 
77
77
  it('should trigger the selectAndClose when the Image item is pressed', () => {
78
78
  const closeGridViewMock = jest.fn();
79
- const setImageMock = jest.fn();
79
+ const setSelectedMessageMock = jest.fn();
80
80
 
81
81
  const { getAllByA11yLabel } = render(
82
82
  getComponent({
83
83
  closeGridView: closeGridViewMock,
84
84
  photos: [generateImageAttachment(), generateVideoAttachment({ type: 'video' })],
85
- setImage: setImageMock,
85
+ setSelectedMessage: setSelectedMessageMock,
86
86
  }),
87
87
  );
88
88
 
@@ -93,6 +93,6 @@ describe('ImageGalleryOverlay', () => {
93
93
  });
94
94
 
95
95
  expect(closeGridViewMock).toHaveBeenCalledTimes(1);
96
- expect(setImageMock).toHaveBeenCalledTimes(1);
96
+ expect(setSelectedMessageMock).toHaveBeenCalledTimes(1);
97
97
  });
98
98
  });
@@ -65,7 +65,7 @@ describe('ImageGalleryHeader', () => {
65
65
  <ImageGalleryContext.Provider
66
66
  value={
67
67
  {
68
- images: [
68
+ messages: [
69
69
  generateMessage({
70
70
  attachments: [generateImageAttachment()],
71
71
  }),
@@ -109,7 +109,7 @@ describe('ImageGalleryHeader', () => {
109
109
  <ImageGalleryContext.Provider
110
110
  value={
111
111
  {
112
- images: [
112
+ messages: [
113
113
  generateMessage({
114
114
  attachments: [generateVideoAttachment({ type: 'video' })],
115
115
  }),
@@ -146,7 +146,7 @@ describe('ImageGalleryHeader', () => {
146
146
  <ImageGalleryContext.Provider
147
147
  value={
148
148
  {
149
- images: [
149
+ messages: [
150
150
  generateMessage({
151
151
  attachments: [generateImageAttachment()],
152
152
  }),
@@ -53,7 +53,7 @@ export const ImageGalleryVideoControl: React.FC<ImageGalleryFooterVideoControlPr
53
53
 
54
54
  const {
55
55
  theme: {
56
- colors: { black, white_snow },
56
+ colors: { static_black, static_white },
57
57
  imageGallery: {
58
58
  videoControl: { durationTextStyle, roundedView, videoContainer },
59
59
  },
@@ -68,23 +68,28 @@ export const ImageGalleryVideoControl: React.FC<ImageGalleryFooterVideoControlPr
68
68
  onPlayPause();
69
69
  }}
70
70
  >
71
- <View style={[styles.roundedView, roundedView, { backgroundColor: white_snow }]}>
71
+ <View style={[styles.roundedView, roundedView, { backgroundColor: static_white }]}>
72
72
  {paused ? (
73
- <Play accessibilityLabel='Play Icon' height={24} pathFill={black} width={24} />
73
+ <Play accessibilityLabel='Play Icon' height={24} pathFill={static_black} width={24} />
74
74
  ) : (
75
- <Pause accessibilityLabel='Pause Icon' height={24} width={24} />
75
+ <Pause
76
+ accessibilityLabel='Pause Icon'
77
+ height={24}
78
+ pathFill={static_black}
79
+ width={24}
80
+ />
76
81
  )}
77
82
  </View>
78
83
  </TouchableOpacity>
79
84
  <Text
80
85
  accessibilityLabel='Progress Duration'
81
- style={[styles.durationTextStyle, durationTextStyle, { color: white_snow }]}
86
+ style={[styles.durationTextStyle, durationTextStyle, { color: static_white }]}
82
87
  >
83
88
  {progressDuration ? progressDuration : '00:00'}
84
89
  </Text>
85
90
  <ProgressControl
86
91
  duration={duration}
87
- filledColor={white_snow}
92
+ filledColor={static_white}
88
93
  onPlayPause={onPlayPause}
89
94
  onProgressDrag={onProgressDrag}
90
95
  progress={progress}
@@ -93,7 +98,7 @@ export const ImageGalleryVideoControl: React.FC<ImageGalleryFooterVideoControlPr
93
98
  />
94
99
  <Text
95
100
  accessibilityLabel='Video Duration'
96
- style={[styles.durationTextStyle, durationTextStyle, { color: white_snow }]}
101
+ style={[styles.durationTextStyle, durationTextStyle, { color: static_white }]}
97
102
  >
98
103
  {videoDuration ? videoDuration : '00:00'}
99
104
  </Text>