@messenger-box/slack-ui-mobile 10.0.2-alpha.5 → 10.0.3-alpha.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 (318) hide show
  1. package/lib/components/AppRootContextProviderComponent.js +2 -5
  2. package/lib/components/AppRootContextProviderComponent.js.map +1 -1
  3. package/lib/components/Channels/ChannelsByAlphabeticalAccordion.js +16 -81
  4. package/lib/components/Channels/ChannelsByAlphabeticalAccordion.js.map +1 -1
  5. package/lib/components/CustomBottomTabs/CustomBottomTabs.js +60 -75
  6. package/lib/components/CustomBottomTabs/CustomBottomTabs.js.map +1 -1
  7. package/lib/components/CustomDrawer/CustomDrawer.js +78 -185
  8. package/lib/components/CustomDrawer/CustomDrawer.js.map +1 -1
  9. package/lib/components/Header/Header.js +1 -8
  10. package/lib/components/Header/Header.js.map +1 -1
  11. package/lib/components/Header/styles.js +14 -14
  12. package/lib/components/Header/styles.js.map +1 -1
  13. package/lib/components/LoadingSpinner/index.js +6 -29
  14. package/lib/components/LoadingSpinner/index.js.map +1 -1
  15. package/lib/components/NavigationHeader/InboxNavigationHeader.js +84 -176
  16. package/lib/components/NavigationHeader/InboxNavigationHeader.js.map +1 -1
  17. package/lib/components/NavigationHeader/NavigationHeader.js +154 -276
  18. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  19. package/lib/components/NavigationHeader/NavigationHeaderChat.js +25 -66
  20. package/lib/components/NavigationHeader/NavigationHeaderChat.js.map +1 -1
  21. package/lib/components/NavigationHeader/index.js +1 -1
  22. package/lib/components/SlackSearchInput/Suggestion.js +40 -14
  23. package/lib/components/SlackSearchInput/Suggestion.js.map +1 -1
  24. package/lib/components/SlackSearchInput/Tag.js +43 -17
  25. package/lib/components/SlackSearchInput/Tag.js.map +1 -1
  26. package/lib/components/SlackSearchInput/index.js +57 -114
  27. package/lib/components/SlackSearchInput/index.js.map +1 -1
  28. package/lib/components/Tiles/Tiles.js +1 -8
  29. package/lib/components/Tiles/Tiles.js.map +1 -1
  30. package/lib/components/Tiles/styles.js +14 -14
  31. package/lib/components/Tiles/styles.js.map +1 -1
  32. package/lib/components/VirtualizedScrollView/VirtualizedScrollView.js +27 -17
  33. package/lib/components/VirtualizedScrollView/VirtualizedScrollView.js.map +1 -1
  34. package/lib/components/WorkSpaceDrawer/WorkSpaceDrawer.js +86 -193
  35. package/lib/components/WorkSpaceDrawer/WorkSpaceDrawer.js.map +1 -1
  36. package/lib/compute.js +222 -234
  37. package/lib/compute.js.map +1 -1
  38. package/lib/config/env-config.js +14 -12
  39. package/lib/config/env-config.js.map +1 -1
  40. package/lib/constants/Colors.js +52 -56
  41. package/lib/constants/Colors.js.map +1 -1
  42. package/lib/constants/Layout.js +2 -2
  43. package/lib/constants/Layout.js.map +1 -1
  44. package/lib/constants/device.js +4 -12
  45. package/lib/constants/device.js.map +1 -1
  46. package/lib/constants/fonts.js +5 -5
  47. package/lib/constants/fonts.js.map +1 -1
  48. package/lib/constants/globalStyles.js +13 -13
  49. package/lib/constants/globalStyles.js.map +1 -1
  50. package/lib/constants/preloadImages.js +11 -22
  51. package/lib/constants/preloadImages.js.map +1 -1
  52. package/lib/constants/routes.js +37 -43
  53. package/lib/constants/routes.js.map +1 -1
  54. package/lib/hooks/useCachedResources.js +32 -18
  55. package/lib/hooks/useCachedResources.js.map +1 -1
  56. package/lib/hooks/useColorScheme.js +1 -4
  57. package/lib/hooks/useColorScheme.js.map +1 -1
  58. package/lib/hooks/useDisclose.js.map +1 -1
  59. package/lib/hooks/useDrawerLayout.js +33 -104
  60. package/lib/hooks/useDrawerLayout.js.map +1 -1
  61. package/lib/hooks/useExpoNotificationProvider.js +35 -41
  62. package/lib/hooks/useExpoNotificationProvider.js.map +1 -1
  63. package/lib/index.js.map +1 -1
  64. package/lib/locales/index.js +4 -4
  65. package/lib/locales/index.js.map +1 -1
  66. package/lib/module.js +1 -4
  67. package/lib/module.js.map +1 -1
  68. package/lib/navigation/ActivityNavigator.js +31 -25
  69. package/lib/navigation/ActivityNavigator.js.map +1 -1
  70. package/lib/navigation/ExploreNavigator.js +199 -440
  71. package/lib/navigation/ExploreNavigator.js.map +1 -1
  72. package/lib/navigation/InboxNavigator.js +69 -128
  73. package/lib/navigation/InboxNavigator.js.map +1 -1
  74. package/lib/navigation/SearchTabNavigation.js +60 -138
  75. package/lib/navigation/SearchTabNavigation.js.map +1 -1
  76. package/lib/navigation/TeamTabNavigation.js +52 -41
  77. package/lib/navigation/TeamTabNavigation.js.map +1 -1
  78. package/lib/screens/Account/AccountScreen.js +51 -239
  79. package/lib/screens/Account/AccountScreen.js.map +1 -1
  80. package/lib/screens/Activity/ActivityScreen.js +1 -9
  81. package/lib/screens/Activity/ActivityScreen.js.map +1 -1
  82. package/lib/screens/Channels/Add/AddName.js +25 -115
  83. package/lib/screens/Channels/Add/AddName.js.map +1 -1
  84. package/lib/screens/Channels/Add/AddVisibility.js +43 -111
  85. package/lib/screens/Channels/Add/AddVisibility.js.map +1 -1
  86. package/lib/screens/Channels/AddChannel.js +25 -100
  87. package/lib/screens/Channels/AddChannel.js.map +1 -1
  88. package/lib/screens/Channels/Channels.js +65 -190
  89. package/lib/screens/Channels/Channels.js.map +1 -1
  90. package/lib/screens/Files/FilesScreen.js +1 -12
  91. package/lib/screens/Files/FilesScreen.js.map +1 -1
  92. package/lib/screens/Home/Components/Channels/Channels.js +53 -190
  93. package/lib/screens/Home/Components/Channels/Channels.js.map +1 -1
  94. package/lib/screens/Home/Components/DirectChannels/DirectChannels.js +99 -285
  95. package/lib/screens/Home/Components/DirectChannels/DirectChannels.js.map +1 -1
  96. package/lib/screens/Home/Components/Teams/Teams.js +34 -122
  97. package/lib/screens/Home/Components/Teams/Teams.js.map +1 -1
  98. package/lib/screens/Home/Components/TopCommonSlider/TopCommonSlider.js +36 -59
  99. package/lib/screens/Home/Components/TopCommonSlider/TopCommonSlider.js.map +1 -1
  100. package/lib/screens/Home/HomeScreen.js +113 -242
  101. package/lib/screens/Home/HomeScreen.js.map +1 -1
  102. package/lib/screens/Home/styles.js +27 -27
  103. package/lib/screens/Home/styles.js.map +1 -1
  104. package/lib/screens/Inbox/InboxChannelDetail.js +124 -430
  105. package/lib/screens/Inbox/InboxChannelDetail.js.map +1 -1
  106. package/lib/screens/Inbox/InboxDialogMessages.js +21 -4
  107. package/lib/screens/Inbox/InboxDialogMessages.js.map +1 -1
  108. package/lib/screens/Inbox/InboxScreen.js +27 -11
  109. package/lib/screens/Inbox/InboxScreen.js.map +1 -1
  110. package/lib/screens/Inbox/InboxThreadMessages.js +21 -7
  111. package/lib/screens/Inbox/InboxThreadMessages.js.map +1 -1
  112. package/lib/screens/Inbox/InboxThreads.js +21 -6
  113. package/lib/screens/Inbox/InboxThreads.js.map +1 -1
  114. package/lib/screens/Login.js +7 -63
  115. package/lib/screens/Login.js.map +1 -1
  116. package/lib/screens/Notification/NotificationsScreen.js +3 -5
  117. package/lib/screens/Notification/NotificationsScreen.js.map +1 -1
  118. package/lib/screens/Organization/AddWorkspace.js +52 -180
  119. package/lib/screens/Organization/AddWorkspace.js.map +1 -1
  120. package/lib/screens/Organization/CreateOrganization.js +20 -80
  121. package/lib/screens/Organization/CreateOrganization.js.map +1 -1
  122. package/lib/screens/Organization/InitialChannelOnboarding.js +26 -148
  123. package/lib/screens/Organization/InitialChannelOnboarding.js.map +1 -1
  124. package/lib/screens/Organization/InitializeOrganizationChannel.js +23 -76
  125. package/lib/screens/Organization/InitializeOrganizationChannel.js.map +1 -1
  126. package/lib/screens/Organization/InviteOrganizationMembers.js +15 -98
  127. package/lib/screens/Organization/InviteOrganizationMembers.js.map +1 -1
  128. package/lib/screens/Peoples/AddByEmail.js +33 -130
  129. package/lib/screens/Peoples/AddByEmail.js.map +1 -1
  130. package/lib/screens/Peoples/AddFromContacts.js +79 -155
  131. package/lib/screens/Peoples/AddFromContacts.js.map +1 -1
  132. package/lib/screens/Peoples/AddPeople.js +127 -236
  133. package/lib/screens/Peoples/AddPeople.js.map +1 -1
  134. package/lib/screens/Peoples/People.js +9 -13
  135. package/lib/screens/Peoples/People.js.map +1 -1
  136. package/lib/screens/Profile/ProfileScreen.js +25 -83
  137. package/lib/screens/Profile/ProfileScreen.js.map +1 -1
  138. package/lib/screens/Saved/SavedScreen.js +1 -9
  139. package/lib/screens/Saved/SavedScreen.js.map +1 -1
  140. package/lib/screens/Search/Channels.js +52 -123
  141. package/lib/screens/Search/Channels.js.map +1 -1
  142. package/lib/screens/Search/Files.js +5 -24
  143. package/lib/screens/Search/Files.js.map +1 -1
  144. package/lib/screens/Search/JumpTo.js +44 -127
  145. package/lib/screens/Search/JumpTo.js.map +1 -1
  146. package/lib/screens/Search/People.js +52 -123
  147. package/lib/screens/Search/People.js.map +1 -1
  148. package/lib/screens/Search/Recents.js +52 -123
  149. package/lib/screens/Search/Recents.js.map +1 -1
  150. package/lib/screens/Search/SearchAddChannel.js +224 -427
  151. package/lib/screens/Search/SearchAddChannel.js.map +1 -1
  152. package/lib/screens/Search/SearchChannelPeople.js +86 -230
  153. package/lib/screens/Search/SearchChannelPeople.js.map +1 -1
  154. package/lib/screens/Search/SearchScreen.js +39 -41
  155. package/lib/screens/Search/SearchScreen.js.map +1 -1
  156. package/lib/screens/Search/styles.js +26 -26
  157. package/lib/screens/Search/styles.js.map +1 -1
  158. package/lib/screens/Teams/AddTeam.js +26 -103
  159. package/lib/screens/Teams/AddTeam.js.map +1 -1
  160. package/lib/screens/Teams/Components/Channels/Channels.js +54 -88
  161. package/lib/screens/Teams/Components/Channels/Channels.js.map +1 -1
  162. package/lib/screens/Teams/Components/Members/Members.js +24 -81
  163. package/lib/screens/Teams/Components/Members/Members.js.map +1 -1
  164. package/lib/screens/Teams/Team.js +48 -47
  165. package/lib/screens/Teams/Team.js.map +1 -1
  166. package/lib/screens/Teams/Teams.js +59 -140
  167. package/lib/screens/Teams/Teams.js.map +1 -1
  168. package/lib/screens/Wiki/WikiScreen.js +1 -12
  169. package/lib/screens/Wiki/WikiScreen.js.map +1 -1
  170. package/lib/theme/index.js +0 -2
  171. package/lib/theme/index.js.map +1 -1
  172. package/package.json +3 -3
  173. package/lib/components/AddMemberToChannel/AddMemberToChannel.d.ts +0 -3
  174. package/lib/components/AddMemberToChannel/index.d.ts +0 -2
  175. package/lib/components/AppRootContextProviderComponent.d.ts +0 -6
  176. package/lib/components/CachedImage/consts.d.ts +0 -2
  177. package/lib/components/CachedImage/index.d.ts +0 -8
  178. package/lib/components/Channels/ChannelsByAlphabeticalAccordion.d.ts +0 -8
  179. package/lib/components/Channels/index.d.ts +0 -2
  180. package/lib/components/CustomBottomTabs/CustomBottomTabs.d.ts +0 -3
  181. package/lib/components/CustomBottomTabs/index.d.ts +0 -2
  182. package/lib/components/CustomDrawer/CustomDrawer.d.ts +0 -3
  183. package/lib/components/CustomDrawer/index.d.ts +0 -2
  184. package/lib/components/Header/Header.d.ts +0 -8
  185. package/lib/components/Header/index.d.ts +0 -2
  186. package/lib/components/Header/styles.d.ts +0 -43
  187. package/lib/components/LoadingSpinner/index.d.ts +0 -7
  188. package/lib/components/NavigationComponent/NavigationComponent.d.ts +0 -8
  189. package/lib/components/NavigationComponent/index.d.ts +0 -1
  190. package/lib/components/NavigationHeader/InboxNavigationHeader.d.ts +0 -3
  191. package/lib/components/NavigationHeader/NavigationHeader.d.ts +0 -5
  192. package/lib/components/NavigationHeader/NavigationHeaderChat.d.ts +0 -3
  193. package/lib/components/NavigationHeader/index.d.ts +0 -5
  194. package/lib/components/RootNavigation.d.ts +0 -3
  195. package/lib/components/Search/AddByEmail.d.ts +0 -3
  196. package/lib/components/Search/AddChannel.d.ts +0 -3
  197. package/lib/components/Search/AddFromContacts.d.ts +0 -3
  198. package/lib/components/Search/AddPeople.d.ts +0 -3
  199. package/lib/components/Search/AddTeam.d.ts +0 -3
  200. package/lib/components/Search/Channels.d.ts +0 -3
  201. package/lib/components/Search/People.d.ts +0 -5
  202. package/lib/components/SlackSearchInput/Suggestion.d.ts +0 -8
  203. package/lib/components/SlackSearchInput/Tag.d.ts +0 -8
  204. package/lib/components/SlackSearchInput/index.d.ts +0 -61
  205. package/lib/components/Tiles/Tiles.d.ts +0 -7
  206. package/lib/components/Tiles/index.d.ts +0 -2
  207. package/lib/components/Tiles/styles.d.ts +0 -40
  208. package/lib/components/VirtualizedScrollView/VirtualizedScrollView.d.ts +0 -3
  209. package/lib/components/VirtualizedScrollView/index.d.ts +0 -2
  210. package/lib/components/WorkSpaceDrawer/WorkSpaceDrawer.d.ts +0 -3
  211. package/lib/components/WorkSpaceDrawer/index.d.ts +0 -2
  212. package/lib/components/index.d.ts +0 -11
  213. package/lib/compute.d.ts +0 -5
  214. package/lib/config/env-config.d.ts +0 -5
  215. package/lib/config/index.d.ts +0 -1
  216. package/lib/constants/Colors.d.ts +0 -61
  217. package/lib/constants/Layout.d.ts +0 -8
  218. package/lib/constants/device.d.ts +0 -10
  219. package/lib/constants/fonts.d.ts +0 -8
  220. package/lib/constants/globalStyles.d.ts +0 -202
  221. package/lib/constants/index.d.ts +0 -8
  222. package/lib/constants/preloadImages.d.ts +0 -14
  223. package/lib/constants/routes.d.ts +0 -36
  224. package/lib/hooks/index.d.ts +0 -6
  225. package/lib/hooks/useCachedResources.d.ts +0 -1
  226. package/lib/hooks/useColorScheme.d.ts +0 -2
  227. package/lib/hooks/useColorScheme.web.d.ts +0 -1
  228. package/lib/hooks/useDisclose.d.ts +0 -5
  229. package/lib/hooks/useDrawerLayout.d.ts +0 -18
  230. package/lib/hooks/useExpoNotificationProvider.d.ts +0 -7
  231. package/lib/hooks/useIsAuthenticated.d.ts +0 -2
  232. package/lib/index.d.ts +0 -10
  233. package/lib/locales/en/index.d.ts +0 -3
  234. package/lib/locales/fr/index.d.ts +0 -2
  235. package/lib/locales/index.d.ts +0 -1
  236. package/lib/module.d.ts +0 -3
  237. package/lib/navigation/AccountNavigator.d.ts +0 -2
  238. package/lib/navigation/ActivityNavigator.d.ts +0 -2
  239. package/lib/navigation/ExploreNavigator.d.ts +0 -2
  240. package/lib/navigation/InboxNavigator.d.ts +0 -2
  241. package/lib/navigation/InboxTabNavigation.d.ts +0 -3
  242. package/lib/navigation/MentionsNavigator.d.ts +0 -2
  243. package/lib/navigation/SearchNavigator.d.ts +0 -2
  244. package/lib/navigation/SearchTabNavigation.d.ts +0 -3
  245. package/lib/navigation/TeamTabNavigation.d.ts +0 -3
  246. package/lib/navigation/index.d.ts +0 -3
  247. package/lib/screens/Account/AccountScreen.d.ts +0 -3
  248. package/lib/screens/Account/index.d.ts +0 -2
  249. package/lib/screens/Activity/ActivityScreen.d.ts +0 -7
  250. package/lib/screens/Activity/index.d.ts +0 -2
  251. package/lib/screens/Activity/styles.d.ts +0 -85
  252. package/lib/screens/Channels/Add/AddName.d.ts +0 -3
  253. package/lib/screens/Channels/Add/AddVisibility.d.ts +0 -3
  254. package/lib/screens/Channels/Add/index.d.ts +0 -3
  255. package/lib/screens/Channels/AddChannel.d.ts +0 -3
  256. package/lib/screens/Channels/Channels.d.ts +0 -3
  257. package/lib/screens/Channels/index.d.ts +0 -4
  258. package/lib/screens/Files/FilesScreen.d.ts +0 -6
  259. package/lib/screens/Files/index.d.ts +0 -2
  260. package/lib/screens/Home/Components/Channels/Channels.d.ts +0 -9
  261. package/lib/screens/Home/Components/Channels/index.d.ts +0 -2
  262. package/lib/screens/Home/Components/DirectChannels/DirectChannels.d.ts +0 -3
  263. package/lib/screens/Home/Components/DirectChannels/index.d.ts +0 -2
  264. package/lib/screens/Home/Components/Teams/Teams.d.ts +0 -7
  265. package/lib/screens/Home/Components/Teams/index.d.ts +0 -2
  266. package/lib/screens/Home/Components/TopCommonSlider/TopCommonSlider.d.ts +0 -3
  267. package/lib/screens/Home/Components/TopCommonSlider/index.d.ts +0 -2
  268. package/lib/screens/Home/HomeScreen.d.ts +0 -3
  269. package/lib/screens/Home/index.d.ts +0 -2
  270. package/lib/screens/Home/styles.d.ts +0 -86
  271. package/lib/screens/Inbox/InboxChannelDetail.d.ts +0 -3
  272. package/lib/screens/Inbox/InboxDialogMessages.d.ts +0 -3
  273. package/lib/screens/Inbox/InboxScreen.d.ts +0 -3
  274. package/lib/screens/Inbox/InboxThreadMessages.d.ts +0 -3
  275. package/lib/screens/Inbox/InboxThreads.d.ts +0 -3
  276. package/lib/screens/Inbox/index.d.ts +0 -3
  277. package/lib/screens/Login.d.ts +0 -3
  278. package/lib/screens/Notification/NotificationsScreen.d.ts +0 -2
  279. package/lib/screens/Notification/index.d.ts +0 -2
  280. package/lib/screens/Organization/AddWorkspace.d.ts +0 -3
  281. package/lib/screens/Organization/CreateOrganization.d.ts +0 -3
  282. package/lib/screens/Organization/InitialChannelOnboarding.d.ts +0 -3
  283. package/lib/screens/Organization/InitializeOrganizationChannel.d.ts +0 -3
  284. package/lib/screens/Organization/InviteOrganizationMembers.d.ts +0 -3
  285. package/lib/screens/Organization/index.d.ts +0 -6
  286. package/lib/screens/Peoples/AddByEmail.d.ts +0 -3
  287. package/lib/screens/Peoples/AddFromContacts.d.ts +0 -3
  288. package/lib/screens/Peoples/AddPeople.d.ts +0 -3
  289. package/lib/screens/Peoples/People.d.ts +0 -3
  290. package/lib/screens/Peoples/index.d.ts +0 -5
  291. package/lib/screens/Profile/ProfileScreen.d.ts +0 -3
  292. package/lib/screens/Profile/index.d.ts +0 -2
  293. package/lib/screens/Profile/styles.d.ts +0 -83
  294. package/lib/screens/Saved/SavedScreen.d.ts +0 -7
  295. package/lib/screens/Saved/index.d.ts +0 -2
  296. package/lib/screens/Saved/styles.d.ts +0 -85
  297. package/lib/screens/Search/Channels.d.ts +0 -6
  298. package/lib/screens/Search/Files.d.ts +0 -3
  299. package/lib/screens/Search/JumpTo.d.ts +0 -4
  300. package/lib/screens/Search/People.d.ts +0 -6
  301. package/lib/screens/Search/Recents.d.ts +0 -6
  302. package/lib/screens/Search/SearchAddChannel.d.ts +0 -4
  303. package/lib/screens/Search/SearchChannelPeople.d.ts +0 -4
  304. package/lib/screens/Search/SearchScreen.d.ts +0 -5
  305. package/lib/screens/Search/index.d.ts +0 -5
  306. package/lib/screens/Search/styles.d.ts +0 -83
  307. package/lib/screens/Teams/AddTeam.d.ts +0 -3
  308. package/lib/screens/Teams/Components/Channels/Channels.d.ts +0 -3
  309. package/lib/screens/Teams/Components/Channels/index.d.ts +0 -2
  310. package/lib/screens/Teams/Components/Members/Members.d.ts +0 -8
  311. package/lib/screens/Teams/Components/Members/index.d.ts +0 -2
  312. package/lib/screens/Teams/Team.d.ts +0 -7
  313. package/lib/screens/Teams/Teams.d.ts +0 -3
  314. package/lib/screens/Teams/index.d.ts +0 -4
  315. package/lib/screens/Wiki/WikiScreen.d.ts +0 -6
  316. package/lib/screens/Wiki/index.d.ts +0 -2
  317. package/lib/screens/index.d.ts +0 -16
  318. package/lib/theme/index.d.ts +0 -11
