@ethora/chat-component-rn 26.7.4 → 26.7.5

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 (288) hide show
  1. package/CHANGELOG.md +0 -54
  2. package/README.md +8 -31
  3. package/lib/commonjs/assets/icons.js +2 -7
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/Header/HeaderRoomList.js +6 -20
  6. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  7. package/lib/commonjs/components/MainComponents/ChatRoom.js +14 -36
  8. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/MessageList.js +23 -7
  10. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  12. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/RoomList.js +32 -62
  14. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  15. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -309
  16. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  17. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +110 -320
  18. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  19. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +213 -552
  20. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  21. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
  22. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  23. package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
  24. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  25. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
  26. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  27. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +104 -202
  28. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  29. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  30. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  31. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  32. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  33. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
  34. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  35. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
  36. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  37. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
  38. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
  40. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  41. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +7 -17
  42. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  43. package/lib/commonjs/components/styled/SendInput.js +11 -80
  44. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  45. package/lib/commonjs/components/styled/StyledComponents.js +3 -9
  46. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  47. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  48. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  49. package/lib/commonjs/context/xmppProvider.js +35 -6
  50. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  51. package/lib/commonjs/helpers/updateMessagesTillLast.js +40 -12
  52. package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
  53. package/lib/commonjs/hooks/useChatRoomFocus.js +9 -3
  54. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
  55. package/lib/commonjs/hooks/useLogout.js +5 -0
  56. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  57. package/lib/commonjs/hooks/useSendMessage.js +50 -23
  58. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  59. package/lib/commonjs/i18n/strings.js +1 -121
  60. package/lib/commonjs/i18n/strings.js.map +1 -1
  61. package/lib/commonjs/main.js +0 -6
  62. package/lib/commonjs/main.js.map +1 -1
  63. package/lib/commonjs/networking/api-requests/user.api.js +0 -59
  64. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  65. package/lib/commonjs/networking/outboundQueue.js +18 -0
  66. package/lib/commonjs/networking/outboundQueue.js.map +1 -1
  67. package/lib/commonjs/networking/stanzaHandlers.js +10 -1
  68. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  69. package/lib/commonjs/networking/xmppClient.js +107 -7
  70. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  71. package/lib/commonjs/roomStore/chatSettingsSlice.js +1 -3
  72. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  73. package/lib/commonjs/roomStore/roomsSlice.js +22 -3
  74. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  75. package/lib/module/assets/icons.js +1 -6
  76. package/lib/module/assets/icons.js.map +1 -1
  77. package/lib/module/components/Header/HeaderRoomList.js +6 -20
  78. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  79. package/lib/module/components/MainComponents/ChatRoom.js +14 -36
  80. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  81. package/lib/module/components/MainComponents/MessageList.js +24 -8
  82. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  83. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  84. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  85. package/lib/module/components/MainComponents/RoomList.js +32 -62
  86. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  87. package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -311
  88. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  89. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +113 -311
  90. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  91. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +217 -555
  92. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  93. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
  94. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  95. package/lib/module/components/Modals/Modal/Modal.js +1 -9
  96. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  97. package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
  98. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  99. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +106 -205
  100. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  101. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  102. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  103. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  104. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  105. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
  106. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  107. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
  108. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  109. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
  110. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  111. package/lib/module/components/Modals/styledModalComponents.js +2 -9
  112. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  113. package/lib/module/components/RoomComponents/ChatRoomItem.js +7 -17
  114. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  115. package/lib/module/components/styled/SendInput.js +12 -81
  116. package/lib/module/components/styled/SendInput.js.map +1 -1
  117. package/lib/module/components/styled/StyledComponents.js +3 -9
  118. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  119. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  120. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  121. package/lib/module/context/xmppProvider.js +35 -6
  122. package/lib/module/context/xmppProvider.js.map +1 -1
  123. package/lib/module/helpers/updateMessagesTillLast.js +41 -13
  124. package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
  125. package/lib/module/hooks/useChatRoomFocus.js +9 -3
  126. package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
  127. package/lib/module/hooks/useLogout.js +5 -0
  128. package/lib/module/hooks/useLogout.js.map +1 -1
  129. package/lib/module/hooks/useSendMessage.js +51 -24
  130. package/lib/module/hooks/useSendMessage.js.map +1 -1
  131. package/lib/module/i18n/strings.js +1 -121
  132. package/lib/module/i18n/strings.js.map +1 -1
  133. package/lib/module/main.js +1 -1
  134. package/lib/module/main.js.map +1 -1
  135. package/lib/module/networking/api-requests/user.api.js +0 -56
  136. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  137. package/lib/module/networking/outboundQueue.js +17 -0
  138. package/lib/module/networking/outboundQueue.js.map +1 -1
  139. package/lib/module/networking/stanzaHandlers.js +10 -1
  140. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  141. package/lib/module/networking/xmppClient.js +107 -7
  142. package/lib/module/networking/xmppClient.js.map +1 -1
  143. package/lib/module/roomStore/chatSettingsSlice.js +1 -3
  144. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  145. package/lib/module/roomStore/roomsSlice.js +20 -2
  146. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  147. package/lib/typescript/assets/icons.d.ts +0 -16
  148. package/lib/typescript/assets/icons.d.ts.map +1 -1
  149. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  150. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  151. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  152. package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
  153. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  154. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
  155. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  156. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
  157. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  158. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
  159. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  160. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  161. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  162. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
  163. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  164. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  165. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  166. package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
  167. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
  168. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  169. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  170. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
  171. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  172. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
  173. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  174. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  175. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  176. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  177. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  178. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  179. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  180. package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
  181. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
  182. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  183. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  184. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  185. package/lib/typescript/main.d.ts +1 -1
  186. package/lib/typescript/main.d.ts.map +1 -1
  187. package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
  188. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  189. package/lib/typescript/networking/outboundQueue.d.ts +16 -0
  190. package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
  191. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  192. package/lib/typescript/networking/xmppClient.d.ts +33 -1
  193. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  194. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  195. package/lib/typescript/roomStore/roomsSlice.d.ts +18 -1
  196. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  197. package/lib/typescript/types/models/room.model.d.ts +15 -0
  198. package/lib/typescript/types/models/room.model.d.ts.map +1 -1
  199. package/lib/typescript/types/types.d.ts +20 -20
  200. package/lib/typescript/types/types.d.ts.map +1 -1
  201. package/package.json +1 -6
  202. package/src/assets/icons.tsx +9 -48
  203. package/src/components/Header/HeaderRoomList.tsx +5 -20
  204. package/src/components/MainComponents/ChatRoom.tsx +20 -38
  205. package/src/components/MainComponents/MessageList.tsx +24 -8
  206. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
  207. package/src/components/MainComponents/RoomList.tsx +34 -65
  208. package/src/components/Menu/HeaderRoomListMenu.tsx +71 -310
  209. package/src/components/Modals/AttachSheet/AttachSheet.tsx +97 -331
  210. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +279 -598
  211. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +2 -4
  212. package/src/components/Modals/Modal/Modal.tsx +0 -7
  213. package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
  214. package/src/components/Modals/NewChatModal/NewChatModal.tsx +117 -219
  215. package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
  216. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
  217. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
  218. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
  219. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
  220. package/src/components/Modals/styledModalComponents.tsx +2 -9
  221. package/src/components/RoomComponents/ChatRoomItem.tsx +7 -14
  222. package/src/components/styled/SendInput.tsx +12 -83
  223. package/src/components/styled/StyledComponents.ts +3 -9
  224. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
  225. package/src/context/xmppProvider.tsx +41 -8
  226. package/src/helpers/updateMessagesTillLast.tsx +42 -17
  227. package/src/hooks/useChatRoomFocus.ts +11 -3
  228. package/src/hooks/useLogout.tsx +7 -0
  229. package/src/hooks/useSendMessage.tsx +60 -24
  230. package/src/i18n/strings.ts +1 -121
  231. package/src/main.ts +1 -1
  232. package/src/networking/api-requests/user.api.ts +0 -71
  233. package/src/networking/outboundQueue.ts +29 -0
  234. package/src/networking/stanzaHandlers.ts +9 -1
  235. package/src/networking/xmppClient.ts +118 -7
  236. package/src/roomStore/chatSettingsSlice.ts +1 -3
  237. package/src/roomStore/roomsSlice.ts +20 -2
  238. package/src/types/models/room.model.ts +15 -0
  239. package/src/types/types.ts +20 -22
  240. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
  241. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  242. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
  243. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  244. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
  245. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  246. package/lib/commonjs/helpers/getChatBackground.js +0 -23
  247. package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
  248. package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
  249. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
  250. package/lib/commonjs/helpers/pickImageAsset.js +0 -68
  251. package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
  252. package/lib/commonjs/helpers/sheetGestures.js +0 -32
  253. package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
  254. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
  255. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  256. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
  257. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  258. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
  259. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  260. package/lib/module/helpers/getChatBackground.js +0 -18
  261. package/lib/module/helpers/getChatBackground.js.map +0 -1
  262. package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
  263. package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
  264. package/lib/module/helpers/pickImageAsset.js +0 -63
  265. package/lib/module/helpers/pickImageAsset.js.map +0 -1
  266. package/lib/module/helpers/sheetGestures.js +0 -26
  267. package/lib/module/helpers/sheetGestures.js.map +0 -1
  268. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
  269. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
  270. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
  271. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
  272. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
  273. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
  274. package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
  275. package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
  276. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
  277. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
  278. package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
  279. package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
  280. package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
  281. package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
  282. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
  283. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
  284. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
  285. package/src/helpers/getChatBackground.ts +0 -18
  286. package/src/helpers/mediaLibraryRuntime.ts +0 -25
  287. package/src/helpers/pickImageAsset.ts +0 -68
  288. package/src/helpers/sheetGestures.ts +0 -25
