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,351 @@
1
+ import React from 'react';
2
+
3
+ import { fireEvent, render, screen } from '@testing-library/react-native';
4
+ import { StateStore } from 'stream-chat';
5
+ import type { MessageResponse, SearchSourceState } from 'stream-chat';
6
+
7
+ import {
8
+ ChannelDetailsContextProvider,
9
+ type ChannelDetailsContextValue,
10
+ } from '../../../../../contexts/channelDetailsContext/channelDetailsContext';
11
+ import { ThemeProvider } from '../../../../../contexts/themeContext/ThemeContext';
12
+ import { defaultTheme } from '../../../../../contexts/themeContext/utils/theme';
13
+ import { TranslationProvider } from '../../../../../contexts/translationContext/TranslationContext';
14
+ import {
15
+ generateImageAttachment,
16
+ generateVideoAttachment,
17
+ } from '../../../../../mock-builders/generator/attachment';
18
+ import { generateMessage } from '../../../../../mock-builders/generator/message';
19
+ import type { MediaItemProps } from '../../navigation-section/MediaItem';
20
+ import { MediaList } from '../../navigation-section/MediaList';
21
+
22
+ const mockTileProbe: MediaItemProps[] = [];
23
+
24
+ const mockOpenImageGallery = jest.fn();
25
+ const mockImageGalleryStateStore = { openImageGallery: mockOpenImageGallery };
26
+ const mockSetOverlay = jest.fn();
27
+ const mockIsVideoPlayerAvailable = jest.fn(() => true);
28
+ const mockOpenUrlSafely = jest.fn();
29
+
30
+ jest.mock('../../../../../contexts/imageGalleryContext/ImageGalleryContext', () => ({
31
+ ...jest.requireActual('../../../../../contexts/imageGalleryContext/ImageGalleryContext'),
32
+ useImageGalleryContext: () => ({ imageGalleryStateStore: mockImageGalleryStateStore }),
33
+ }));
34
+
35
+ jest.mock('../../../../../contexts/overlayContext/OverlayContext', () => ({
36
+ ...jest.requireActual('../../../../../contexts/overlayContext/OverlayContext'),
37
+ useOverlayContext: () => ({ setOverlay: mockSetOverlay }),
38
+ }));
39
+
40
+ jest.mock('../../../../../native', () => ({
41
+ ...jest.requireActual('../../../../../native'),
42
+ isVideoPlayerAvailable: () => mockIsVideoPlayerAvailable(),
43
+ }));
44
+
45
+ jest.mock('../../../../Attachment/utils/openUrlSafely', () => ({
46
+ openUrlSafely: (...args: unknown[]) => mockOpenUrlSafely(...args),
47
+ }));
48
+
49
+ type FakeSearchSource = {
50
+ search: jest.Mock;
51
+ state: StateStore<
52
+ Pick<SearchSourceState<MessageResponse>, 'hasNext' | 'isLoading' | 'items' | 'lastQueryError'>
53
+ >;
54
+ };
55
+
56
+ const mockChannel = { cid: 'messaging:1' };
57
+ let mockCurrentSearchSource: FakeSearchSource;
58
+ const mockProviderProbe: { channel: unknown }[] = [];
59
+ const mockNotificationTargetProbe: { hostId?: string; panel?: string }[] = [];
60
+ const mockAddNotification = jest.fn();
61
+
62
+ jest.mock('../../../../Notifications/hooks/useNotificationApi', () => ({
63
+ useNotificationApi: () => ({ addNotification: mockAddNotification }),
64
+ }));
65
+
66
+ jest.mock('../../../../Notifications/NotificationTargetContext', () => ({
67
+ NotificationTargetProvider: ({
68
+ children,
69
+ hostId,
70
+ panel,
71
+ }: {
72
+ children: React.ReactNode;
73
+ hostId?: string;
74
+ panel?: string;
75
+ }) => {
76
+ mockNotificationTargetProbe.push({ hostId, panel });
77
+ return children;
78
+ },
79
+ }));
80
+
81
+ jest.mock('../../../../Notifications/NotificationList', () => {
82
+ const ReactLib = require('react');
83
+ const { View } = require('react-native');
84
+ return {
85
+ NotificationList: () => ReactLib.createElement(View, { testID: 'notification-list' }),
86
+ };
87
+ });
88
+
89
+ jest.mock('../../../../../contexts/channelMediaListContext/ChannelMediaListContext', () => {
90
+ const actual = jest.requireActual(
91
+ '../../../../../contexts/channelMediaListContext/ChannelMediaListContext',
92
+ );
93
+ const ReactLib = require('react');
94
+ return {
95
+ ...actual,
96
+ // Inject a fake search source through the real context so MediaListContent can read it via
97
+ // the real `useChannelMediaListContext`.
98
+ ChannelMediaListProvider: ({
99
+ channel: providedChannel,
100
+ children,
101
+ }: {
102
+ channel: unknown;
103
+ children: React.ReactNode;
104
+ }) => {
105
+ mockProviderProbe.push({ channel: providedChannel });
106
+ return ReactLib.createElement(
107
+ actual.ChannelMediaListContext.Provider,
108
+ { value: { channel: mockChannel, searchSource: mockCurrentSearchSource } },
109
+ children,
110
+ );
111
+ },
112
+ };
113
+ });
114
+
115
+ jest.mock('../../navigation-section/MediaItem', () => {
116
+ const ReactLib = require('react');
117
+ const { Text } = require('react-native');
118
+ return {
119
+ MediaItem: (props: MediaItemProps) => {
120
+ mockTileProbe.push(props);
121
+ // Mirror production: the tile receives its press handler from the list via `renderItem`.
122
+ return ReactLib.createElement(
123
+ Text,
124
+ {
125
+ onPress: () =>
126
+ props.onPress?.({
127
+ attachment: props.attachment,
128
+ message: props.message,
129
+ requesterNode: 123,
130
+ }),
131
+ testID: 'media-tile',
132
+ },
133
+ `${props.message.id}-${props.attachment.type}`,
134
+ );
135
+ },
136
+ };
137
+ });
138
+
139
+ const makeSearchSource = (
140
+ overrides: Partial<{
141
+ hasNext: boolean;
142
+ isLoading: boolean;
143
+ items: MessageResponse[];
144
+ lastQueryError: Error;
145
+ }> = {},
146
+ ): FakeSearchSource => ({
147
+ search: jest.fn(),
148
+ state: new StateStore({
149
+ hasNext: overrides.hasNext ?? false,
150
+ isLoading: overrides.isLoading ?? false,
151
+ items: overrides.items,
152
+ ...(overrides.lastQueryError ? { lastQueryError: overrides.lastQueryError } : {}),
153
+ }),
154
+ });
155
+
156
+ const tree = (searchSource: FakeSearchSource, props: { additionalFlatListProps?: object } = {}) => {
157
+ mockCurrentSearchSource = searchSource;
158
+ return (
159
+ <ThemeProvider theme={defaultTheme}>
160
+ <TranslationProvider
161
+ value={{
162
+ t: ((key: string) => key) as never,
163
+ tDateTimeParser: ((input: unknown) => input) as never,
164
+ userLanguage: 'en',
165
+ }}
166
+ >
167
+ <ChannelDetailsContextProvider
168
+ value={{ channel: mockChannel } as unknown as ChannelDetailsContextValue}
169
+ >
170
+ <MediaList additionalFlatListProps={props.additionalFlatListProps as never} />
171
+ </ChannelDetailsContextProvider>
172
+ </TranslationProvider>
173
+ </ThemeProvider>
174
+ );
175
+ };
176
+
177
+ const messageWithAttachments = (id: string, attachments: unknown[]) =>
178
+ generateMessage({ attachments: attachments as never, id }) as unknown as MessageResponse;
179
+
180
+ describe('MediaList', () => {
181
+ beforeEach(() => {
182
+ mockTileProbe.length = 0;
183
+ mockProviderProbe.length = 0;
184
+ mockNotificationTargetProbe.length = 0;
185
+ mockIsVideoPlayerAvailable.mockReturnValue(true);
186
+ });
187
+
188
+ afterEach(() => jest.clearAllMocks());
189
+
190
+ it('wraps its content in the media list provider for the channel', () => {
191
+ render(tree(makeSearchSource()));
192
+
193
+ expect(mockProviderProbe).toHaveLength(1);
194
+ expect(mockProviderProbe[0].channel).toBe(mockChannel);
195
+ });
196
+
197
+ it('calls search when the component is created', () => {
198
+ const searchSource = makeSearchSource();
199
+ render(tree(searchSource));
200
+
201
+ expect(searchSource.search).toHaveBeenCalledTimes(1);
202
+ expect(searchSource.search).toHaveBeenCalledWith();
203
+ });
204
+
205
+ it('renders one tile per media attachment returned by the search source', () => {
206
+ const messageA = messageWithAttachments('m-1', [
207
+ generateImageAttachment(),
208
+ generateVideoAttachment(),
209
+ ]);
210
+
211
+ render(tree(makeSearchSource({ items: [messageA] })));
212
+
213
+ const tiles = screen.getAllByTestId('media-tile');
214
+ expect(tiles.map((tile) => tile.props.children)).toEqual(['m-1-image', 'm-1-video']);
215
+ });
216
+
217
+ it('opens the fullscreen gallery over all loaded media when an image tile is pressed', () => {
218
+ const attachment = generateImageAttachment({ image_url: 'https://example.com/a.jpg' });
219
+ const messageA = messageWithAttachments('m-1', [attachment]);
220
+ const messageB = messageWithAttachments('m-2', [generateImageAttachment()]);
221
+
222
+ render(tree(makeSearchSource({ items: [messageA, messageB] })));
223
+
224
+ fireEvent.press(screen.getAllByTestId('media-tile')[0]);
225
+
226
+ expect(mockOpenImageGallery).toHaveBeenCalledTimes(1);
227
+ const callArgs = mockOpenImageGallery.mock.calls[0][0];
228
+ expect(callArgs.selectedAttachmentUrl).toBe('https://example.com/a.jpg');
229
+ expect(callArgs.requesterNode).toBe(123);
230
+ expect(callArgs.messages.map((m: MessageResponse) => m.id)).toEqual(['m-1', 'm-2']);
231
+ expect(mockSetOverlay).toHaveBeenCalledWith('gallery');
232
+ });
233
+
234
+ it('opens the video URL instead of the gallery when no video player is available', () => {
235
+ mockIsVideoPlayerAvailable.mockReturnValue(false);
236
+ const attachment = generateVideoAttachment({ asset_url: 'https://example.com/v.mp4' });
237
+ const messageA = messageWithAttachments('m-1', [attachment]);
238
+
239
+ render(tree(makeSearchSource({ items: [messageA] })));
240
+
241
+ fireEvent.press(screen.getAllByTestId('media-tile')[0]);
242
+
243
+ expect(mockOpenUrlSafely).toHaveBeenCalledWith('https://example.com/v.mp4');
244
+ expect(mockOpenImageGallery).not.toHaveBeenCalled();
245
+ expect(mockSetOverlay).not.toHaveBeenCalled();
246
+ });
247
+
248
+ it('shows the loading skeleton on the initial load', () => {
249
+ render(tree(makeSearchSource({ isLoading: true })));
250
+ expect(screen.getByTestId('media-list-loading-skeleton')).toBeTruthy();
251
+ });
252
+
253
+ it('shows the empty state when there is no media', () => {
254
+ render(tree(makeSearchSource({ isLoading: false, items: [] })));
255
+
256
+ expect(screen.getByTestId('empty-list')).toBeTruthy();
257
+ expect(screen.getByText('No photos or videos')).toBeTruthy();
258
+ expect(screen.getByText('Share a photo or video to see it here')).toBeTruthy();
259
+ });
260
+
261
+ it('renders the loading-more indicator only while loading with existing results', () => {
262
+ render(
263
+ tree(
264
+ makeSearchSource({
265
+ isLoading: true,
266
+ items: [messageWithAttachments('m-1', [generateImageAttachment()])],
267
+ }),
268
+ ),
269
+ );
270
+ expect(screen.UNSAFE_getByType(require('react-native').ActivityIndicator)).toBeTruthy();
271
+ });
272
+
273
+ it('loads more via the search source when the list end is reached and there is a next page', () => {
274
+ const searchSource = makeSearchSource({
275
+ hasNext: true,
276
+ items: [messageWithAttachments('m-1', [generateImageAttachment()])],
277
+ });
278
+ render(tree(searchSource));
279
+ searchSource.search.mockClear();
280
+
281
+ const list = screen.getByTestId('media-list');
282
+ expect(list.props.onEndReachedThreshold).toBe(0.2);
283
+ list.props.onEndReached();
284
+ expect(searchSource.search).toHaveBeenCalledTimes(1);
285
+ });
286
+
287
+ it('does not load more when there is no next page', () => {
288
+ const searchSource = makeSearchSource({
289
+ hasNext: false,
290
+ items: [messageWithAttachments('m-1', [generateImageAttachment()])],
291
+ });
292
+ render(tree(searchSource));
293
+ searchSource.search.mockClear();
294
+
295
+ screen.getByTestId('media-list').props.onEndReached();
296
+ expect(searchSource.search).not.toHaveBeenCalled();
297
+ });
298
+
299
+ it('forwards additionalFlatListProps to the underlying list', () => {
300
+ render(
301
+ tree(
302
+ makeSearchSource({ items: [messageWithAttachments('m-1', [generateImageAttachment()])] }),
303
+ {
304
+ additionalFlatListProps: { bounces: false, testID: 'custom-list' },
305
+ },
306
+ ),
307
+ );
308
+
309
+ const list = screen.getByTestId('custom-list');
310
+ expect(list.props.bounces).toBe(false);
311
+ expect(screen.queryByTestId('media-list')).toBeNull();
312
+ });
313
+
314
+ it('targets the channel-details panel with a channel-scoped notification host', () => {
315
+ render(tree(makeSearchSource()));
316
+
317
+ expect(mockNotificationTargetProbe).toHaveLength(1);
318
+ expect(mockNotificationTargetProbe[0]).toEqual({
319
+ hostId: 'media-list:messaging:1',
320
+ panel: 'channel-details',
321
+ });
322
+ });
323
+
324
+ it('renders the notification list host', () => {
325
+ render(tree(makeSearchSource()));
326
+
327
+ expect(screen.getByTestId('notification-list')).toBeTruthy();
328
+ });
329
+
330
+ it('adds an error notification when the search source reports a query error', () => {
331
+ const lastQueryError = new Error('boom');
332
+ render(tree(makeSearchSource({ lastQueryError })));
333
+
334
+ expect(mockAddNotification).toHaveBeenCalledTimes(1);
335
+ expect(mockAddNotification).toHaveBeenCalledWith({
336
+ message: 'Failed to load media',
337
+ options: {
338
+ originalError: lastQueryError,
339
+ severity: 'error',
340
+ type: 'api:channel:query-media:failed',
341
+ },
342
+ origin: { context: { channel: mockChannel }, emitter: 'ChannelMediaList' },
343
+ });
344
+ });
345
+
346
+ it('does not add a notification when there is no query error', () => {
347
+ render(tree(makeSearchSource()));
348
+
349
+ expect(mockAddNotification).not.toHaveBeenCalled();
350
+ });
351
+ });
@@ -0,0 +1,112 @@
1
+ import React from 'react';
2
+
3
+ import { render, screen } from '@testing-library/react-native';
4
+ import type { 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 { generateMessage } from '../../../../../mock-builders/generator/message';
10
+ import { generateUser } from '../../../../../mock-builders/generator/user';
11
+ import { PinnedMessageItem } from '../../navigation-section/PinnedMessageItem';
12
+
13
+ jest.mock('../../../../ChannelPreview/ChannelLastMessagePreview', () => {
14
+ const ReactLib = require('react');
15
+ const { Text } = require('react-native');
16
+ return {
17
+ ChannelLastMessagePreview: ({ message }: { message: MessageResponse }) =>
18
+ ReactLib.createElement(Text, { testID: 'preview-message' }, message.id),
19
+ };
20
+ });
21
+
22
+ const mockChannelPreviewStatusSpy = jest.fn();
23
+
24
+ jest.mock('../../../../ChannelPreview/ChannelPreviewStatus', () => {
25
+ const ReactLib = require('react');
26
+ const { Text } = require('react-native');
27
+ return {
28
+ ChannelPreviewStatus: (props: { lastMessage: MessageResponse }) => {
29
+ mockChannelPreviewStatusSpy(props);
30
+ return ReactLib.createElement(Text, { testID: 'preview-status' }, props.lastMessage.id);
31
+ },
32
+ };
33
+ });
34
+
35
+ const channel = { cid: 'messaging:1' } as never;
36
+
37
+ const renderItem = (
38
+ message: MessageResponse,
39
+ formatMessageDate?: (date?: string | Date) => string,
40
+ ) =>
41
+ render(
42
+ <ThemeProvider theme={defaultTheme}>
43
+ <TranslationProvider
44
+ value={{
45
+ t: ((key: string) => key) as never,
46
+ tDateTimeParser: ((input: unknown) => input) as never,
47
+ userLanguage: 'en',
48
+ }}
49
+ >
50
+ <PinnedMessageItem
51
+ channel={channel}
52
+ formatMessageDate={formatMessageDate as never}
53
+ message={message}
54
+ />
55
+ </TranslationProvider>
56
+ </ThemeProvider>,
57
+ );
58
+
59
+ describe('PinnedMessageItem', () => {
60
+ afterEach(() => jest.clearAllMocks());
61
+
62
+ it("renders the sender's avatar and name", () => {
63
+ const message = generateMessage({
64
+ id: 'm-1',
65
+ user: generateUser({ id: 'u-1', name: 'Maya Ross' }),
66
+ }) as unknown as MessageResponse;
67
+
68
+ renderItem(message);
69
+
70
+ expect(screen.getByText('Maya Ross')).toBeTruthy();
71
+ expect(screen.getByTestId('user-avatar')).toBeTruthy();
72
+ });
73
+
74
+ it('falls back to the user id when the sender has no name', () => {
75
+ const message = generateMessage({
76
+ id: 'm-1',
77
+ user: generateUser({ id: 'just-an-id', name: undefined }),
78
+ }) as unknown as MessageResponse;
79
+
80
+ renderItem(message);
81
+
82
+ expect(screen.getByText('just-an-id')).toBeTruthy();
83
+ });
84
+
85
+ it('passes the message to the preview status and message components', () => {
86
+ const message = generateMessage({ id: 'm-42' }) as unknown as MessageResponse;
87
+
88
+ renderItem(message);
89
+
90
+ expect(screen.getByTestId('preview-status')).toHaveTextContent('m-42');
91
+ expect(screen.getByTestId('preview-message')).toHaveTextContent('m-42');
92
+ });
93
+
94
+ it('forwards the formatMessageDate prop to the preview status as formatLatestMessageDate', () => {
95
+ const message = generateMessage({ id: 'm-1' }) as unknown as MessageResponse;
96
+ const formatMessageDate = jest.fn(() => 'formatted-date');
97
+
98
+ renderItem(message, formatMessageDate);
99
+
100
+ expect(mockChannelPreviewStatusSpy).toHaveBeenCalledWith(
101
+ expect.objectContaining({ formatLatestMessageDate: formatMessageDate }),
102
+ );
103
+ });
104
+
105
+ it('renders a row keyed by the message id', () => {
106
+ const message = generateMessage({ id: 'm-1' }) as unknown as MessageResponse;
107
+
108
+ renderItem(message);
109
+
110
+ expect(screen.getByTestId('pinned-message-item-m-1')).toBeTruthy();
111
+ });
112
+ });