@@ -1,6 +1,25 @@
1
- import {__awaiter}from'tslib';import React__default,{useState,useEffect,useCallback}from'react';import {HStack,Box,Avatar,AvatarFallbackText,AvatarImage,AvatarBadge,Text,Checkbox,CheckboxIndicator,CheckboxIcon,CheckIcon}from'@admin-layout/gluestack-ui-mobile';import {Dimensions,Keyboard,TouchableOpacity}from'react-native';import {RoomType}from'common';import {useGetChannelsByUserLazyQuery,useGetOrganizationMembersWithChannelsQuery}from'common/lib/generated/generated.js';import {DialogMessages}from'@messenger-box/platform-mobile';import {useNavigation,useIsFocused,useFocusEffect}from'@react-navigation/native';import {userSelector}from'@adminide-stack/user-auth0-client';import {useSelector}from'react-redux';import {startCase,uniqBy}from'lodash-es';import {MaterialIcons,Octicons}from'@expo/vector-icons';import'expo-font';import'expo-splash-screen';import {useDrawerLayout}from'../../hooks/useDrawerLayout.js';import'../../hooks/useExpoNotificationProvider.js';import'@react-navigation/core';import'../../components/Header/styles.js';import'../../components/Tiles/styles.js';import'../../components/CustomDrawer/CustomDrawer.js';import'../../components/CustomBottomTabs/CustomBottomTabs.js';import'../../components/NavigationHeader/NavigationHeader.js';import'@react-navigation/elements';import'../../constants/routes.js';import'@common-stack/client-react';import'../../components/NavigationHeader/InboxNavigationHeader.js';import {LoadingSpinnerDefault}from'../../components/LoadingSpinner/index.js';import'../../components/WorkSpaceDrawer/WorkSpaceDrawer.js';import'../../components/Channels/ChannelsByAlphabeticalAccordion.js';import {SlackInput}from'../../components/SlackSearchInput/index.js';const windowWidth = Dimensions.get('window').width;
2
- const windowHeight = Dimensions.get('window').height;
3
- Dimensions.get('screen').height;
1
+ import React__default,{useState,useEffect,useCallback}from'react';import {HStack,Box,Avatar,AvatarFallbackText,AvatarImage,AvatarBadge,Text,Checkbox,CheckboxIndicator,CheckboxIcon,CheckIcon}from'@admin-layout/gluestack-ui-mobile';import {Keyboard,TouchableOpacity,Dimensions}from'react-native';import {RoomType}from'common';import {useGetChannelsByUserLazyQuery,useGetOrganizationMembersWithChannelsQuery}from'common/lib/generated/generated.js';import {DialogMessages}from'@messenger-box/platform-mobile';import {useNavigation,useIsFocused,useFocusEffect}from'@react-navigation/native';import {userSelector}from'@adminide-stack/user-auth0-client';import {useSelector}from'react-redux';import {startCase,uniqBy}from'lodash-es';import {MaterialIcons,Octicons}from'@expo/vector-icons';import'expo-font';import'expo-splash-screen';import {useDrawerLayout}from'../../hooks/useDrawerLayout.js';import'../../hooks/useExpoNotificationProvider.js';import'@react-navigation/core';import'../../components/Header/styles.js';import'../../components/Tiles/styles.js';import'../../components/CustomDrawer/CustomDrawer.js';import'../../components/CustomBottomTabs/CustomBottomTabs.js';import'../../components/NavigationHeader/NavigationHeader.js';import'@react-navigation/elements';import'@common-stack/client-react';import'../../components/NavigationHeader/InboxNavigationHeader.js';import {LoadingSpinnerDefault}from'../../components/LoadingSpinner/index.js';import'../../components/WorkSpaceDrawer/WorkSpaceDrawer.js';import'../../components/Channels/ChannelsByAlphabeticalAccordion.js';import {SlackInput}from'../../components/SlackSearchInput/index.js';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const windowWidth = Dimensions.get("window").width;
21
+ const windowHeight = Dimensions.get("window").height;
22
+ Dimensions.get("screen").height;
4
23
  const defaultChannelType = [RoomType.Channel, RoomType.Private, RoomType.Public, RoomType.Direct];
