stream-chat-react-native-core 9.4.0-beta.11 → 9.4.0-beta.12

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 (331) hide show
  1. package/lib/commonjs/components/ChannelDetails/ChannelDetails.js +8 -3
  2. package/lib/commonjs/components/ChannelDetails/ChannelDetails.js.map +1 -1
  3. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
  4. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
  5. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
  6. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
  7. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
  8. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
  9. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
  10. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
  11. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
  12. package/lib/commonjs/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
  13. package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
  14. package/lib/commonjs/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
  15. package/lib/commonjs/components/ChannelDetails/components/index.js +22 -0
  16. package/lib/commonjs/components/ChannelDetails/components/index.js.map +1 -1
  17. package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
  18. package/lib/commonjs/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
  19. package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js +22 -23
  20. package/lib/commonjs/components/ChannelDetails/components/modal/Modal.js.map +1 -1
  21. package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
  22. package/lib/commonjs/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
  23. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
  24. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
  25. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
  26. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
  27. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
  28. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
  29. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
  30. package/lib/commonjs/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
  31. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
  32. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
  33. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
  34. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
  35. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
  36. package/lib/commonjs/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
  37. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
  38. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
  39. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
  40. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
  41. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
  42. package/lib/commonjs/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
  43. package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js +114 -0
  44. package/lib/commonjs/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
  45. package/lib/commonjs/components/ChannelDetails/hooks/index.js +33 -0
  46. package/lib/commonjs/components/ChannelDetails/hooks/index.js.map +1 -1
  47. package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
  48. package/lib/commonjs/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
  49. package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
  50. package/lib/commonjs/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
  51. package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js +30 -0
  52. package/lib/commonjs/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
  53. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
  54. package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  55. package/lib/commonjs/components/UIComponents/EmptyList.js +78 -0
  56. package/lib/commonjs/components/UIComponents/EmptyList.js.map +1 -0
  57. package/lib/commonjs/components/UIComponents/index.js +11 -0
  58. package/lib/commonjs/components/UIComponents/index.js.map +1 -1
  59. package/lib/commonjs/components/ui/Avatar/AvatarGroup.js +3 -3
  60. package/lib/commonjs/components/ui/Avatar/constants.js +2 -2
  61. package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
  62. package/lib/commonjs/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
  63. package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
  64. package/lib/commonjs/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
  65. package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
  66. package/lib/commonjs/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
  67. package/lib/commonjs/contexts/componentsContext/defaultComponents.js +8 -0
  68. package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -1
  69. package/lib/commonjs/contexts/index.js +33 -0
  70. package/lib/commonjs/contexts/index.js.map +1 -1
  71. package/lib/commonjs/contexts/themeContext/utils/theme.js +57 -2
  72. package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
  73. package/lib/commonjs/i18n/ar.json +11 -0
  74. package/lib/commonjs/i18n/en.json +11 -0
  75. package/lib/commonjs/i18n/es.json +11 -0
  76. package/lib/commonjs/i18n/fr.json +11 -0
  77. package/lib/commonjs/i18n/he.json +11 -0
  78. package/lib/commonjs/i18n/hi.json +11 -0
  79. package/lib/commonjs/i18n/it.json +11 -0
  80. package/lib/commonjs/i18n/ja.json +11 -0
  81. package/lib/commonjs/i18n/ko.json +11 -0
  82. package/lib/commonjs/i18n/nl.json +11 -0
  83. package/lib/commonjs/i18n/pt-br.json +11 -0
  84. package/lib/commonjs/i18n/ru.json +11 -0
  85. package/lib/commonjs/i18n/tr.json +11 -0
  86. package/lib/commonjs/icons/folder.js +37 -0
  87. package/lib/commonjs/icons/folder.js.map +1 -0
  88. package/lib/commonjs/icons/index.js +12 -0
  89. package/lib/commonjs/icons/index.js.map +1 -1
  90. package/lib/commonjs/version.json +1 -1
  91. package/lib/module/components/ChannelDetails/ChannelDetails.js +8 -3
  92. package/lib/module/components/ChannelDetails/ChannelDetails.js.map +1 -1
  93. package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js +2 -1
  94. package/lib/module/components/ChannelDetails/components/ChannelDetailsActionItem.js.map +1 -1
  95. package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js +57 -0
  96. package/lib/module/components/ChannelDetails/components/ChannelDetailsEditButton.js.map +1 -0
  97. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js +3 -32
  98. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavHeader.js.map +1 -1
  99. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js +64 -25
  100. package/lib/module/components/ChannelDetails/components/ChannelDetailsNavigationSection.js.map +1 -1
  101. package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js +3 -2
  102. package/lib/module/components/ChannelDetails/components/ChannelDetailsProfile.js.map +1 -1
  103. package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js +2 -2
  104. package/lib/module/components/ChannelDetails/components/ChannelEditImageSheet.js.map +1 -1
  105. package/lib/module/components/ChannelDetails/components/index.js +22 -0
  106. package/lib/module/components/ChannelDetails/components/index.js.map +1 -1
  107. package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js +2 -1
  108. package/lib/module/components/ChannelDetails/components/members/ChannelMemberItem.js.map +1 -1
  109. package/lib/module/components/ChannelDetails/components/modal/Modal.js +22 -23
  110. package/lib/module/components/ChannelDetails/components/modal/Modal.js.map +1 -1
  111. package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js +6 -4
  112. package/lib/module/components/ChannelDetails/components/modal/ModalHeader.js.map +1 -1
  113. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js +65 -0
  114. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentItem.js.map +1 -0
  115. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js +174 -0
  116. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentList.js.map +1 -0
  117. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js +21 -0
  118. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.js.map +1 -0
  119. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js +45 -0
  120. package/lib/module/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.js.map +1 -0
  121. package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js +120 -0
  122. package/lib/module/components/ChannelDetails/components/navigation-section/MediaItem.js.map +1 -0
  123. package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js +206 -0
  124. package/lib/module/components/ChannelDetails/components/navigation-section/MediaList.js.map +1 -0
  125. package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js +63 -0
  126. package/lib/module/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.js.map +1 -0
  127. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js +84 -0
  128. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageItem.js.map +1 -0
  129. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js +177 -0
  130. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageList.js.map +1 -0
  131. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js +21 -0
  132. package/lib/module/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.js.map +1 -0
  133. package/lib/module/components/ChannelDetails/components/navigation-section/index.js +114 -0
  134. package/lib/module/components/ChannelDetails/components/navigation-section/index.js.map +1 -0
  135. package/lib/module/components/ChannelDetails/hooks/index.js +33 -0
  136. package/lib/module/components/ChannelDetails/hooks/index.js.map +1 -1
  137. package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js +55 -0
  138. package/lib/module/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.js.map +1 -0
  139. package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js +52 -0
  140. package/lib/module/components/ChannelDetails/hooks/useFileAttachmentListSections.js.map +1 -0
  141. package/lib/module/components/ChannelDetails/hooks/useMediaList.js +30 -0
  142. package/lib/module/components/ChannelDetails/hooks/useMediaList.js.map +1 -0
  143. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +23 -15
  144. package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
  145. package/lib/module/components/UIComponents/EmptyList.js +78 -0
  146. package/lib/module/components/UIComponents/EmptyList.js.map +1 -0
  147. package/lib/module/components/UIComponents/index.js +11 -0
  148. package/lib/module/components/UIComponents/index.js.map +1 -1
  149. package/lib/module/components/ui/Avatar/AvatarGroup.js +3 -3
  150. package/lib/module/components/ui/Avatar/constants.js +2 -2
  151. package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js +64 -0
  152. package/lib/module/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.js.map +1 -0
  153. package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js +63 -0
  154. package/lib/module/contexts/channelMediaListContext/ChannelMediaListContext.js.map +1 -0
  155. package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js +73 -0
  156. package/lib/module/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.js.map +1 -0
  157. package/lib/module/contexts/componentsContext/defaultComponents.js +8 -0
  158. package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -1
  159. package/lib/module/contexts/index.js +33 -0
  160. package/lib/module/contexts/index.js.map +1 -1
  161. package/lib/module/contexts/themeContext/utils/theme.js +57 -2
  162. package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
  163. package/lib/module/i18n/ar.json +11 -0
  164. package/lib/module/i18n/en.json +11 -0
  165. package/lib/module/i18n/es.json +11 -0
  166. package/lib/module/i18n/fr.json +11 -0
  167. package/lib/module/i18n/he.json +11 -0
  168. package/lib/module/i18n/hi.json +11 -0
  169. package/lib/module/i18n/it.json +11 -0
  170. package/lib/module/i18n/ja.json +11 -0
  171. package/lib/module/i18n/ko.json +11 -0
  172. package/lib/module/i18n/nl.json +11 -0
  173. package/lib/module/i18n/pt-br.json +11 -0
  174. package/lib/module/i18n/ru.json +11 -0
  175. package/lib/module/i18n/tr.json +11 -0
  176. package/lib/module/icons/folder.js +37 -0
  177. package/lib/module/icons/folder.js.map +1 -0
  178. package/lib/module/icons/index.js +12 -0
  179. package/lib/module/icons/index.js.map +1 -1
  180. package/lib/module/version.json +1 -1
  181. package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts +11 -1
  182. package/lib/typescript/components/ChannelDetails/ChannelDetails.d.ts.map +1 -1
  183. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsActionItem.d.ts.map +1 -1
  184. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts +6 -0
  185. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsEditButton.d.ts.map +1 -0
  186. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts +3 -1
  187. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavHeader.d.ts.map +1 -1
  188. package/lib/typescript/components/ChannelDetails/components/ChannelDetailsNavigationSection.d.ts.map +1 -1
  189. package/lib/typescript/components/ChannelDetails/components/index.d.ts +3 -0
  190. package/lib/typescript/components/ChannelDetails/components/index.d.ts.map +1 -1
  191. package/lib/typescript/components/ChannelDetails/components/members/ChannelMemberItem.d.ts.map +1 -1
  192. package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts +2 -1
  193. package/lib/typescript/components/ChannelDetails/components/modal/Modal.d.ts.map +1 -1
  194. package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts +3 -1
  195. package/lib/typescript/components/ChannelDetails/components/modal/ModalHeader.d.ts.map +1 -1
  196. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts +31 -0
  197. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentItem.d.ts.map +1 -0
  198. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts +17 -0
  199. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentList.d.ts.map +1 -0
  200. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts +9 -0
  201. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.d.ts.map +1 -0
  202. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts +13 -0
  203. package/lib/typescript/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.d.ts.map +1 -0
  204. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts +35 -0
  205. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaItem.d.ts.map +1 -0
  206. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts +17 -0
  207. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaList.d.ts.map +1 -0
  208. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts +11 -0
  209. package/lib/typescript/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.d.ts.map +1 -0
  210. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts +19 -0
  211. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageItem.d.ts.map +1 -0
  212. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts +19 -0
  213. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageList.d.ts.map +1 -0
  214. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts +9 -0
  215. package/lib/typescript/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.d.ts.map +1 -0
  216. package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts +11 -0
  217. package/lib/typescript/components/ChannelDetails/components/navigation-section/index.d.ts.map +1 -0
  218. package/lib/typescript/components/ChannelDetails/hooks/index.d.ts +3 -0
  219. package/lib/typescript/components/ChannelDetails/hooks/index.d.ts.map +1 -1
  220. package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts +56 -0
  221. package/lib/typescript/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.d.ts.map +1 -0
  222. package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts +28 -0
  223. package/lib/typescript/components/ChannelDetails/hooks/useFileAttachmentListSections.d.ts.map +1 -0
  224. package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts +20 -0
  225. package/lib/typescript/components/ChannelDetails/hooks/useMediaList.d.ts.map +1 -0
  226. package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
  227. package/lib/typescript/components/UIComponents/EmptyList.d.ts +24 -0
  228. package/lib/typescript/components/UIComponents/EmptyList.d.ts.map +1 -0
  229. package/lib/typescript/components/UIComponents/index.d.ts +1 -0
  230. package/lib/typescript/components/UIComponents/index.d.ts.map +1 -1
  231. package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts +21 -0
  232. package/lib/typescript/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.d.ts.map +1 -0
  233. package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts +21 -0
  234. package/lib/typescript/contexts/channelMediaListContext/ChannelMediaListContext.d.ts.map +1 -0
  235. package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts +21 -0
  236. package/lib/typescript/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.d.ts.map +1 -0
  237. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +18 -2
  238. package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -1
  239. package/lib/typescript/contexts/index.d.ts +3 -0
  240. package/lib/typescript/contexts/index.d.ts.map +1 -1
  241. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts +56 -1
  242. package/lib/typescript/contexts/themeContext/ThemeContext.d.ts.map +1 -1
  243. package/lib/typescript/contexts/themeContext/utils/theme.d.ts +56 -1
  244. package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
  245. package/lib/typescript/i18n/ar.json +11 -0
  246. package/lib/typescript/i18n/en.json +11 -0
  247. package/lib/typescript/i18n/es.json +11 -0
  248. package/lib/typescript/i18n/fr.json +11 -0
  249. package/lib/typescript/i18n/he.json +11 -0
  250. package/lib/typescript/i18n/hi.json +11 -0
  251. package/lib/typescript/i18n/it.json +11 -0
  252. package/lib/typescript/i18n/ja.json +11 -0
  253. package/lib/typescript/i18n/ko.json +11 -0
  254. package/lib/typescript/i18n/nl.json +11 -0
  255. package/lib/typescript/i18n/pt-br.json +11 -0
  256. package/lib/typescript/i18n/ru.json +11 -0
  257. package/lib/typescript/i18n/tr.json +11 -0
  258. package/lib/typescript/icons/folder.d.ts +4 -0
  259. package/lib/typescript/icons/folder.d.ts.map +1 -0
  260. package/lib/typescript/icons/index.d.ts +1 -0
  261. package/lib/typescript/icons/index.d.ts.map +1 -1
  262. package/lib/typescript/utils/i18n/Streami18n.d.ts +11 -0
  263. package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
  264. package/package.json +1 -1
  265. package/src/components/ChannelDetails/ChannelDetails.tsx +17 -2
  266. package/src/components/ChannelDetails/__tests__/ChannelDetails.test.tsx +29 -0
  267. package/src/components/ChannelDetails/__tests__/ChannelDetailsEditButton.test.tsx +127 -0
  268. package/src/components/ChannelDetails/__tests__/ChannelDetailsNavHeader.test.tsx +21 -56
  269. package/src/components/ChannelDetails/__tests__/ChannelDetailsNavigationSection.test.tsx +225 -6
  270. package/src/components/ChannelDetails/__tests__/useFileAttachmentListSections.test.tsx +159 -0
  271. package/src/components/ChannelDetails/__tests__/useMediaList.test.tsx +53 -0
  272. package/src/components/ChannelDetails/components/ChannelDetailsActionItem.tsx +6 -1
  273. package/src/components/ChannelDetails/components/ChannelDetailsEditButton.tsx +50 -0
  274. package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx +6 -33
  275. package/src/components/ChannelDetails/components/ChannelDetailsNavigationSection.tsx +80 -32
  276. package/src/components/ChannelDetails/components/ChannelDetailsProfile.tsx +2 -1
  277. package/src/components/ChannelDetails/components/ChannelEditImageSheet.tsx +2 -2
  278. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentItem.test.tsx +80 -0
  279. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentList.test.tsx +334 -0
  280. package/src/components/ChannelDetails/components/__tests__/navigation-section/FileAttachmentListSectionHeader.test.tsx +19 -0
  281. package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaItem.test.tsx +97 -0
  282. package/src/components/ChannelDetails/components/__tests__/navigation-section/MediaList.test.tsx +351 -0
  283. package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageItem.test.tsx +112 -0
  284. package/src/components/ChannelDetails/components/__tests__/navigation-section/PinnedMessageList.test.tsx +324 -0
  285. package/src/components/ChannelDetails/components/index.ts +3 -0
  286. package/src/components/ChannelDetails/components/members/ChannelMemberItem.tsx +6 -1
  287. package/src/components/ChannelDetails/components/modal/Modal.tsx +37 -24
  288. package/src/components/ChannelDetails/components/modal/ModalHeader.tsx +11 -4
  289. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentItem.tsx +92 -0
  290. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentList.tsx +204 -0
  291. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListLoadingSkeleton.tsx +23 -0
  292. package/src/components/ChannelDetails/components/navigation-section/FileAttachmentListSectionHeader.tsx +56 -0
  293. package/src/components/ChannelDetails/components/navigation-section/MediaItem.tsx +160 -0
  294. package/src/components/ChannelDetails/components/navigation-section/MediaList.tsx +244 -0
  295. package/src/components/ChannelDetails/components/navigation-section/MediaListLoadingSkeleton.tsx +66 -0
  296. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageItem.tsx +94 -0
  297. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageList.tsx +198 -0
  298. package/src/components/ChannelDetails/components/navigation-section/PinnedMessageListLoadingSkeleton.tsx +23 -0
  299. package/src/components/ChannelDetails/components/navigation-section/index.ts +10 -0
  300. package/src/components/ChannelDetails/hooks/index.ts +3 -0
  301. package/src/components/ChannelDetails/hooks/useChannelDetailsNavigationItems.ts +108 -0
  302. package/src/components/ChannelDetails/hooks/useFileAttachmentListSections.ts +79 -0
  303. package/src/components/ChannelDetails/hooks/useMediaList.ts +51 -0
  304. package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +21 -18
  305. package/src/components/UIComponents/EmptyList.tsx +80 -0
  306. package/src/components/UIComponents/__tests__/EmptyList.test.tsx +90 -0
  307. package/src/components/UIComponents/index.ts +1 -0
  308. package/src/components/ui/Avatar/AvatarGroup.tsx +3 -3
  309. package/src/components/ui/Avatar/constants.ts +2 -2
  310. package/src/contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext.tsx +67 -0
  311. package/src/contexts/channelMediaListContext/ChannelMediaListContext.tsx +68 -0
  312. package/src/contexts/channelPinnedMessageListContext/ChannelPinnedMessageListContext.tsx +72 -0
  313. package/src/contexts/componentsContext/defaultComponents.ts +16 -1
  314. package/src/contexts/index.ts +3 -0
  315. package/src/contexts/themeContext/utils/theme.ts +112 -2
  316. package/src/i18n/ar.json +11 -0
  317. package/src/i18n/en.json +11 -0
  318. package/src/i18n/es.json +11 -0
  319. package/src/i18n/fr.json +11 -0
  320. package/src/i18n/he.json +11 -0
  321. package/src/i18n/hi.json +11 -0
  322. package/src/i18n/it.json +11 -0
  323. package/src/i18n/ja.json +11 -0
  324. package/src/i18n/ko.json +11 -0
  325. package/src/i18n/nl.json +11 -0
  326. package/src/i18n/pt-br.json +11 -0
  327. package/src/i18n/ru.json +11 -0
  328. package/src/i18n/tr.json +11 -0
  329. package/src/icons/folder.tsx +28 -0
  330. package/src/icons/index.ts +1 -0
  331. package/src/version.json +1 -1