@@ -1,67 +1,51 @@
1
1
  "use strict";
2
2
 
3
- /** @format */
4
-
5
- import React, { useEffect, useMemo, useRef, useState } from 'react';
6
- import { Alert, Animated, Keyboard, Linking, Pressable, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
7
- import { useDispatch, useSelector } from 'react-redux';
8
- import * as ImagePicker from 'expo-image-picker';
3
+ import React, { useEffect, useMemo, useState } from 'react';
9
4
  import { useFileToken } from '../../../hooks/useFileToken';
10
5
  import { appendFileToken } from '../../../helpers/secureFileUrl';
11
- import { ModalContainerFullScreen } from '../styledModalComponents';
6
+ import { CenterContainer, UserInfo, UserName, UserStatus, ModalContainerFullScreen, Label, BorderedContainer, LabelData, Divider } from '../styledModalComponents';
7
+ import { Pressable, View, Text, ScrollView, Alert, Linking } from 'react-native';
8
+ import ModalHeaderComponent from '../ModalHeaderComponent';
12
9
  import { ProfileImagePlaceholder } from '../../MainComponents/ProfileImagePlaceholder';
10
+ import { useDispatch, useSelector } from 'react-redux';
13
11
  import { getActiveRoom } from '../../../roomStore';
14
12
  import { uploadFile } from '../../../networking/api-requests/auth.api';
15
13
  import { useXmppClient } from '../../../context/xmppProvider';
16
- import { deleteRoom, updateRoom } from '../../../roomStore/roomsSlice';
14
+ import { updateRoom } from '../../../roomStore/roomsSlice';
15
+ import * as ImagePicker from 'expo-image-picker';
17
16
  import Loader from '../../styled/Loader';
18
- import { AddNewIcon, DeleteIcon, EditIcon, LeaveIcon, ReportIcon, SearchIcon } from '../../../assets/icons';
17
+ import Button from '../../styled/Button';
18
+ import { DeleteIcon, MoreIcon, QrIcon } from '../../../assets/icons';
19
19
  import { useChatSettingState } from '../../../hooks/useChatSettingState';
20
20
  import { chatTextStyle } from '../../../helpers/typography';
21
21
  import { getElementFont } from '../../../helpers/getElementFont';
22
- import { getIconColor } from '../../../helpers/getIconColor';
23
22
  import { deleteRoomMember } from '../../../networking/api-requests/rooms.api';
24
23
  import { setActiveModal, setSelectedUser } from '../../../roomStore/chatSettingsSlice';
25
24
  import { MODAL_TYPES } from '../../../helpers/constants/MODAL_TYPES';
25
+ import DropdownMenu from '../../DropdownMenu/DropdownMenu';
26
26
  import SelectUsersModal from '../SelectUsersModal/SelectUsersModal';
27
27
  import { useToast } from '../../../context/ToastContext';
28
- import { useT } from '../../../i18n/useT';
29
28
  import DeleteChatModal from './DeleteChatModal';
30
- import ReportChatModal from './ReportChatModal';
31
- import { ProfileHero, ProfileTopBar, useHeaderMetrics } from '../ProfileHeader/ProfileHeader';
32
- import ProfileMenu from '../ProfileHeader/ProfileMenu';
33
-
34
- /**
35
- * Where the header should sit when search opens: tucked away at the
36
- * collapsed offset when the picture is still expanded, and left exactly
37
- * where it is when the user already scrolled it away.
38
- */
39
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
40
- export const searchScrollTarget = (isCollapsed, collapseDistance) => isCollapsed ? null : collapseDistance;
41
-
42
- /** Two uppercase letters for a chat without a picture, same rule the
43
- * avatar placeholder uses for people. */
44
- export const chatInitials = name => {
45
- const words = (name || '').trim().split(/\s+/).filter(Boolean);
46
- const letters = (words.length >= 2 ? [words[0][0], words[1][0]] : [words[0]?.[0], words[0]?.[1]]).filter(c => !!c && /[\p{L}\p{N}]/u.test(c));
47
- return letters.join('').toUpperCase();
48
- };
29
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
49
30
  const ChatProfileModal = ({
50
31
  handleCloseModal
51
32
  }) => {
52
- const t = useT();
53
33
  const [loading, setLoading] = useState(false);
54
- const [isDeleteOpen, setIsDeleteOpen] = useState(false);
55
- const [isReportOpen, setIsReportOpen] = useState(false);
56
- const [memberQuery, setMemberQuery] = useState('');
57
- const [isSearchOpen, setIsSearchOpen] = useState(false);
58
- // Measured, not guessed: this screen renders inside whatever frame the
59
- // host gives it (the demo app keeps its own tab bar above), so the
60
- // window height would overshoot.
61
- const [viewportHeight, setViewportHeight] = useState(0);
34
+ const [visible, setVisible] = useState(false);
35
+ const [isModalOpen, setIsModalOpen] = useState(false);
62
36
  const {
63
37
  showToast
64
38
  } = useToast();
39
+ const chatMenuOptions = useMemo(() => [{
40
+ label: 'Delete chat',
41
+ icon: /*#__PURE__*/_jsx(DeleteIcon, {}),
42
+ onClick: () => {
43
+ setIsModalOpen(true);
44
+ },
45
+ styles: {
46
+ color: 'red'
47
+ }
48
+ }], []);
65
49
  const dispatch = useDispatch();
66
50
  const {
67
51
  client
@@ -73,22 +57,6 @@ const ChatProfileModal = ({
73
57
  const activeRoom = useSelector(state => getActiveRoom(state));
74
58
  const fileToken = useFileToken();
75
59
 
76
- // Drives both the hero's parallax and the collapsed bar's fade-in. One
77
- // shared value, written natively by the ScrollView.
78
- const scrollY = useRef(new Animated.Value(0)).current;
79
- const scrollRef = useRef(null);
80
- const searchInputRef = useRef(null);
81
- const {
82
- collapseDistance
83
- } = useHeaderMetrics();
84
- // `scrollY` is driven natively, so its value can't be read back with
85
- // addListener. The Animated.event's `listener` still fires on the JS
86
- // side, which is enough to know which state the header is in.
87
- const [isCollapsed, setIsCollapsed] = useState(false);
88
- // Set when search collapsed the header itself, so only then does
89
- // dismissing search (or the keyboard) expand it again.
90
- const collapsedForSearchRef = useRef(false);
91
-
92
60
  // Pull live member list from the MUC when the modal opens — REST
93
61
  // hydration only fills the *count* (item.participants /
94
62
  // item.members.length); the actual roster comes from a `getRoomMembers`
@@ -102,11 +70,6 @@ const ChatProfileModal = ({
102
70
  }
103
71
  }
104
72
  }, [client, activeRoom?.jid]);
105
- useEffect(() => {
106
- if (!activeRoom) {
107
- dispatch(setActiveModal(undefined));
108
- }
109
- }, [activeRoom, dispatch]);
110
73
  const onUpload = async () => {
111
74
  let loadingSet = false;
112
75
  try {
@@ -119,7 +82,7 @@ const ChatProfileModal = ({
119
82
  const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
120
83
  if (!perm.granted) {
121
84
  Alert.alert('Permission required', 'Photo library permission is needed to select images.', [{
122
- text: t('action.cancel'),
85
+ text: 'Cancel',
123
86
  onPress: () => setLoading(false),
124
87
  style: 'cancel'
125
88
  }, {
@@ -181,17 +144,7 @@ const ChatProfileModal = ({
181
144
  }
182
145
  }
183
146
  };
184
- const onRemoveIcon = () => {
185
- client?.setRoomImageStanza(activeRoom?.jid || '', '', 'icon', 'none');
186
- dispatch(updateRoom({
187
- jid: activeRoom?.jid || '',
188
- updates: {
189
- icon: null
190
- }
191
- }));
192
- };
193
- const handleDeleteUser = async user => {
194
- const userId = user.xmppUsername;
147
+ const handleDeleteUser = async userId => {
195
148
  try {
196
149
  await deleteRoomMember({
197
150
  roomId: activeRoom?.jid?.split('@')[0] || '',
@@ -200,7 +153,7 @@ const ChatProfileModal = ({
200
153
  dispatch(updateRoom({
201
154
  jid: activeRoom?.jid || '',
202
155
  updates: {
203
- roomMembers: activeRoom?.roomMembers?.filter(member => member.xmppUsername !== userId)
156
+ roomMembers: activeRoom?.roomMembers?.filter(user => user.xmppUsername !== userId)
204
157
  }
205
158
  }));
206
159
  showToast({
@@ -219,15 +172,14 @@ const ChatProfileModal = ({
219
172
  });
220
173
  }
221
174
  };
222
- const confirmRemoveMember = user => {
223
- Alert.alert(t('modal.chatProfile.removeMember'), `${user.firstName} ${user.lastName}`.trim(), [{
224
- text: t('action.cancel'),
225
- style: 'cancel'
226
- }, {
227
- text: t('action.delete'),
228
- style: 'destructive',
229
- onPress: () => handleDeleteUser(user)
230
- }]);
175
+ const onRemoveClick = async () => {
176
+ client?.setRoomImageStanza(activeRoom?.jid || '', '', 'icon', 'none');
177
+ dispatch(updateRoom({
178
+ jid: activeRoom?.jid || '',
179
+ updates: {
180
+ icon: null
181
+ }
182
+ }));
231
183
  };
232
184
  const handleUserAvatarClick = user => {
233
185
  dispatch(setActiveModal(MODAL_TYPES.PROFILE));
@@ -241,499 +193,209 @@ const ChatProfileModal = ({
241
193
  refreshToken: ''
242
194
  }));
243
195
  };
244
-
245
- // Leaving is XMPP-side (an unavailable presence to the MUC); dropping the
246
- // room from the store is what actually takes the user out of the chat in
247
- // the UI, and the `!activeRoom` effect above then closes this modal.
248
- const handleLeave = () => {
249
- Alert.alert(t('modal.leaveChat.title'), t('modal.leaveChat.description'), [{
250
- text: t('action.cancel'),
251
- style: 'cancel'
252
- }, {
253
- text: t('action.leave'),
254
- style: 'destructive',
255
- onPress: () => {
256
- try {
257
- client?.leaveTheRoomStanza?.(activeRoom?.jid || '');
258
- } catch (error) {
259
- console.error('Failed to leave the room:', error);
260
- }
261
- dispatch(deleteRoom({
262
- jid: activeRoom?.jid || ''
263
- }));
264
- handleCloseModal?.();
265
- }
266
- }]);
267
- };
268
- const isModerator = activeRoom?.role === 'moderator';
269
- const canEditIcon = !config?.disableChatInfo?.disableIconEdit && activeRoom?.role !== 'participant';
270
- const canAddMembers = isModerator && activeRoom?.type === 'group';
271
- const canDeleteChat = isModerator && activeRoom?.type !== 'private';
272
- const hasIcon = !!activeRoom?.icon;
273
- const scrollHeaderTo = y => scrollRef.current?.scrollTo?.({
274
- y,
275
- animated: true
276
- });
277
-
278
- // Opening search from an expanded header tucks the picture away so the
279
- // results and the keyboard have room; from an already-collapsed header
280
- // it just opens the field. Whatever it collapsed, it puts back.
281
- const openMemberSearch = () => {
282
- const target = searchScrollTarget(isCollapsed, collapseDistance);
283
- if (target !== null) {
284
- collapsedForSearchRef.current = true;
285
- scrollHeaderTo(target);
286
- }
287
- setIsSearchOpen(true);
288
- setTimeout(() => searchInputRef.current?.focus(), 50);
289
- };
290
- const restoreHeader = () => {
291
- if (!collapsedForSearchRef.current) {
292
- return;
293
- }
294
- collapsedForSearchRef.current = false;
295
- scrollHeaderTo(0);
296
- };
297
- const closeMemberSearch = () => {
298
- setMemberQuery('');
299
- setIsSearchOpen(false);
300
- Keyboard.dismiss();
301
- restoreHeader();
302
- };
303
-
304
- // Putting the keyboard away is the other way out of search, so it
305
- // restores the header too — the field stays, results and all.
306
- useEffect(() => {
307
- if (!isSearchOpen) {
308
- return undefined;
196
+ const menuOptions = useMemo(() => userId => [{
197
+ label: 'Appoint as an admin',
198
+ icon: null,
199
+ onClick: () => {
200
+ dispatch(setActiveModal(MODAL_TYPES.PROFILE));
201
+ console.log('Profile clicked');
309
202
  }
310
- const sub = Keyboard.addListener('keyboardDidHide', restoreHeader);
311
- return () => sub.remove();
312
- }, [isSearchOpen]); // eslint-disable-line react-hooks/exhaustive-deps
313
-
314
- const heroActions = useMemo(() => [{
315
- key: 'search',
316
- label: t('action.search'),
317
- icon: color => /*#__PURE__*/_jsx(SearchIcon, {
318
- color: color
319
- }),
320
- onPress: openMemberSearch
321
- }, {
322
- key: 'leave',
323
- label: t('action.leave'),
324
- icon: color => /*#__PURE__*/_jsx(LeaveIcon, {
325
- color: color
326
- }),
327
- onPress: handleLeave
328
203
  }, {
329
- key: 'report',
330
- label: t('action.report'),
331
- icon: color => /*#__PURE__*/_jsx(ReportIcon, {
332
- color: color
333
- }),
334
- onPress: () => setIsReportOpen(true)
335
- }], [t, activeRoom?.jid] // eslint-disable-line react-hooks/exhaustive-deps
336
- );
337
-
338
- // "…" menu. Edit is the chat picture — the only chat detail this SDK can
339
- // actually change (there is no update-chat endpoint for title/description),
340
- // so it is only offered when the picture is editable.
341
- const menuItems = useMemo(() => {
342
- const items = [];
343
- if (canEditIcon) {
344
- items.push({
345
- key: 'edit',
346
- label: t('action.edit'),
347
- icon: /*#__PURE__*/_jsx(EditIcon, {
348
- color: "#141414",
349
- width: 18,
350
- height: 18
351
- }),
352
- onPress: onUpload
353
- });
354
- if (hasIcon) {
355
- items.push({
356
- key: 'remove-photo',
357
- label: t('modal.chatProfile.removePhoto'),
358
- icon: /*#__PURE__*/_jsx(DeleteIcon, {
359
- width: 18,
360
- height: 18
361
- }),
362
- onPress: onRemoveIcon
363
- });
364
- }
204
+ label: 'Unban',
205
+ icon: null,
206
+ onClick: () => {
207
+ dispatch(setActiveModal(MODAL_TYPES.SETTINGS));
208
+ console.log('Settings clicked');
365
209
  }
366
- // The hero's Search button is off-screen once collapsed, so the menu
367
- // carries it — the design's collapsed menu does the same.
368
- if (isCollapsed) {
369
- items.push({
370
- key: 'search',
371
- label: t('action.search'),
372
- icon: /*#__PURE__*/_jsx(SearchIcon, {
373
- color: "#141414",
374
- width: 18,
375
- height: 18
376
- }),
377
- onPress: openMemberSearch
378
- });
210
+ }, {
211
+ label: 'Delete',
212
+ icon: null,
213
+ onClick: e => {
214
+ e?.preventDefault();
215
+ handleDeleteUser(userId);
379
216
  }
380
- items.push({
381
- key: 'report',
382
- label: t('action.report'),
383
- icon: /*#__PURE__*/_jsx(ReportIcon, {
384
- color: "#141414",
385
- width: 18,
386
- height: 18
387
- }),
388
- onPress: () => setIsReportOpen(true)
389
- });
390
- if (canDeleteChat) {
391
- items.push({
392
- key: 'delete-and-leave',
393
- label: t('action.deleteAndLeave'),
394
- icon: /*#__PURE__*/_jsx(DeleteIcon, {
395
- width: 18,
396
- height: 18
397
- }),
398
- destructive: true,
399
- onPress: () => setIsDeleteOpen(true)
400
- });
217
+ }], []);
218
+ useEffect(() => {
219
+ if (!activeRoom) {
220
+ dispatch(setActiveModal(undefined));
401
221
  }
402
- return items;
403
- }, [canEditIcon, canDeleteChat, hasIcon, isCollapsed, t]); // eslint-disable-line react-hooks/exhaustive-deps
404
-
222
+ }, [activeRoom, dispatch]);
405
223
  if (!activeRoom) {
406
224
  return null;
407
225
  }
408
- const title = activeRoom.title || activeRoom.name;
409
- const memberCount = activeRoom.usersCnt ?? 0;
410
- const subtitle = t(memberCount === 1 ? 'modal.chatProfile.memberCountSingular' : 'modal.chatProfile.memberCountPlural', {
411
- count: memberCount
412
- });
413
- const heroImage = appendFileToken(activeRoom.icon, fileToken) || null;
414
- // A single flat colour behind the initials — the config's avatar colour
415
- // when set, otherwise the primary. (The old per-name hash colour is what
416
- // made the header read as two different greens next to the members' own
417
- // avatars.)
418
- const heroColor = config?.colors?.avatar || getIconColor(config);
419
- const members = activeRoom.roomMembers ?? [];
420
- const query = memberQuery.trim().toLowerCase();
421
- const visibleMembers = query ? members.filter(user => `${user.firstName ?? ''} ${user.lastName ?? ''}`.toLowerCase().includes(query)) : members;
422
226
  return /*#__PURE__*/_jsxs(ModalContainerFullScreen, {
423
- style: styles.screen,
424
- children: [/*#__PURE__*/_jsxs(Animated.ScrollView, {
425
- ref: scrollRef,
426
- style: styles.scroll
427
- // The collapsed state has to be reachable even when the member list
428
- // is short: without this the content was shorter than the viewport,
429
- // so the scroll had nowhere to go and simply bounced back.
430
- ,
431
- contentContainerStyle: [styles.scrollContent, viewportHeight > 0 && {
432
- minHeight: viewportHeight + collapseDistance
433
- }],
434
- onLayout: e => setViewportHeight(e.nativeEvent.layout.height),
435
- showsVerticalScrollIndicator: false,
436
- keyboardShouldPersistTaps: "handled",
437
- scrollEventThrottle: 16,
438
- onScroll: Animated.event([{
439
- nativeEvent: {
440
- contentOffset: {
441
- y: scrollY
442
- }
443
- }
444
- }], {
445
- useNativeDriver: true,
446
- listener: e => {
447
- const y = e?.nativeEvent?.contentOffset?.y ?? 0;
448
- setIsCollapsed(y >= collapseDistance - 8);
449
- }
450
- }),
451
- children: [/*#__PURE__*/_jsx(ProfileHero, {
452
- title: title,
453
- subtitle: subtitle,
454
- imageUri: heroImage,
455
- fallbackColor: heroColor,
456
- initials: chatInitials(title),
457
- scrollY: scrollY,
458
- actions: heroActions,
459
- titleStyle: chatTextStyle(config?.typography?.profile?.title),
460
- subtitleStyle: getElementFont(config, 'profileStatus')
461
- }), /*#__PURE__*/_jsxs(View, {
462
- style: styles.body,
463
- children: [!config?.disableChatInfo?.disableDescription && /*#__PURE__*/_jsxs(View, {
464
- style: styles.card,
465
- children: [/*#__PURE__*/_jsx(Text, {
466
- style: [styles.cardLabel, getElementFont(config, 'profileSectionLabel')],
467
- children: t('modal.chatProfile.description')
468
- }), /*#__PURE__*/_jsx(Text, {
469
- style: styles.cardValue,
470
- children: activeRoom.description || '—'
227
+ style: {
228
+ position: 'relative'
229
+ },
230
+ children: [/*#__PURE__*/_jsx(ModalHeaderComponent, {
231
+ handleCloseModal: handleCloseModal,
232
+ headerTitle: 'Chat Profile',
233
+ titleStyle: chatTextStyle(config?.typography?.profile?.screenTitle),
234
+ rightMenu: /*#__PURE__*/_jsxs(_Fragment, {
235
+ children: [activeRoom?.type === 'public' && /*#__PURE__*/_jsx(Button, {
236
+ EndIcon: /*#__PURE__*/_jsx(QrIcon, {}),
237
+ onPress: () => setVisible(true)
238
+ }), activeRoom.role === 'moderator' && activeRoom.type !== 'private' && /*#__PURE__*/_jsx(DropdownMenu, {
239
+ position: "right",
240
+ options: chatMenuOptions,
241
+ openButton: /*#__PURE__*/_jsx(Button, {
242
+ style: {
243
+ padding: 8,
244
+ height: 40
245
+ },
246
+ EndIcon: /*#__PURE__*/_jsx(MoreIcon, {}),
247
+ unstyled: true
248
+ })
249
+ })]
250
+ })
251
+ }), /*#__PURE__*/_jsx(ScrollView, {
252
+ style: {
253
+ width: '100%',
254
+ flex: 1
255
+ },
256
+ contentContainerStyle: {
257
+ flexGrow: 1
258
+ },
259
+ showsVerticalScrollIndicator: true,
260
+ children: /*#__PURE__*/_jsxs(CenterContainer, {
261
+ children: [/*#__PURE__*/_jsx(ProfileImagePlaceholder, {
262
+ name: activeRoom.title || activeRoom.name,
263
+ icon: appendFileToken(activeRoom.icon, fileToken)
264
+ // Two gates control whether the icon is editable:
265
+ // 1. role — only non-participants could edit before.
266
+ // 2. NEW: `disableChatInfo.disableIconEdit` — hard kill from
267
+ // config so a consumer can make the icon read-only for
268
+ // everyone (e.g. branded rooms, patient-facing apps).
269
+ // Both must allow it for the picker/remove affordances to show.
270
+ ,
271
+ upload: {
272
+ onUpload,
273
+ active: !config?.disableChatInfo?.disableIconEdit && activeRoom?.role !== 'participant'
274
+ },
275
+ remove: {
276
+ enabled: !config?.disableChatInfo?.disableIconEdit,
277
+ onRemoveClick
278
+ },
279
+ role: activeRoom?.role,
280
+ size: 128
281
+ }), /*#__PURE__*/_jsxs(UserInfo, {
282
+ children: [/*#__PURE__*/_jsx(UserName, {
283
+ fontSize: config?.typography?.profile?.title?.fontSize,
284
+ fontWeight: config?.typography?.profile?.title?.fontWeight,
285
+ children: activeRoom.title || activeRoom.name
286
+ }), /*#__PURE__*/_jsxs(UserStatus, {
287
+ style: getElementFont(config, 'profileStatus'),
288
+ children: [activeRoom.usersCnt, ' ', activeRoom.usersCnt > 1 ? 'members' : 'member']
289
+ })]
290
+ }), activeRoom.role === 'moderator' && activeRoom.type === 'group' && /*#__PURE__*/_jsx(_Fragment, {
291
+ children: /*#__PURE__*/_jsx(SelectUsersModal, {})
292
+ }), !config?.disableChatInfo?.disableDescription && /*#__PURE__*/_jsxs(BorderedContainer, {
293
+ children: [/*#__PURE__*/_jsx(LabelData, {
294
+ style: getElementFont(config, 'profileSectionLabel'),
295
+ children: "Description"
296
+ }), /*#__PURE__*/_jsx(Label, {
297
+ children: activeRoom?.description || '—'
471
298
  })]
472
- }), !config?.disableChatInfo?.disableType && /*#__PURE__*/_jsxs(View, {
473
- style: styles.card,
474
- children: [/*#__PURE__*/_jsx(Text, {
475
- style: [styles.cardLabel, getElementFont(config, 'profileSectionLabel')],
476
- children: t('modal.chatProfile.chatType')
477
- }), /*#__PURE__*/_jsx(Text, {
478
- style: styles.cardValue,
299
+ }), !config?.disableChatInfo?.disableType && /*#__PURE__*/_jsxs(BorderedContainer, {
300
+ children: [/*#__PURE__*/_jsx(LabelData, {
301
+ style: getElementFont(config, 'profileSectionLabel'),
302
+ children: "Chat type"
303
+ }), /*#__PURE__*/_jsx(Label, {
479
304
  children: activeRoom.type || '—'
480
305
  })]
481
- }), !config?.disableChatInfo?.hideMembers && /*#__PURE__*/_jsxs(View, {
482
- style: styles.card,
483
- children: [canAddMembers && /*#__PURE__*/_jsx(SelectUsersModal, {
484
- trigger: open => /*#__PURE__*/_jsxs(TouchableOpacity, {
485
- testID: "chat-profile-add-members",
486
- activeOpacity: 0.7,
487
- style: styles.addMembersRow,
488
- onPress: open,
489
- children: [/*#__PURE__*/_jsx(AddNewIcon, {
490
- color: getIconColor(config)
491
- }), /*#__PURE__*/_jsx(Text, {
492
- style: styles.addMembersLabel,
493
- children: t('modal.chatProfile.addMembers')
494
- })]
495
- })
496
- }), /*#__PURE__*/_jsx(Text, {
497
- style: [styles.cardLabel, getElementFont(config, 'profileSectionLabel')],
498
- children: t('modal.chatProfile.membersLabel', {
499
- count: memberCount
500
- })
501
- }), isSearchOpen && /*#__PURE__*/_jsxs(View, {
502
- style: styles.searchRow,
503
- children: [/*#__PURE__*/_jsx(SearchIcon, {
504
- color: "#8C8C8C",
505
- width: 18,
506
- height: 18
507
- }), /*#__PURE__*/_jsx(TextInput, {
508
- testID: "chat-profile-member-search",
509
- ref: searchInputRef,
510
- style: styles.searchInput,
511
- value: memberQuery,
512
- onChangeText: setMemberQuery,
513
- placeholder: t('search.members'),
514
- placeholderTextColor: "#8C8C8C",
515
- autoCorrect: false,
516
- returnKeyType: "search"
517
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
518
- testID: "chat-profile-search-close",
519
- activeOpacity: 0.7,
520
- hitSlop: {
521
- top: 8,
522
- bottom: 8,
523
- left: 8,
524
- right: 8
306
+ }), !config?.disableChatInfo?.hideMembers && /*#__PURE__*/_jsx(BorderedContainer, {
307
+ style: {
308
+ paddingHorizontal: 16,
309
+ paddingVertical: 8
310
+ },
311
+ children: loading ? /*#__PURE__*/_jsx(Loader, {}) : (activeRoom?.roomMembers?.length ?? 0) === 0 ? /*#__PURE__*/_jsx(Label, {
312
+ style: {
313
+ opacity: 0.6,
314
+ textAlign: 'center',
315
+ paddingVertical: 8
316
+ },
317
+ children: "Member list unavailable"
318
+ }) : /*#__PURE__*/_jsx(View, {
319
+ children: activeRoom?.roomMembers?.map((user, index) => /*#__PURE__*/_jsxs(View, {
320
+ style: {
321
+ flexDirection: 'column',
322
+ alignItems: 'flex-start'
525
323
  },
526
- onPress: closeMemberSearch,
527
- children: /*#__PURE__*/_jsx(Text, {
528
- style: styles.searchClose,
529
- children: "\xD7"
530
- })
531
- })]
532
- }), loading ? /*#__PURE__*/_jsx(Loader, {}) : visibleMembers.length === 0 ? /*#__PURE__*/_jsx(Text, {
533
- testID: "chat-profile-members-empty",
534
- style: styles.emptyMembers,
535
- children: members.length === 0 ? t('modal.chatProfile.membersUnavailable') : t('search.noResults')
536
- }) : visibleMembers.map((user, index) => {
537
- const banned = user.ban_status === 'banned';
538
- const roleLabel = user.role && user.role !== 'none' && user.role !== 'participant' ? user.role : null;
539
- return /*#__PURE__*/_jsxs(View, {
540
- style: [styles.memberRow, index > 0 && styles.memberDivider],
541
- children: [/*#__PURE__*/_jsxs(Pressable, {
542
- style: styles.memberMain
543
- // `disableChatInfo.disableMemberTap` blocks the tap
544
- // entirely so the user-profile popup never opens.
545
- // `disableMemberProfileActions` only hid the action
546
- // buttons INSIDE that popup, leaving the popup itself
547
- // to open on tap — this gate closes the door.
548
- // Customer-reported #16.
549
- ,
550
- onPress: config?.disableChatInfo?.disableMemberTap ? undefined : () => handleUserAvatarClick(user),
551
- disabled: !!config?.disableChatInfo?.disableMemberTap,
552
- children: [/*#__PURE__*/_jsx(ProfileImagePlaceholder, {
553
- name: `${user.firstName} ${user.lastName}`,
554
- size: 40
555
- }), /*#__PURE__*/_jsxs(View, {
556
- style: styles.memberText,
557
- children: [/*#__PURE__*/_jsxs(Text, {
558
- numberOfLines: 1,
559
- style: [styles.memberName, chatTextStyle(config?.typography?.profile?.memberName)],
560
- children: [user.firstName, " ", user.lastName]
561
- }), !!user.last_active && /*#__PURE__*/_jsx(Text, {
562
- numberOfLines: 1,
563
- style: [styles.memberStatus, getElementFont(config, 'profileSectionLabel')],
564
- children: new Date(user.last_active * 1000).toLocaleString()
324
+ children: [/*#__PURE__*/_jsxs(View, {
325
+ style: {
326
+ flexDirection: 'row',
327
+ justifyContent: 'flex-start',
328
+ paddingHorizontal: 8,
329
+ paddingVertical: 0,
330
+ alignItems: 'center',
331
+ width: '100%'
332
+ },
333
+ children: [/*#__PURE__*/_jsxs(Pressable, {
334
+ style: {
335
+ flexDirection: 'row',
336
+ alignItems: 'center',
337
+ justifyContent: 'flex-start',
338
+ gap: 16
339
+ }
340
+ // `disableChatInfo.disableMemberTap` blocks the
341
+ // tap entirely so the user-profile popup never
342
+ // opens. `disableMemberProfileActions` only hid
343
+ // the action buttons INSIDE that popup, leaving
344
+ // the popup itself to open on tap — this gate
345
+ // closes the door. Customer-reported #16.
346
+ ,
347
+ onPress: config?.disableChatInfo?.disableMemberTap ? undefined : () => handleUserAvatarClick(user),
348
+ disabled: !!config?.disableChatInfo?.disableMemberTap,
349
+ children: [/*#__PURE__*/_jsx(ProfileImagePlaceholder, {
350
+ name: `${user.firstName} ${user.lastName}`,
351
+ size: 40
352
+ }), /*#__PURE__*/_jsxs(View, {
353
+ style: {
354
+ flexDirection: 'column',
355
+ gap: 2,
356
+ alignItems: 'flex-start',
357
+ justifyContent: 'center'
358
+ },
359
+ children: [/*#__PURE__*/_jsxs(Label, {
360
+ style: [{
361
+ fontSize: 16,
362
+ fontWeight: 600
363
+ }, chatTextStyle(config?.typography?.profile?.memberName)],
364
+ children: [user.firstName, " ", user.lastName]
365
+ }), user.last_active && /*#__PURE__*/_jsx(LabelData, {
366
+ style: getElementFont(config, 'profileSectionLabel'),
367
+ children: new Date(user.last_active * 1000).toLocaleString()
368
+ })]
565
369
  })]
370
+ }), user.role && user.role !== 'none' && /*#__PURE__*/_jsx(Text, {
371
+ style: {
372
+ backgroundColor: user.ban_status !== 'banned' ? '#F3F6FC' : '#FFEBEE',
373
+ color: user.ban_status !== 'banned' ? '#0052CD' : '#F44336',
374
+ padding: 5,
375
+ borderRadius: 16,
376
+ fontSize: 12
377
+ },
378
+ children: user.role
379
+ }), stateUser.xmppUsername !== user.xmppUsername && activeRoom.role === 'moderator' && activeRoom.type !== 'private' && /*#__PURE__*/_jsx(DropdownMenu, {
380
+ options: menuOptions(user.xmppUsername),
381
+ openButton: /*#__PURE__*/_jsx(Button, {
382
+ onPress: () => {},
383
+ children: /*#__PURE__*/_jsx(Text, {
384
+ children: "More Options"
385
+ })
386
+ }),
387
+ onClose: () => console.log('Dropdown closed')
566
388
  })]
567
- }), (banned || roleLabel) && /*#__PURE__*/_jsx(Text, {
568
- style: [styles.memberRole, banned && styles.memberBanned],
569
- children: banned ? t('status.banned') : roleLabel
570
- }), isModerator && activeRoom.type !== 'private' && stateUser.xmppUsername !== user.xmppUsername && /*#__PURE__*/_jsx(TouchableOpacity, {
571
- testID: `chat-profile-remove-${user.xmppUsername}`,
572
- activeOpacity: 0.7,
573
- hitSlop: {
574
- top: 8,
575
- bottom: 8,
576
- left: 8,
577
- right: 8
578
- },
579
- style: styles.memberRemove,
580
- onPress: () => confirmRemoveMember(user),
581
- children: /*#__PURE__*/_jsx(DeleteIcon, {
582
- width: 20,
583
- height: 20
584
- })
585
- })]
586
- }, user.xmppUsername);
587
- })]
389
+ }), index < (activeRoom?.roomMembers?.length || 0) - 1 && /*#__PURE__*/_jsx(Divider, {})]
390
+ }, user.xmppUsername))
391
+ })
588
392
  })]
589
- })]
590
- }), /*#__PURE__*/_jsx(ProfileTopBar, {
591
- title: title,
592
- subtitle: subtitle,
593
- imageUri: heroImage,
594
- fallbackColor: heroColor,
595
- initials: chatInitials(title),
596
- scrollY: scrollY,
597
- onBack: handleCloseModal,
598
- titleStyle: chatTextStyle(config?.typography?.profile?.screenTitle),
599
- menu: /*#__PURE__*/_jsx(ProfileMenu, {
600
- items: menuItems
601
393
  })
602
394
  }), /*#__PURE__*/_jsx(DeleteChatModal, {
603
- isModalOpen: isDeleteOpen,
604
- setIsModalOpen: setIsDeleteOpen
605
- }), /*#__PURE__*/_jsx(ReportChatModal, {
606
- visible: isReportOpen,
607
- onClose: () => setIsReportOpen(false)
395
+ isModalOpen: isModalOpen,
396
+ setIsModalOpen: setIsModalOpen
608
397
  })]
609
398
  });
610
399
  };
611
- const styles = StyleSheet.create({
612
- screen: {
613
- position: 'relative',
614
- backgroundColor: '#F2F3F5'
615
- },
616
- scroll: {
617
- width: '100%',
618
- flex: 1
619
- },
620
- scrollContent: {
621
- paddingBottom: 32
622
- },
623
- body: {
624
- padding: 12,
625
- gap: 12
626
- },
627
- card: {
628
- backgroundColor: '#FFFFFF',
629
- borderRadius: 14,
630
- padding: 16,
631
- shadowColor: '#000',
632
- shadowOffset: {
633
- width: 0,
634
- height: 1
635
- },
636
- shadowOpacity: 0.05,
637
- shadowRadius: 4,
638
- elevation: 1
639
- },
640
- cardLabel: {
641
- color: '#8C8C8C',
642
- fontSize: 14
643
- },
644
- cardValue: {
645
- color: '#141414',
646
- fontSize: 16,
647
- marginTop: 4
648
- },
649
- addMembersRow: {
650
- flexDirection: 'row',
651
- alignItems: 'center',
652
- gap: 12,
653
- paddingBottom: 14,
654
- marginBottom: 10,
655
- borderBottomWidth: StyleSheet.hairlineWidth,
656
- borderBottomColor: '#EFEFF2'
657
- },
658
- addMembersLabel: {
659
- fontSize: 16,
660
- fontWeight: '500',
661
- color: '#141414'
662
- },
663
- searchRow: {
664
- flexDirection: 'row',
665
- alignItems: 'center',
666
- gap: 8,
667
- marginTop: 10,
668
- paddingHorizontal: 12,
669
- height: 40,
670
- borderRadius: 12,
671
- backgroundColor: '#F2F3F5'
672
- },
673
- searchInput: {
674
- flex: 1,
675
- fontSize: 15,
676
- color: '#141414',
677
- padding: 0
678
- },
679
- searchClose: {
680
- fontSize: 22,
681
- lineHeight: 24,
682
- color: '#8C8C8C'
683
- },
684
- emptyMembers: {
685
- opacity: 0.6,
686
- textAlign: 'center',
687
- paddingVertical: 8,
688
- color: '#141414'
689
- },
690
- memberRow: {
691
- flexDirection: 'row',
692
- alignItems: 'center',
693
- paddingVertical: 10
694
- },
695
- memberDivider: {
696
- borderTopWidth: StyleSheet.hairlineWidth,
697
- borderTopColor: '#EFEFF2'
698
- },
699
- memberMain: {
700
- flex: 1,
701
- flexDirection: 'row',
702
- alignItems: 'center',
703
- gap: 12
704
- },
705
- memberText: {
706
- flex: 1
707
- },
708
- memberName: {
709
- fontSize: 16,
710
- fontWeight: '600',
711
- color: '#141414'
712
- },
713
- memberStatus: {
714
- fontSize: 13,
715
- color: '#8C8C8C',
716
- marginTop: 2
717
- },
718
- memberRole: {
719
- fontSize: 13,
720
- color: '#8C8C8C',
721
- marginLeft: 8
722
- },
723
- memberBanned: {
724
- color: '#E53935'
725
- },
726
- memberRemove: {
727
- marginLeft: 12
728
- },
729
- menuButton: {
730
- width: 40,
731
- height: 40,
732
- borderRadius: 20,
733
- backgroundColor: 'rgba(0,0,0,0.28)',
734
- alignItems: 'center',
735
- justifyContent: 'center'
736
- }
737
- });
738
400
  export default ChatProfileModal;
739
401
  //# sourceMappingURL=ChatProfileModal.js.map