5
24
  const orgMemersDataFetchLimit = 10;
6
25
  const useKeyboard = () => {
@@ -8,14 +27,13 @@ const useKeyboard = () => {
8
27
  useEffect(() => {
9
28
  function onKeyboardDidShow(e) {
10
29
  var _a, _b;
11
- // Remove type here if not using TypeScript
12
- setKeyboardHeight((_b = (_a = e === null || e === void 0 ? void 0 : e.endCoordinates) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 0);
30
+ setKeyboardHeight((_b = (_a = e == null ? void 0 : e.endCoordinates) == null ? void 0 : _a.height) != null ? _b : 0);
13
31
  }
14
32
  function onKeyboardDidHide() {
15
33
  setKeyboardHeight(0);
16
34
  }
17
- const showSubscription = Keyboard.addListener('keyboardDidShow', onKeyboardDidShow);
18
- const hideSubscription = Keyboard.addListener('keyboardDidHide', onKeyboardDidHide);
35
+ const showSubscription = Keyboard.addListener("keyboardDidShow", onKeyboardDidShow);
36
+ const hideSubscription = Keyboard.addListener("keyboardDidHide", onKeyboardDidHide);
19
37
  return () => {
20
38
  showSubscription.remove();
21
39
  hideSubscription.remove();
@@ -23,8 +41,8 @@ const useKeyboard = () => {
23
41
  }, []);
24
42
  return keyboardHeight;
25
43
  };
26
- const SearchAddChannel = props => {
27
- var _a;
44
+ const SearchAddChannel = (props) => {
45
+ var _a, _b;
28
46
  const navigation = useNavigation();
29
47
  const {
30
48
  orgName,
@@ -34,22 +52,18 @@ const SearchAddChannel = props => {
34
52
  const user = useSelector(userSelector);
35
53
  const [channels, setChannels] = useState([]);
36
54
  const [initialOrgMembers, setInitialOrgMembers] = useState([]);
37
- //const [searchValue, setSearchValue] = useState<any>(route?.params?.searchValue ?? '');
38
- useState([]);
55
+ const [selectedMembers, setSelectedMembers] = useState([]);
39
56
  const [selectedChannels, setSelectedChannels] = useState([]);
40
- useState(false);
57
+ const [showChannels, setShowChannels] = useState(false);
41
58
  const [offset, setOffset] = useState(0);
42
- useState([]);
43
- useState(0);
59
+ const [organizationMembers, setOrganizationMembers] = useState([]);
60
+ const [totalMembers, setTotalMembers] = useState(0);
44
61
  const [channelId, setChannelId] = useState(null);
45
62
  const [isSetInputFocusOut, setInputFocusOut] = useState(false);
46
63
  const [isCreateNewChannel, setIsCreateNewChannel] = useState(false);
47
64
  useKeyboard();
48
- //const suggestions = ['apple', 'orange', 'banana', 'kiwi', 'tadff', 'radfe', 'sadfdf', 'uerer', 'ydafdf', 'zlaood'];
49
- // const [tags, setTags] = useState<string[]>([]);
50
- //const labelExtractor = (tag: string) => tag;
51
65
  const [tags, setTags] = useState([]);
52
- const labelExtractor = tag => (tag === null || tag === void 0 ? void 0 : tag.id) ? tag === null || tag === void 0 ? void 0 : tag.id : tag === null || tag === void 0 ? void 0 : tag.userId;
66
+ const labelExtractor = (tag) => (tag == null ? void 0 : tag.id) ? tag == null ? void 0 : tag.id : tag == null ? void 0 : tag.userId;
53
67
  const [getChannelByUser, {
54
68
  loading: isChannelByUserLoading
55
69
  }] = useGetChannelsByUserLazyQuery();
@@ -60,29 +74,27 @@ const SearchAddChannel = props => {
60
74
  refetch
61
75
  } = useGetOrganizationMembersWithChannelsQuery({
62
76
  variables: {
63
- orgName: orgName,
77
+ orgName,
64
78
  channelCriteria: {
65
- orgName: orgName,
79
+ orgName,
66
80
  type: defaultChannelType
67
81
  },
68
- offset: offset,
82
+ offset,
69
83
  limit: orgMemersDataFetchLimit
70
84
  },
71
- fetchPolicy: 'cache-and-network'
85
+ fetchPolicy: "cache-and-network"
72
86
  });
73
87
  useFocusEffect(React__default.useCallback(() => {
74
88
  refetch({
75
- orgName: orgName,
89
+ orgName,
76
90
  channelCriteria: {
77
- orgName: orgName,
91
+ orgName,
78
92
  type: defaultChannelType
79
93
  },
80
- offset: offset,
94
+ offset,
81
95
  limit: orgMemersDataFetchLimit
82
96
  });
83
97
  return () => {
84
- // Do something when the screen is unfocused
85
- // Useful for cleanup functions
86
98
  setChannels([]);
87
99
  setChannelId(null);
88
100
  setInitialOrgMembers([]);
@@ -90,114 +102,109 @@ const SearchAddChannel = props => {
90
102
  }, [orgName]));
91
103
  React__default.useEffect(() => {
92
104
  navigation.setOptions({
93
- headerLeft: props => React__default.createElement(TouchableOpacity, {
94
- onPress: () => navigation.goBack()
95
- }, React__default.createElement(MaterialIcons, {
96
- size: 20,
97
- name: "close",
98
- color: 'black'
99
- }))
105
+ headerLeft: (props2) => /* @__PURE__ */ React__default.createElement(TouchableOpacity, { onPress: () => navigation.goBack() }, /* @__PURE__ */ React__default.createElement(MaterialIcons, { size: 20, name: "close", color: "black" }))
100
106
  });
101
107
  }, []);
102
108
  React__default.useEffect(() => {
103
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
104
- if (data === null || data === void 0 ? void 0 : data.channelsByUser) {
105
- const allChannels = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.channelsByUser) === null || _a === void 0 ? void 0 : _a.filter(ch => {
106
- var _a, _b, _c;
107
- return ch.type == RoomType.Direct && ((_a = ch === null || ch === void 0 ? void 0 : ch.members) === null || _a === void 0 ? void 0 : _a.length) == 1 && ((_b = ch === null || ch === void 0 ? void 0 : ch.members) === null || _b === void 0 ? void 0 : _b.filter(ch => {
108
- var _a;
109
- return ((_a = ch === null || ch === void 0 ? void 0 : ch.user) === null || _a === void 0 ? void 0 : _a.id) == (user === null || user === void 0 ? void 0 : user.id);
110
- })) ? ch : (_c = ch === null || ch === void 0 ? void 0 : ch.members) === null || _c === void 0 ? void 0 : _c.filter(m => {
111
- var _a;
112
- return ((_a = m === null || m === void 0 ? void 0 : m.user) === null || _a === void 0 ? void 0 : _a.id) != (user === null || user === void 0 ? void 0 : user.id);
109
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
110
+ if (data == null ? void 0 : data.channelsByUser) {
111
+ const allChannels = (_d = (_c = (_b2 = (_a2 = data == null ? void 0 : data.channelsByUser) == null ? void 0 : _a2.filter((ch) => {
112
+ var _a3, _b3, _c2;
113
+ return ch.type == RoomType.Direct && ((_a3 = ch == null ? void 0 : ch.members) == null ? void 0 : _a3.length) == 1 && ((_b3 = ch == null ? void 0 : ch.members) == null ? void 0 : _b3.filter((ch2) => {
114
+ var _a4;
115
+ return ((_a4 = ch2 == null ? void 0 : ch2.user) == null ? void 0 : _a4.id) == (user == null ? void 0 : user.id);
116
+ })) ? ch : (_c2 = ch == null ? void 0 : ch.members) == null ? void 0 : _c2.filter((m) => {
117
+ var _a4;
118
+ return ((_a4 = m == null ? void 0 : m.user) == null ? void 0 : _a4.id) != (user == null ? void 0 : user.id);
113
119
  });
114
- })) === null || _b === void 0 ? void 0 : _b.map(i => {
115
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
120
+ })) == null ? void 0 : _b2.map((i) => {
121
+ var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
116
122
  const ch = {
117
- id: i === null || i === void 0 ? void 0 : i.id,
118
- title: i === null || i === void 0 ? void 0 : i.title,
119
- type: i === null || i === void 0 ? void 0 : i.type
123
+ id: i == null ? void 0 : i.id,
124
+ title: i == null ? void 0 : i.title,
125
+ type: i == null ? void 0 : i.type
120
126
  };
121
- const channelMembers = (_c = (_b = (_a = i.members) === null || _a === void 0 ? void 0 : _a.map(m => m === null || m === void 0 ? void 0 : m.user)) === null || _b === void 0 ? void 0 : _b.filter(ch => {
122
- var _a;
123
- return ((_a = i.members) === null || _a === void 0 ? void 0 : _a.length) == 1 && (ch === null || ch === void 0 ? void 0 : ch.id) == (user === null || user === void 0 ? void 0 : user.id) ? ch : (ch === null || ch === void 0 ? void 0 : ch.id) != (user === null || user === void 0 ? void 0 : user.id);
124
- })) !== null && _c !== void 0 ? _c : null;
125
- const title = ch.type == RoomType.Direct ? (_f = (_e = (_d = channelMembers === null || channelMembers === void 0 ? void 0 : channelMembers.map(u => {
126
- var _a;
127
- return (u === null || u === void 0 ? void 0 : u.givenName) + ' ' + ((_a = u === null || u === void 0 ? void 0 : u.familyName) !== null && _a !== void 0 ? _a : '');
128
- })) === null || _d === void 0 ? void 0 : _d.filter(mu => mu)) === null || _e === void 0 ? void 0 : _e.join(', ')) !== null && _f !== void 0 ? _f : '' : ch.title;
127
+ const channelMembers = (_c2 = (_b3 = (_a3 = i.members) == null ? void 0 : _a3.map((m) => m == null ? void 0 : m.user)) == null ? void 0 : _b3.filter((ch2) => {
128
+ var _a4;
129
+ return ((_a4 = i.members) == null ? void 0 : _a4.length) == 1 && (ch2 == null ? void 0 : ch2.id) == (user == null ? void 0 : user.id) ? ch2 : (ch2 == null ? void 0 : ch2.id) != (user == null ? void 0 : user.id);
130
+ })) != null ? _c2 : null;
131
+ const title = ch.type == RoomType.Direct ? (_f2 = (_e2 = (_d2 = channelMembers == null ? void 0 : channelMembers.map((u) => {
132
+ var _a4;
133
+ return (u == null ? void 0 : u.givenName) + " " + ((_a4 = u == null ? void 0 : u.familyName) != null ? _a4 : "");
134
+ })) == null ? void 0 : _d2.filter((mu) => mu)) == null ? void 0 : _e2.join(", ")) != null ? _f2 : "" : ch.title;
129
135
  ch.title = title;
130
- ch.channelImage = (_g = channelMembers[0]) === null || _g === void 0 ? void 0 : _g.picture;
131
- ch.imageAcronym = startCase((_j = (_h = channelMembers[0]) === null || _h === void 0 ? void 0 : _h.username) === null || _j === void 0 ? void 0 : _j.charAt(0));
136
+ ch.channelImage = (_g2 = channelMembers[0]) == null ? void 0 : _g2.picture;
137
+ ch.imageAcronym = startCase((_i2 = (_h2 = channelMembers[0]) == null ? void 0 : _h2.username) == null ? void 0 : _i2.charAt(0));
132
138
  ch.members = channelMembers;
133
- ch.totalMembers = channelMembers === null || channelMembers === void 0 ? void 0 : channelMembers.length;
139
+ ch.totalMembers = channelMembers == null ? void 0 : channelMembers.length;
134
140
  ch.userId = null;
135
141
  ch.isOrgMembers = false;
136
142
  return ch;
137
- })) === null || _c === void 0 ? void 0 : _c.filter(ch => ch)) !== null && _d !== void 0 ? _d : [];
138
- const existingDirectChannelsToDelete = new Set((_f = (_e = data === null || data === void 0 ? void 0 : data.channelsByUser) === null || _e === void 0 ? void 0 : _e.map(ch => {
139
- var _a;
140
- return (_a = ch === null || ch === void 0 ? void 0 : ch.members) === null || _a === void 0 ? void 0 : _a.map(m => {
141
- var _a;
142
- return (_a = m === null || m === void 0 ? void 0 : m.user) === null || _a === void 0 ? void 0 : _a.id;
143
+ })) == null ? void 0 : _c.filter((ch) => ch)) != null ? _d : [];
144
+ const existingDirectChannelsToDelete = new Set((_f = (_e = data == null ? void 0 : data.channelsByUser) == null ? void 0 : _e.map((ch) => {
145
+ var _a3;
146
+ return (_a3 = ch == null ? void 0 : ch.members) == null ? void 0 : _a3.map((m) => {
147
+ var _a4;
148
+ return (_a4 = m == null ? void 0 : m.user) == null ? void 0 : _a4.id;
143
149
  });
144
- })) === null || _f === void 0 ? void 0 : _f.flat(1));
145
- const allOrgMembers = (_l = (_k = (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.getOrganizationMembers) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.filter(m => {
146
- var _a;
147
- return ((_a = m === null || m === void 0 ? void 0 : m.user) === null || _a === void 0 ? void 0 : _a.id) != (user === null || user === void 0 ? void 0 : user.id);
148
- }).filter(obj => !existingDirectChannelsToDelete.has(obj === null || obj === void 0 ? void 0 : obj.userId))) === null || _j === void 0 ? void 0 : _j.map(i => {
149
- var _a, _b, _c, _d, _e, _f;
150
+ })) == null ? void 0 : _f.flat(1));
151
+ const allOrgMembers = (_k = (_j = (_i = (_h = (_g = data == null ? void 0 : data.getOrganizationMembers) == null ? void 0 : _g.data) == null ? void 0 : _h.filter((m) => {
152
+ var _a3;
153
+ return ((_a3 = m == null ? void 0 : m.user) == null ? void 0 : _a3.id) != (user == null ? void 0 : user.id);
154
+ }).filter((obj) => !existingDirectChannelsToDelete.has(obj == null ? void 0 : obj.userId))) == null ? void 0 : _i.map((i) => {
155
+ var _a3, _b3, _c2, _d2, _e2, _f2;
150
156
  const ch = {
151
157
  id: null,
152
- title: ((_a = i === null || i === void 0 ? void 0 : i.user) === null || _a === void 0 ? void 0 : _a.givenName) + ' ' + ((_b = i === null || i === void 0 ? void 0 : i.user) === null || _b === void 0 ? void 0 : _b.familyName),
158
+ title: ((_a3 = i == null ? void 0 : i.user) == null ? void 0 : _a3.givenName) + " " + ((_b3 = i == null ? void 0 : i.user) == null ? void 0 : _b3.familyName),
153
159
  type: RoomType.Direct,
154
- channelImage: (_c = i === null || i === void 0 ? void 0 : i.user) === null || _c === void 0 ? void 0 : _c.picture,
155
- imageAcronym: startCase((_e = (_d = i === null || i === void 0 ? void 0 : i.user) === null || _d === void 0 ? void 0 : _d.username) === null || _e === void 0 ? void 0 : _e.charAt(0)),
160
+ channelImage: (_c2 = i == null ? void 0 : i.user) == null ? void 0 : _c2.picture,
161
+ imageAcronym: startCase((_e2 = (_d2 = i == null ? void 0 : i.user) == null ? void 0 : _d2.username) == null ? void 0 : _e2.charAt(0)),
156
162
  members: [],
157
163
  totalMembers: 1,
158
- userId: (_f = i === null || i === void 0 ? void 0 : i.user) === null || _f === void 0 ? void 0 : _f.id,
164
+ userId: (_f2 = i == null ? void 0 : i.user) == null ? void 0 : _f2.id,
159
165
  isOrgMembers: true
160
166
  };
161
167
  return ch;
162
- })) === null || _k === void 0 ? void 0 : _k.filter(ch => ch)) !== null && _l !== void 0 ? _l : [];
163
- setChannels(oldChannels => uniqBy([...allChannels, ...allOrgMembers, ...oldChannels], ({
168
+ })) == null ? void 0 : _j.filter((ch) => ch)) != null ? _k : [];
169
+ setChannels((oldChannels) => uniqBy([...allChannels, ...allOrgMembers, ...oldChannels], ({
164
170
  id,
165
171
  userId
166
172
  }) => id + userId));
167
- setInitialOrgMembers(oldChannels => uniqBy([...allChannels, ...allOrgMembers, ...oldChannels], ({
173
+ setInitialOrgMembers((oldChannels) => uniqBy([...allChannels, ...allOrgMembers, ...oldChannels], ({
168
174
  id,
169
175
  userId
170
176
  }) => id + userId));
171
177
  }
172
178
  }, [data]);
173
179
  React__default.useEffect(() => {
174
- var _a;
175
- if (channelId && (tags === null || tags === void 0 ? void 0 : tags.length) === 0) setChannelId(null);
176
- if (!channelId && (tags === null || tags === void 0 ? void 0 : tags.length) > 0) {
177
- const userIds = [...new Set((_a = tags === null || tags === void 0 ? void 0 : tags.map(t => {
178
- var _a;
179
- return (t === null || t === void 0 ? void 0 : t.userId) ? t === null || t === void 0 ? void 0 : t.userId : (_a = t === null || t === void 0 ? void 0 : t.members) === null || _a === void 0 ? void 0 : _a.map(m => m === null || m === void 0 ? void 0 : m.id);
180
- })) === null || _a === void 0 ? void 0 : _a.flat(1))];
180
+ var _a2;
181
+ if (channelId && (tags == null ? void 0 : tags.length) === 0)
182
+ setChannelId(null);
183
+ if (!channelId && (tags == null ? void 0 : tags.length) > 0) {
184
+ const userIds = [...new Set((_a2 = tags == null ? void 0 : tags.map((t) => {
185
+ var _a3;
186
+ return (t == null ? void 0 : t.userId) ? t == null ? void 0 : t.userId : (_a3 = t == null ? void 0 : t.members) == null ? void 0 : _a3.map((m) => m == null ? void 0 : m.id);
187
+ })) == null ? void 0 : _a2.flat(1))];
181
188
  getChannelId(userIds);
182
189
  }
183
- console.log('channelid', channelId, ' tags?.length', tags === null || tags === void 0 ? void 0 : tags.length);
190
+ console.log("channelid", channelId, " tags?.length", tags == null ? void 0 : tags.length);
184
191
  }, [channelId, tags, orgName]);
185
- const getChannelId = React__default.useCallback(userIds => __awaiter(void 0, void 0, void 0, function* () {
186
- var _a, _b, _c, _d, _e;
187
- const res = yield getChannelByUser({
192
+ const getChannelId = React__default.useCallback(async (userIds) => {
193
+ var _a2, _b2, _c, _d, _e;
194
+ const res = await getChannelByUser({
188
195
  variables: {
189
196
  criteria: {
190
- orgName: orgName,
197
+ orgName,
191
198
  type: RoomType.Direct,
192
- 'members.user': {
193
- $all: [...userIds, user === null || user === void 0 ? void 0 : user.id]
199
+ "members.user": {
200
+ $all: [...userIds, user == null ? void 0 : user.id]
194
201
  }
195
202
  },
196
203
  limit: 1
197
204
  }
198
205
  });
199
- if (((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.channelsByUser) === null || _b === void 0 ? void 0 : _b.length) > 0) {
200
- setChannelId((_e = (_d = (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.channelsByUser) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.id);
206
+ if (((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.channelsByUser) == null ? void 0 : _b2.length) > 0) {
207
+ setChannelId((_e = (_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.channelsByUser) == null ? void 0 : _d[0]) == null ? void 0 : _e.id);
201
208
  setInputFocusOut(true);
202
209
  setIsCreateNewChannel(false);
203
210
  } else {
@@ -205,372 +212,162 @@ const SearchAddChannel = props => {
205
212
  setInputFocusOut(false);
206
213
  setIsCreateNewChannel(true);
207
214
  }
208
- // ?.then((res) => {
209
- // if (res?.data?.channelsByUser?.length > 0) {
210
- // setChannelId(res?.data?.channelsByUser?.[0]?.id);
211
- // setInputFocusOut(true);
212
- // } else {
213
- // setChannelId(null);
214
- // setInputFocusOut(false);
215
- // }
216
- // });
217
- }), [orgName, user]);
218
- // const renderChannels = ({ item }: any) => {
219
- // return (
220
- // <TouchableOpacity key={item?.id} style={{ marginVertical: 10 }} onPress={() => selectChannels(item)}>
221
- // <HStack flex={1} alignItems={'center'} justifyContent={'space-between'}>
222
- // <HStack flex={1} alignItems={'center'} space={6}>
223
- // <Box m={0} p={0}>
224
- // {item.type == RoomType.Direct ? (
225
- // <Avatar
226
- // key={'direct-channel-profile-msg-key'}
227
- // size={5}
228
- // bg={'transparent'}
229
- // borderRadius={6}
230
- // _image={{
231
- // borderRadius: 6,
232
- // size: 5,
233
- // }}
234
- // source={{
235
- // uri: item?.channelImage,
236
- // }}
237
- // >
238
- // {item?.imageAcronym}
239
- // {item?.totalMembers > 1 ? (
240
- // <Avatar.Badge
241
- // top={2}
242
- // right={-12}
243
- // size={5}
244
- // alignItems={'center'}
245
- // bg={'#211627'}
246
- // // opacity={0.85}
247
- // _text={{
248
- // fontSize: 10,
249
- // fontWeight: 'bold',
250
- // color: '#fff',
251
- // }}
252
- // rounded={'md'}
253
- // >
254
- // {item?.totalMembers}
255
- // </Avatar.Badge>
256
- // ) : (
257
- // <Avatar.Badge bg="green.800" bottom={-4} right={-4} />
258
- // )}
259
- // </Avatar>
260
- // ) : item.type == RoomType.Private ? (
261
- // <>
262
- // <Icon color="black" as={Octicons} name="lock" size="md" />
263
- // </>
264
- // ) : (
265
- // <Icon color="black" as={Octicons} name="hash" size="md" />
266
- // )}
267
- // </Box>
268
- // <Text
269
- // _dark={{
270
- // color: 'warmGray.50',
271
- // }}
272
- // color="coolGray.800"
273
- // bold
274
- // >
275
- // {item.title}
276
- // </Text>
277
- // </HStack>
278
- // <Checkbox
279
- // // onChange={() => selectChannels(item)}
280
- // value={item?.id}
281
- // isChecked={
282
- // selectedChannels &&
283
- // selectedChannels?.filter((ch: any) => ch?.id === item?.id && ch?.userId === item?.userId)
284
- // ?.length > 0
285
- // ? true
286
- // : false
287
- // }
288
- // accessibilityLabel={item.title ?? ''}
289
- // aria-label={item.title ?? ''}
290
- // aria-labelledby={item.title ?? ''}
291
- // borderColor={'gray.600'}
292
- // />
293
- // </HStack>
294
- // </TouchableOpacity>
295
- // );
296
- // };
297
- React__default.useCallback(item => {
298
- // setSearchValue(item?.title);
215
+ }, [orgName, user]);
216
+ React__default.useCallback((item) => {
299
217
  openInbox(item);
300
218
  if (selectedChannels) {
301
- const findIndex = selectedChannels.findIndex(ch => (ch === null || ch === void 0 ? void 0 : ch.id) == (item === null || item === void 0 ? void 0 : item.id) && (ch === null || ch === void 0 ? void 0 : ch.userId) == (item === null || item === void 0 ? void 0 : item.userId));
219
+ const findIndex = selectedChannels.findIndex((ch) => (ch == null ? void 0 : ch.id) == (item == null ? void 0 : item.id) && (ch == null ? void 0 : ch.userId) == (item == null ? void 0 : item.userId));
302
220
  const selectedChannelValue = findIndex === -1 ? [...selectedChannels, {
303
- id: item === null || item === void 0 ? void 0 : item.id,
304
- userId: item === null || item === void 0 ? void 0 : item.userId
305
- }] : selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.filter(ch => (item === null || item === void 0 ? void 0 : item.isOrgMembers) ? (ch === null || ch === void 0 ? void 0 : ch.userId) !== (item === null || item === void 0 ? void 0 : item.userId) : (ch === null || ch === void 0 ? void 0 : ch.id) !== (item === null || item === void 0 ? void 0 : item.id));
221
+ id: item == null ? void 0 : item.id,
222
+ userId: item == null ? void 0 : item.userId
223
+ }] : selectedChannels == null ? void 0 : selectedChannels.filter((ch) => (item == null ? void 0 : item.isOrgMembers) ? (ch == null ? void 0 : ch.userId) !== (item == null ? void 0 : item.userId) : (ch == null ? void 0 : ch.id) !== (item == null ? void 0 : item.id));
306
224
  setSelectedChannels(selectedChannelValue);
307
225
  }
308
226
  }, [selectedChannels]);
309
- const openInbox = React__default.useCallback(item => {
310
- // navigation.push(NavigationRoutes.SearchAddChannel, {
311
- // channelId: item?.id?.toString() || null,
312
- // searchValue: item?.title || '',
313
- // isCreateNewChannel: item?.id == null ? true : false,
314
- // userId: item?.userId,
315
- // orgName: orgName,
316
- // });
227
+ const openInbox = React__default.useCallback((item) => {
317
228
  }, [orgName]);
318
229
  const renderChannelSuggestions = useCallback((item, onPress, index) => {
319
- var _a, _b, _c, _d;
320
- return React__default.createElement(TouchableOpacity, {
321
- key: `channel-suggestions-${index}`,
322
- style: {
323
- marginVertical: 10
324
- },
325
- onPress: () => onPress(item)
326
- }, React__default.createElement(HStack, {
327
- flex: 1,
328
- bg: 'white',
329
- alignItems: 'center',
330
- justifyContent: 'space-between'
331
- }, React__default.createElement(HStack, {
332
- flex: 1,
333
- alignItems: 'center',
334
- space: 'sm'
335
- }, React__default.createElement(Box, {
336
- m: '$0',
337
- p: '$0'
338
- }, item.type == RoomType.Direct ? React__default.createElement(Avatar, {
339
- size: 'sm',
340
- bg: 'transparent'
341
- }, React__default.createElement(AvatarFallbackText, null, item === null || item === void 0 ? void 0 : item.imageAcronym), React__default.createElement(AvatarImage, {
342
- alt: "image",
343
- size: 'md',
344
- style: {
345
- // width: 25,
346
- // height: 25,
347
- borderRadius: 6,
348
- borderWidth: 2,
349
- borderColor: '#fff'
350
- },
351
- source: {
352
- uri: item === null || item === void 0 ? void 0 : item.channelImage
353
- }
354
- }), (item === null || item === void 0 ? void 0 : item.totalMembers) > 1 ? React__default.createElement(AvatarBadge
355
- // top={4}
356
- , {
357
- // top={4}
358
- right: '-$1',
359
- bottom: '-$1',
360
- // size={5}
361
- style: {
362
- width: 20,
363
- height: 20
230
+ var _a2, _b2, _c, _d;
231
+ return /* @__PURE__ */ React__default.createElement(TouchableOpacity, { key: `channel-suggestions-${index}`, style: {
232
+ marginVertical: 10
233
+ }, onPress: () => onPress(item) }, /* @__PURE__ */ React__default.createElement(HStack, { flex: 1, bg: "white", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React__default.createElement(HStack, { flex: 1, alignItems: "center", space: "sm" }, /* @__PURE__ */ React__default.createElement(Box, { m: "$0", p: "$0" }, item.type == RoomType.Direct ? /* @__PURE__ */ React__default.createElement(Avatar, { size: "sm", bg: "transparent" }, /* @__PURE__ */ React__default.createElement(AvatarFallbackText, null, item == null ? void 0 : item.imageAcronym), /* @__PURE__ */ React__default.createElement(AvatarImage, { alt: "image", size: "md", style: {
234
+ borderRadius: 6,
235
+ borderWidth: 2,
236
+ borderColor: "#fff"
237
+ }, source: {
238
+ uri: item == null ? void 0 : item.channelImage
239
+ } }), (item == null ? void 0 : item.totalMembers) > 1 ? /* @__PURE__ */ React__default.createElement(
240
+ AvatarBadge,
241
+ {
242
+ right: "-$1",
243
+ bottom: "-$1",
244
+ style: {
245
+ width: 20,
246
+ height: 20
247
+ },
248
+ alignItems: "center",
249
+ bg: "#211627",
250
+ rounded: "$md"
364
251
  },
365
- alignItems: 'center',
366
- bg: '#211627',
367
- // opacity={0.85}
368
- rounded: '$md'
369
- }, React__default.createElement(Text, {
370
- style: {
252
+ /* @__PURE__ */ React__default.createElement(Text, { style: {
371
253
  fontSize: 12,
372
- fontWeight: 'bold',
373
- color: '#fff'
374
- }
375
- }, item === null || item === void 0 ? void 0 : item.totalMembers)) : React__default.createElement(AvatarBadge, {
376
- style: {
377
- width: 10,
378
- height: 10
379
- },
380
- bg: "$green800"
381
- })) : item.type == RoomType.Private ? React__default.createElement(React__default.Fragment, null, React__default.createElement(Octicons, {
382
- color: "black",
383
- name: "lock",
384
- size: 20
385
- })) : React__default.createElement(Octicons, {
386
- color: "black",
387
- name: "hash",
388
- size: 20
389
- })), React__default.createElement(Text, {
390
- color: "$coolGray800",
391
- fontWeight: "$bold"
392
- }, item.title)), React__default.createElement(Checkbox, {
393
- value: item === null || item === void 0 ? void 0 : item.id,
394
- isChecked: selectedChannels && ((_a = selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.filter(ch => (ch === null || ch === void 0 ? void 0 : ch.id) === (item === null || item === void 0 ? void 0 : item.id) && (ch === null || ch === void 0 ? void 0 : ch.userId) === (item === null || item === void 0 ? void 0 : item.userId))) === null || _a === void 0 ? void 0 : _a.length) > 0 ? true : false,
395
- accessibilityLabel: (_b = item.title) !== null && _b !== void 0 ? _b : '',
396
- "aria-label": (_c = item.title) !== null && _c !== void 0 ? _c : '',
397
- "aria-labelledby": (_d = item.title) !== null && _d !== void 0 ? _d : '',
398
- borderColor: '$trueGray600'
399
- }, React__default.createElement(CheckboxIndicator, null, React__default.createElement(CheckboxIcon, {
400
- as: CheckIcon
401
- })))));
254
+ fontWeight: "bold",
255
+ color: "#fff"
256
+ } }, item == null ? void 0 : item.totalMembers)
257
+ ) : /* @__PURE__ */ React__default.createElement(AvatarBadge, { style: {
258
+ width: 10,
259
+ height: 10
260
+ }, bg: "$green800" })) : item.type == RoomType.Private ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Octicons, { color: "black", name: "lock", size: 20 })) : /* @__PURE__ */ React__default.createElement(Octicons, { color: "black", name: "hash", size: 20 })), /* @__PURE__ */ React__default.createElement(Text, { color: "$coolGray800", fontWeight: "$bold" }, item.title)), /* @__PURE__ */ React__default.createElement(Checkbox, { value: item == null ? void 0 : item.id, isChecked: selectedChannels && ((_a2 = selectedChannels == null ? void 0 : selectedChannels.filter((ch) => (ch == null ? void 0 : ch.id) === (item == null ? void 0 : item.id) && (ch == null ? void 0 : ch.userId) === (item == null ? void 0 : item.userId))) == null ? void 0 : _a2.length) > 0 ? true : false, accessibilityLabel: (_b2 = item.title) != null ? _b2 : "", "aria-label": (_c = item.title) != null ? _c : "", "aria-labelledby": (_d = item.title) != null ? _d : "", borderColor: "$trueGray600" }, /* @__PURE__ */ React__default.createElement(CheckboxIndicator, null, /* @__PURE__ */ React__default.createElement(CheckboxIcon, { as: CheckIcon })))));
402
261
  }, []);
403
- const onSuggestionPress = useCallback(item => {
404
- var _a, _b;
262
+ const onSuggestionPress = useCallback((item) => {
263
+ var _a2, _b2;
405
264
  if (tags) {
406
- const findIndex = tags === null || tags === void 0 ? void 0 : tags.findIndex(ch => (ch === null || ch === void 0 ? void 0 : ch.id) == (item === null || item === void 0 ? void 0 : item.id) && (ch === null || ch === void 0 ? void 0 : ch.userId) == (item === null || item === void 0 ? void 0 : item.userId));
265
+ const findIndex = tags == null ? void 0 : tags.findIndex((ch) => (ch == null ? void 0 : ch.id) == (item == null ? void 0 : item.id) && (ch == null ? void 0 : ch.userId) == (item == null ? void 0 : item.userId));
407
266
  if (findIndex === -1) {
408
- // setTags([...tags, item])
409
- if ((item === null || item === void 0 ? void 0 : item.id) && (item === null || item === void 0 ? void 0 : item.type) !== RoomType.Direct) {
410
- setChannelId(item === null || item === void 0 ? void 0 : item.id);
267
+ if ((item == null ? void 0 : item.id) && (item == null ? void 0 : item.type) !== RoomType.Direct) {
268
+ setChannelId(item == null ? void 0 : item.id);
411
269
  setInputFocusOut(true);
412
270
  setTags([item]);
413
271
  } else {
414
- const previousTags = (_a = tags === null || tags === void 0 ? void 0 : tags.filter(t => (t === null || t === void 0 ? void 0 : t.type) === (item === null || item === void 0 ? void 0 : item.type))) !== null && _a !== void 0 ? _a : [];
415
- const currentTags = [...(previousTags !== null && previousTags !== void 0 ? previousTags : []), item];
272
+ const previousTags = (_a2 = tags == null ? void 0 : tags.filter((t) => (t == null ? void 0 : t.type) === (item == null ? void 0 : item.type))) != null ? _a2 : [];
273
+ const currentTags = [...previousTags != null ? previousTags : [], item];
416
274
  setTags(currentTags);
417
- const userIds = [...new Set((_b = currentTags === null || currentTags === void 0 ? void 0 : currentTags.map(t => {
418
- var _a;
419
- return (t === null || t === void 0 ? void 0 : t.userId) ? t === null || t === void 0 ? void 0 : t.userId : (_a = t === null || t === void 0 ? void 0 : t.members) === null || _a === void 0 ? void 0 : _a.map(m => m === null || m === void 0 ? void 0 : m.id);
420
- })) === null || _b === void 0 ? void 0 : _b.flat(1))];
275
+ const userIds = [...new Set((_b2 = currentTags == null ? void 0 : currentTags.map((t) => {
276
+ var _a3;
277
+ return (t == null ? void 0 : t.userId) ? t == null ? void 0 : t.userId : (_a3 = t == null ? void 0 : t.members) == null ? void 0 : _a3.map((m) => m == null ? void 0 : m.id);
278
+ })) == null ? void 0 : _b2.flat(1))];
421
279
  getChannelId(userIds);
422
280
  }
423
281
  }
424
282
  }
425
283
  }, [tags, orgName]);
426
- const onTagPress = useCallback(item => {
284
+ const onTagPress = useCallback((item) => {
427
285
  if (tags) {
428
- const filteredValue = tags === null || tags === void 0 ? void 0 : tags.filter(ch => (item === null || item === void 0 ? void 0 : item.isOrgMembers) ? (ch === null || ch === void 0 ? void 0 : ch.userId) !== (item === null || item === void 0 ? void 0 : item.userId) : (ch === null || ch === void 0 ? void 0 : ch.id) !== (item === null || item === void 0 ? void 0 : item.id));
286
+ const filteredValue = tags == null ? void 0 : tags.filter((ch) => (item == null ? void 0 : item.isOrgMembers) ? (ch == null ? void 0 : ch.userId) !== (item == null ? void 0 : item.userId) : (ch == null ? void 0 : ch.id) !== (item == null ? void 0 : item.id));
429
287
  setTags(filteredValue);
430
- console.log('tagpress');
288
+ console.log("tagpress");
431
289
  }
432
290
  }, [tags]);
433
291
  const renderTagItemImage = useCallback((type, image, imageAcronym) => {
434
- return React__default.createElement(Box, {
435
- m: '$0',
436
- p: '$0'
437
- }, type == RoomType.Direct ? React__default.createElement(Avatar, {
438
- size: 'sm',
439
- bg: 'transparent',
440
- borderRadius: 6
441
- }, React__default.createElement(AvatarImage, {
442
- alt: "image",
443
- size: 'md',
444
- style: {
445
- // width: 25,
446
- // height: 25,
447
- borderRadius: 6,
448
- borderWidth: 2,
449
- borderColor: '#fff'
450
- },
451
- source: {
452
- uri: image
453
- }
454
- }), React__default.createElement(AvatarFallbackText, null, imageAcronym)) : type == RoomType.Private ? React__default.createElement(React__default.Fragment, null, React__default.createElement(Octicons, {
455
- color: "black",
456
- name: "lock",
457
- size: 20
458
- })) : React__default.createElement(Octicons, {
459
- color: "black",
460
- name: "hash",
461
- size: 20
462
- }));
292
+ return /* @__PURE__ */ React__default.createElement(Box, { m: "$0", p: "$0" }, type == RoomType.Direct ? /* @__PURE__ */ React__default.createElement(Avatar, { size: "sm", bg: "transparent", borderRadius: 6 }, /* @__PURE__ */ React__default.createElement(AvatarImage, { alt: "image", size: "md", style: {
293
+ borderRadius: 6,
294
+ borderWidth: 2,
295
+ borderColor: "#fff"
296
+ }, source: {
297
+ uri: image
298
+ } }), /* @__PURE__ */ React__default.createElement(AvatarFallbackText, null, imageAcronym)) : type == RoomType.Private ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Octicons, { color: "black", name: "lock", size: 20 })) : /* @__PURE__ */ React__default.createElement(Octicons, { color: "black", name: "hash", size: 20 }));
463
299
  }, []);
464
300
  const renderTagItem = useCallback((title, type, image, imageAcronym, key) => {
465
- return React__default.createElement(HStack, {
466
- alignItems: 'center',
467
- space: 'sm',
468
- py: '$2',
469
- key: `render-tag-items-${key}`
470
- }, renderTagItemImage(type, image, imageAcronym), React__default.createElement(Box, {
471
- bg: '$lightBlue100'
472
- }, React__default.createElement(Text, {
473
- color: '$coolGray800',
474
- textAlign: 'center',
475
- bold: true
476
- }, title)));
301
+ return /* @__PURE__ */ React__default.createElement(HStack, { alignItems: "center", space: "sm", py: "$2", key: `render-tag-items-${key}` }, renderTagItemImage(type, image, imageAcronym), /* @__PURE__ */ React__default.createElement(Box, { bg: "$lightBlue100" }, /* @__PURE__ */ React__default.createElement(Text, { color: "$coolGray800", textAlign: "center", bold: true }, title)));
477
302
  }, []);
478
303
  const renderTag = useCallback((item, onPress, index) => {
479
- var _a;
480
- return React__default.createElement(TouchableOpacity, {
481
- onPress: () => onPress(item),
482
- key: `channel-tags-${index}`
483
- }, item.isOrgMembers || (item === null || item === void 0 ? void 0 : item.type) != RoomType.Direct ? React__default.createElement(Box, {
484
- mx: '$1'
485
- }, renderTagItem(item === null || item === void 0 ? void 0 : item.title, item === null || item === void 0 ? void 0 : item.type, item === null || item === void 0 ? void 0 : item.channelImage, item === null || item === void 0 ? void 0 : item.imageAcronym, index)) : React__default.createElement(HStack, {
486
- alignItems: 'center',
487
- space: 'sm',
488
- py: '$1'
489
- }, (_a = item === null || item === void 0 ? void 0 : item.members) === null || _a === void 0 ? void 0 : _a.map((m, i) => {
490
- var _a;
491
- const title = (item === null || item === void 0 ? void 0 : item.type) == RoomType.Direct ? (m === null || m === void 0 ? void 0 : m.givenName) + ' ' + (m === null || m === void 0 ? void 0 : m.familyName) : item.title;
492
- const acronym = startCase((_a = m === null || m === void 0 ? void 0 : m.username) === null || _a === void 0 ? void 0 : _a.charAt(0));
493
- return renderTagItem(title, item === null || item === void 0 ? void 0 : item.type, m === null || m === void 0 ? void 0 : m.picture, acronym, i);
304
+ var _a2;
305
+ return /* @__PURE__ */ React__default.createElement(TouchableOpacity, { onPress: () => onPress(item), key: `channel-tags-${index}` }, item.isOrgMembers || (item == null ? void 0 : item.type) != RoomType.Direct ? /* @__PURE__ */ React__default.createElement(Box, { mx: "$1" }, renderTagItem(item == null ? void 0 : item.title, item == null ? void 0 : item.type, item == null ? void 0 : item.channelImage, item == null ? void 0 : item.imageAcronym, index)) : /* @__PURE__ */ React__default.createElement(HStack, { alignItems: "center", space: "sm", py: "$1" }, (_a2 = item == null ? void 0 : item.members) == null ? void 0 : _a2.map((m, i) => {
306
+ var _a3;
307
+ const title = (item == null ? void 0 : item.type) == RoomType.Direct ? (m == null ? void 0 : m.givenName) + " " + (m == null ? void 0 : m.familyName) : item.title;
308
+ const acronym = startCase((_a3 = m == null ? void 0 : m.username) == null ? void 0 : _a3.charAt(0));
309
+ return renderTagItem(title, item == null ? void 0 : item.type, m == null ? void 0 : m.picture, acronym, i);
494
310
  })));
495
311
  }, []);
496
- return React__default.createElement(Box, {
497
- flex: 1,
498
- bg: '$white',
499
- w: windowWidth,
500
- h: windowHeight
501
- }, React__default.createElement(SlackInput, {
502
- tags: tags,
503
- suggestions: channels,
504
- onChangeTags: setTags,
505
- labelExtractor: labelExtractor,
506
- allowCustomTags: false,
507
- isSetInputFocusOut: isSetInputFocusOut,
508
- renderLeftElement: () => React__default.createElement(Text, {
509
- pl: '$4',
510
- pr: '$1',
511
- fontSize: 15
512
- }, "To:"),
513
- // renderRightElement={() => (
514
- // <Button bg={'transparent'}>
515
- // <SimpleLineIcons color="black" name="user-follow" size={20} />
516
- // </Button>
517
- // )}
518
- tagContainerStyle: {
519
- borderBottomWidth: 1,
520
- borderColor: '#D3D3D3',
521
- paddingVertical: 5
522
- },
523
- inputProps: {
524
- placeholder: 'Search for a channel or conversation',
525
- placeholderTextColor: '#404040',
526
- autoCapitalize: 'none',
527
- autoCorrect: false
528
- },
529
- inputStyle: {
530
- fontSize: 15,
531
- height: 30
532
- },
533
- flatListGluestackUiProps: {
534
- flex: 1,
535
- pb: '$10',
536
- // px: 4,
537
- contentContainerStyle: {
312
+ return /* @__PURE__ */ React__default.createElement(Box, { flex: 1, bg: "$white", w: windowWidth, h: windowHeight }, /* @__PURE__ */ React__default.createElement(
313
+ SlackInput,
314
+ {
315
+ tags,
316
+ suggestions: channels,
317
+ onChangeTags: setTags,
318
+ labelExtractor,
319
+ allowCustomTags: false,
320
+ isSetInputFocusOut,
321
+ renderLeftElement: () => /* @__PURE__ */ React__default.createElement(Text, { pl: "$4", pr: "$1", fontSize: 15 }, "To:"),
322
+ tagContainerStyle: {
323
+ borderBottomWidth: 1,
324
+ borderColor: "#D3D3D3",
325
+ paddingVertical: 5
326
+ },
327
+ inputProps: {
328
+ placeholder: "Search for a channel or conversation",
329
+ placeholderTextColor: "#404040",
330
+ autoCapitalize: "none",
331
+ autoCorrect: false
332
+ },
333
+ inputStyle: {
334
+ fontSize: 15,
335
+ height: 30
336
+ },
337
+ flatListGluestackUiProps: {
538
338
  flex: 1,
539
- marginBottom: 100,
540
- backgroundColor: 'white',
541
- paddingHorizontal: 10
542
- }
543
- },
544
- flatListStyle: {
545
- maxHeight: '100%',
546
- maxWidth: '100%'
547
- // backgroundColor: 'white',
548
- },
549
- renderSuggestion: renderChannelSuggestions,
550
- filterSuggestions: text => {
551
- if (!text || text === '') {
552
- return [];
553
- }
554
- return channels === null || channels === void 0 ? void 0 : channels.filter(item => {
555
- var _a, _b;
556
- return (_b = (_a = item === null || item === void 0 ? void 0 : item.title) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(text === null || text === void 0 ? void 0 : text.toLowerCase());
557
- });
558
- },
559
- onSuggestionPress: onSuggestionPress,
560
- renderTag: renderTag,
561
- onTagPress: onTagPress
562
- }), React__default.createElement(Box, {
563
- flex: 1
564
- }, isChannelByUserLoading ? React__default.createElement(LoadingSpinnerDefault, null) : React__default.createElement(DialogMessages, Object.assign({}, props, {
565
- channelId: channelId,
566
- isCreateNewChannel: isCreateNewChannel,
567
- newChannelData: {
568
- type: RoomType === null || RoomType === void 0 ? void 0 : RoomType.Direct,
569
- userIds: [...new Set((_a = tags === null || tags === void 0 ? void 0 : tags.map(t => {
570
- var _a;
571
- return (t === null || t === void 0 ? void 0 : t.userId) ? t === null || t === void 0 ? void 0 : t.userId : (_a = t === null || t === void 0 ? void 0 : t.members) === null || _a === void 0 ? void 0 : _a.map(m => m === null || m === void 0 ? void 0 : m.id);
572
- })) === null || _a === void 0 ? void 0 : _a.flat(1))]
339
+ pb: "$10",
340
+ contentContainerStyle: {
341
+ flex: 1,
342
+ marginBottom: 100,
343
+ backgroundColor: "white",
344
+ paddingHorizontal: 10
345
+ }
346
+ },
347
+ flatListStyle: {
348
+ maxHeight: "100%",
349
+ maxWidth: "100%"
350
+ },
351
+ renderSuggestion: renderChannelSuggestions,
352
+ filterSuggestions: (text) => {
353
+ if (!text || text === "") {
354
+ return [];
355
+ }
356
+ return channels == null ? void 0 : channels.filter((item) => {
357
+ var _a2, _b2;
358
+ return (_b2 = (_a2 = item == null ? void 0 : item.title) == null ? void 0 : _a2.toLowerCase()) == null ? void 0 : _b2.includes(text == null ? void 0 : text.toLowerCase());
359
+ });
360
+ },
361
+ onSuggestionPress,
362
+ renderTag,
363
+ onTagPress
573
364
  }
574
- }))));
365
+ ), /* @__PURE__ */ React__default.createElement(Box, { flex: 1 }, isChannelByUserLoading ? /* @__PURE__ */ React__default.createElement(LoadingSpinnerDefault, null) : /* @__PURE__ */ React__default.createElement(DialogMessages, __spreadProps(__spreadValues({}, props), { channelId, isCreateNewChannel, newChannelData: {
366
+ type: (_a = RoomType) == null ? void 0 : _a.Direct,
367
+ userIds: [...new Set((_b = tags == null ? void 0 : tags.map((t) => {
368
+ var _a2;
369
+ return (t == null ? void 0 : t.userId) ? t == null ? void 0 : t.userId : (_a2 = t == null ? void 0 : t.members) == null ? void 0 : _a2.map((m) => m == null ? void 0 : m.id);
370
+ })) == null ? void 0 : _b.flat(1))]
371
+ } }))));
575
372
  };
576
373
  var SearchAddChannel$1 = React__default.memo(SearchAddChannel);export{SearchAddChannel$1 as default,useKeyboard};//# sourceMappingURL=SearchAddChannel.js.map