@@ -0,0 +1,334 @@
1
+ import React from 'react';
2
+
3
+ import { render, screen } from '@testing-library/react-native';
4
+
5
+ import Dayjs from 'dayjs';
6
+ import { StateStore } from 'stream-chat';
7
+ import type { MessageResponse, SearchSourceState } from 'stream-chat';
8
+
9
+ import {
10
+ ChannelDetailsContextProvider,
11
+ type ChannelDetailsContextValue,
12
+ } from '../../../../../contexts/channelDetailsContext/channelDetailsContext';
13
+ import { ThemeProvider } from '../../../../../contexts/themeContext/ThemeContext';
14
+ import { defaultTheme } from '../../../../../contexts/themeContext/utils/theme';
15
+ import {
16
+ TranslationProvider,
17
+ type TranslationContextValue,
18
+ } from '../../../../../contexts/translationContext/TranslationContext';
19
+ import { generateFileAttachment } from '../../../../../mock-builders/generator/attachment';
20
+ import { generateMessage } from '../../../../../mock-builders/generator/message';
21
+ import { Streami18n } from '../../../../../utils/i18n/Streami18n';
22
+ import type { FileAttachmentItemProps } from '../../navigation-section/FileAttachmentItem';
23
+ import { FileAttachmentList } from '../../navigation-section/FileAttachmentList';
24
+
25
+ const mockRowProbe: FileAttachmentItemProps[] = [];
26
+
27
+ type FakeSearchSource = {
28
+ search: jest.Mock;
29
+ state: StateStore<
30
+ Pick<
31
+ SearchSourceState<MessageResponse>,
32
+ 'hasNext' | 'isLoading' | 'items' | 'lastQueryError' | 'searchQuery'
33
+ >
34
+ >;
35
+ };
36
+
37
+ const mockChannel = { cid: 'messaging:1' };
38
+ let mockCurrentSearchSource: FakeSearchSource;
39
+ const mockProviderProbe: { channel: unknown }[] = [];
40
+ const mockNotificationTargetProbe: { hostId?: string; panel?: string }[] = [];
41
+ const mockAddNotification = jest.fn();
42
+
43
+ jest.mock('../../../../Notifications/hooks/useNotificationApi', () => ({
44
+ useNotificationApi: () => ({ addNotification: mockAddNotification }),
45
+ }));
46
+
47
+ jest.mock('../../../../Notifications/NotificationTargetContext', () => ({
48
+ NotificationTargetProvider: ({
49
+ children,
50
+ hostId,
51
+ panel,
52
+ }: {
53
+ children: React.ReactNode;
54
+ hostId?: string;
55
+ panel?: string;
56
+ }) => {
57
+ mockNotificationTargetProbe.push({ hostId, panel });
58
+ return children;
59
+ },
60
+ }));
61
+
62
+ jest.mock('../../../../Notifications/NotificationList', () => {
63
+ const ReactLib = require('react');
64
+ const { View } = require('react-native');
65
+ return {
66
+ NotificationList: () => ReactLib.createElement(View, { testID: 'notification-list' }),
67
+ };
68
+ });
69
+
70
+ jest.mock(
71
+ '../../../../../contexts/channelFileAttachmentListContext/ChannelFileAttachmentListContext',
72
+ () => ({
73
+ ChannelFileAttachmentListProvider: ({
74
+ channel: providedChannel,
75
+ children,
76
+ }: {
77
+ channel: unknown;
78
+ children: React.ReactNode;
79
+ }) => {
80
+ mockProviderProbe.push({ channel: providedChannel });
81
+ return children;
82
+ },
83
+ useChannelFileAttachmentListContext: () => ({
84
+ channel: mockChannel,
85
+ searchSource: mockCurrentSearchSource,
86
+ }),
87
+ }),
88
+ );
89
+
90
+ jest.mock('../../navigation-section/FileAttachmentItem', () => {
91
+ const ReactLib = require('react');
92
+ const { Text } = require('react-native');
93
+ return {
94
+ FileAttachmentItem: (props: FileAttachmentItemProps) => {
95
+ mockRowProbe.push(props);
96
+ return ReactLib.createElement(
97
+ Text,
98
+ { testID: `file-row-${props.message.id}` },
99
+ props.message.id,
100
+ );
101
+ },
102
+ };
103
+ });
104
+
105
+ const makeSearchSource = (
106
+ overrides: Partial<{
107
+ hasNext: boolean;
108
+ isLoading: boolean;
109
+ items: MessageResponse[];
110
+ lastQueryError: Error;
111
+ }> = {},
112
+ ): FakeSearchSource => ({
113
+ search: jest.fn(),
114
+ state: new StateStore({
115
+ hasNext: overrides.hasNext ?? false,
116
+ isLoading: overrides.isLoading ?? false,
117
+ items: overrides.items,
118
+ searchQuery: '',
119
+ ...(overrides.lastQueryError ? { lastQueryError: overrides.lastQueryError } : {}),
120
+ }),
121
+ });
122
+
123
+ const fakeTranslators = {
124
+ t: ((key: string) => key) as never,
125
+ tDateTimeParser: ((input: unknown) => Dayjs(input as string)) as never,
126
+ userLanguage: 'en',
127
+ } as unknown as TranslationContextValue;
128
+
129
+ const tree = (
130
+ searchSource: FakeSearchSource,
131
+ props: { additionalSectionListProps?: object; translators?: TranslationContextValue } = {},
132
+ ) => {
133
+ mockCurrentSearchSource = searchSource;
134
+ return (
135
+ <ThemeProvider theme={defaultTheme}>
136
+ <TranslationProvider value={props.translators ?? fakeTranslators}>
137
+ <ChannelDetailsContextProvider
138
+ value={{ channel: mockChannel } as unknown as ChannelDetailsContextValue}
139
+ >
140
+ <FileAttachmentList
141
+ additionalSectionListProps={props.additionalSectionListProps as never}
142
+ />
143
+ </ChannelDetailsContextProvider>
144
+ </TranslationProvider>
145
+ </ThemeProvider>
146
+ );
147
+ };
148
+
149
+ describe('FileAttachmentList', () => {
150
+ let realTranslators: TranslationContextValue;
151
+
152
+ beforeAll(async () => {
153
+ const i18nInstance = new Streami18n();
154
+ realTranslators = (await i18nInstance.getTranslators()) as unknown as TranslationContextValue;
155
+ });
156
+
157
+ beforeEach(() => {
158
+ mockRowProbe.length = 0;
159
+ mockProviderProbe.length = 0;
160
+ mockNotificationTargetProbe.length = 0;
161
+ });
162
+
163
+ afterEach(() => jest.clearAllMocks());
164
+
165
+ it('wraps its content in the file attachment list provider for the channel', () => {
166
+ render(tree(makeSearchSource()));
167
+
168
+ expect(mockProviderProbe).toHaveLength(1);
169
+ expect(mockProviderProbe[0].channel).toBe(mockChannel);
170
+ });
171
+
172
+ it('calls search when the component is created', () => {
173
+ const searchSource = makeSearchSource();
174
+ render(tree(searchSource));
175
+
176
+ expect(searchSource.search).toHaveBeenCalledTimes(1);
177
+ expect(searchSource.search).toHaveBeenCalledWith();
178
+ });
179
+
180
+ it('does not render a search input', () => {
181
+ render(
182
+ tree(
183
+ makeSearchSource({
184
+ items: [generateMessage({ id: 'm-1' }) as unknown as MessageResponse],
185
+ }),
186
+ ),
187
+ );
188
+
189
+ expect(screen.queryByPlaceholderText('Search')).toBeNull();
190
+ });
191
+
192
+ it('renders a row per attachment', () => {
193
+ const messageA = generateMessage({
194
+ attachments: [generateFileAttachment()] as never,
195
+ created_at: new Date('2026-03-15T00:00:00.000Z'),
196
+ id: 'm-1',
197
+ }) as unknown as MessageResponse;
198
+ const messageB = generateMessage({
199
+ attachments: [generateFileAttachment()] as never,
200
+ created_at: new Date('2026-03-16T00:00:00.000Z'),
201
+ id: 'm-2',
202
+ }) as unknown as MessageResponse;
203
+
204
+ render(tree(makeSearchSource({ items: [messageA, messageB] })));
205
+
206
+ // The probe accumulates across re-renders, so assert on distinct rows instead of call count.
207
+ expect(new Set(mockRowProbe.map((p) => p.message.id))).toEqual(new Set(['m-1', 'm-2']));
208
+ expect(screen.getByTestId('file-row-m-1')).toBeTruthy();
209
+ expect(screen.getByTestId('file-row-m-2')).toBeTruthy();
210
+ });
211
+
212
+ it('groups messages under month section headers in newest-first order', () => {
213
+ const march = generateMessage({
214
+ attachments: [generateFileAttachment()] as never,
215
+ created_at: new Date('2026-03-15T00:00:00.000Z'),
216
+ id: 'm-mar',
217
+ }) as unknown as MessageResponse;
218
+ const february = generateMessage({
219
+ attachments: [generateFileAttachment()] as never,
220
+ created_at: new Date('2026-02-10T00:00:00.000Z'),
221
+ id: 'm-feb',
222
+ }) as unknown as MessageResponse;
223
+
224
+ // The search source returns messages newest-first; the component groups them by month.
225
+ render(tree(makeSearchSource({ items: [march, february] }), { translators: realTranslators }));
226
+
227
+ const marchHeader = screen.getByText('March 2026');
228
+ const februaryHeader = screen.getByText('February 2026');
229
+ expect(marchHeader).toBeTruthy();
230
+ expect(februaryHeader).toBeTruthy();
231
+ });
232
+
233
+ it('shows the loading skeleton on the initial load', () => {
234
+ render(tree(makeSearchSource({ isLoading: true })));
235
+ expect(screen.getByTestId('file-attachment-list-loading-skeleton')).toBeTruthy();
236
+ });
237
+
238
+ it('shows the empty list when there are no files', () => {
239
+ render(tree(makeSearchSource({ isLoading: false, items: [] })));
240
+
241
+ expect(screen.getByTestId('empty-list')).toBeTruthy();
242
+ expect(screen.getByText('No files')).toBeTruthy();
243
+ expect(screen.getByText('Share a file to see it here')).toBeTruthy();
244
+ });
245
+
246
+ it('renders the loading-more indicator only while loading with existing results', () => {
247
+ render(
248
+ tree(
249
+ makeSearchSource({
250
+ isLoading: true,
251
+ items: [generateMessage({ id: 'm-1' }) as unknown as MessageResponse],
252
+ }),
253
+ ),
254
+ );
255
+ expect(screen.UNSAFE_getByType(require('react-native').ActivityIndicator)).toBeTruthy();
256
+ });
257
+
258
+ it('loads more via the search source when the list end is reached and there is a next page', () => {
259
+ const searchSource = makeSearchSource({
260
+ hasNext: true,
261
+ items: [generateMessage({ id: 'm-1' }) as unknown as MessageResponse],
262
+ });
263
+ render(tree(searchSource));
264
+ searchSource.search.mockClear();
265
+
266
+ const list = screen.getByTestId('file-attachment-list');
267
+ expect(list.props.onEndReachedThreshold).toBe(0.2);
268
+ list.props.onEndReached();
269
+ expect(searchSource.search).toHaveBeenCalledTimes(1);
270
+ });
271
+
272
+ it('does not load more when there is no next page', () => {
273
+ const searchSource = makeSearchSource({
274
+ hasNext: false,
275
+ items: [generateMessage({ id: 'm-1' }) as unknown as MessageResponse],
276
+ });
277
+ render(tree(searchSource));
278
+ searchSource.search.mockClear();
279
+
280
+ screen.getByTestId('file-attachment-list').props.onEndReached();
281
+ expect(searchSource.search).not.toHaveBeenCalled();
282
+ });
283
+
284
+ it('forwards additionalSectionListProps to the underlying list', () => {
285
+ render(
286
+ tree(
287
+ makeSearchSource({ items: [generateMessage({ id: 'm-1' }) as unknown as MessageResponse] }),
288
+ { additionalSectionListProps: { bounces: false, testID: 'custom-list' } },
289
+ ),
290
+ );
291
+
292
+ const list = screen.getByTestId('custom-list');
293
+ expect(list.props.bounces).toBe(false);
294
+ expect(screen.queryByTestId('file-attachment-list')).toBeNull();
295
+ });
296
+
297
+ it('targets the channel-details panel with a channel-scoped notification host', () => {
298
+ render(tree(makeSearchSource()));
299
+
300
+ expect(mockNotificationTargetProbe).toHaveLength(1);
301
+ expect(mockNotificationTargetProbe[0]).toEqual({
302
+ hostId: 'file-attachment-list:messaging:1',
303
+ panel: 'channel-details',
304
+ });
305
+ });
306
+
307
+ it('renders the notification list host', () => {
308
+ render(tree(makeSearchSource()));
309
+
310
+ expect(screen.getByTestId('notification-list')).toBeTruthy();
311
+ });
312
+
313
+ it('adds an error notification when the search source reports a query error', () => {
314
+ const lastQueryError = new Error('boom');
315
+ render(tree(makeSearchSource({ lastQueryError })));
316
+
317
+ expect(mockAddNotification).toHaveBeenCalledTimes(1);
318
+ expect(mockAddNotification).toHaveBeenCalledWith({
319
+ message: 'Failed to load files',
320
+ options: {
321
+ originalError: lastQueryError,
322
+ severity: 'error',
323
+ type: 'api:channel:query-file-attachments:failed',
324
+ },
325
+ origin: { context: { channel: mockChannel }, emitter: 'ChannelFileAttachmentList' },
326
+ });
327
+ });
328
+
329
+ it('does not add a notification when there is no query error', () => {
330
+ render(tree(makeSearchSource()));
331
+
332
+ expect(mockAddNotification).not.toHaveBeenCalled();
333
+ });
334
+ });
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ import { render, screen } from '@testing-library/react-native';
4
+
5
+ import { ThemeProvider } from '../../../../../contexts/themeContext/ThemeContext';
6
+ import { defaultTheme } from '../../../../../contexts/themeContext/utils/theme';
7
+ import { FileAttachmentListSectionHeader } from '../../navigation-section/FileAttachmentListSectionHeader';
8
+
9
+ describe('FileAttachmentListSectionHeader', () => {
10
+ it('renders the provided title', () => {
11
+ render(
12
+ <ThemeProvider theme={defaultTheme}>
13
+ <FileAttachmentListSectionHeader title='March 2026' />
14
+ </ThemeProvider>,
15
+ );
16
+
17
+ expect(screen.getByText('March 2026')).toBeTruthy();
18
+ });
19
+ });
@@ -0,0 +1,97 @@
1
+ import React from 'react';
2
+
3
+ import { fireEvent, render, screen } from '@testing-library/react-native';
4
+ import type { Attachment, MessageResponse } from 'stream-chat';
5
+
6
+ import { ThemeProvider } from '../../../../../contexts/themeContext/ThemeContext';
7
+ import { defaultTheme } from '../../../../../contexts/themeContext/utils/theme';
8
+ import { TranslationProvider } from '../../../../../contexts/translationContext/TranslationContext';
9
+ import {
10
+ generateImageAttachment,
11
+ generateVideoAttachment,
12
+ } from '../../../../../mock-builders/generator/attachment';
13
+ import { generateMessage } from '../../../../../mock-builders/generator/message';
14
+ import { generateUser } from '../../../../../mock-builders/generator/user';
15
+ import { MediaItem, type MediaItemProps } from '../../navigation-section/MediaItem';
16
+
17
+ const renderItem = (props: Partial<MediaItemProps> & { attachment: Attachment }) =>
18
+ render(
19
+ <ThemeProvider theme={defaultTheme}>
20
+ <TranslationProvider
21
+ value={{
22
+ t: ((key: string) => key) as never,
23
+ tDateTimeParser: ((input: unknown) => input) as never,
24
+ userLanguage: 'en',
25
+ }}
26
+ >
27
+ <MediaItem
28
+ attachment={props.attachment}
29
+ message={props.message ?? (generateMessage({ id: 'm-1' }) as unknown as MessageResponse)}
30
+ onPress={props.onPress}
31
+ size={120}
32
+ />
33
+ </TranslationProvider>
34
+ </ThemeProvider>,
35
+ );
36
+
37
+ describe('MediaItem', () => {
38
+ afterEach(() => jest.clearAllMocks());
39
+
40
+ it('renders the thumbnail from the attachment url', () => {
41
+ renderItem({
42
+ attachment: generateImageAttachment({ thumb_url: 'https://example.com/a.jpg' }),
43
+ });
44
+
45
+ expect(screen.getByTestId('media-item-thumbnail').props.source.uri).toBe(
46
+ 'https://example.com/a.jpg',
47
+ );
48
+ });
49
+
50
+ it("renders the sender's avatar overlay", () => {
51
+ renderItem({
52
+ attachment: generateImageAttachment({ thumb_url: 'https://example.com/a.jpg' }),
53
+ message: generateMessage({
54
+ id: 'm-1',
55
+ user: generateUser({ id: 'u-1', name: 'Maya Ross' }),
56
+ }) as unknown as MessageResponse,
57
+ });
58
+
59
+ expect(screen.getByTestId('user-avatar')).toBeTruthy();
60
+ });
61
+
62
+ it('renders the duration badge for video attachments', () => {
63
+ renderItem({
64
+ attachment: generateVideoAttachment({ duration: 8000 }),
65
+ });
66
+
67
+ expect(screen.getByText('0:08')).toBeTruthy();
68
+ });
69
+
70
+ it('does not render a duration badge for image attachments', () => {
71
+ renderItem({
72
+ attachment: generateImageAttachment({ thumb_url: 'https://example.com/a.jpg' }),
73
+ });
74
+
75
+ expect(screen.queryByText('0:08')).toBeNull();
76
+ });
77
+
78
+ it('fires onPress with the attachment and message', () => {
79
+ const onPress = jest.fn();
80
+ const attachment = generateImageAttachment({ thumb_url: 'https://example.com/a.jpg' });
81
+ const message = generateMessage({ id: 'm-1' }) as unknown as MessageResponse;
82
+
83
+ renderItem({ attachment, message, onPress });
84
+
85
+ fireEvent.press(screen.getByTestId('media-item-m-1'));
86
+ expect(onPress).toHaveBeenCalledWith(expect.objectContaining({ attachment, message }));
87
+ });
88
+
89
+ it('renders a tile keyed by the message id', () => {
90
+ renderItem({
91
+ attachment: generateImageAttachment({ thumb_url: 'https://example.com/a.jpg' }),
92
+ message: generateMessage({ id: 'm-99' }) as unknown as MessageResponse,
93
+ });
94
+
95
+ expect(screen.getByTestId('media-item-m-99')).toBeTruthy();
96
+ });
97
+ });