@plusscommunities/pluss-core-app 8.0.0 → 8.0.1-auth.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/module/actions/FollowerActions.js +4 -4
  2. package/dist/module/actions/FollowerActions.js.map +1 -1
  3. package/dist/module/actions/MediaActions.js +1 -1
  4. package/dist/module/actions/MediaActions.js.map +1 -1
  5. package/dist/module/actions/ResidentActions.js +1 -1
  6. package/dist/module/actions/ResidentActions.js.map +1 -1
  7. package/dist/module/actions/UserActions.js +1 -1
  8. package/dist/module/actions/UserActions.js.map +1 -1
  9. package/dist/module/actions/UserSettingsActions.js +1 -1
  10. package/dist/module/actions/UserSettingsActions.js.map +1 -1
  11. package/dist/module/actions/index.js +5 -5
  12. package/dist/module/actions/index.js.map +1 -1
  13. package/dist/module/actions/types.js +16 -16
  14. package/dist/module/actions/types.js.map +1 -1
  15. package/dist/module/apis/analyticsActions.js +5 -5
  16. package/dist/module/apis/analyticsActions.js.map +1 -1
  17. package/dist/module/apis/contactActions.js +6 -6
  18. package/dist/module/apis/contactActions.js.map +1 -1
  19. package/dist/module/apis/eventActions.js +28 -28
  20. package/dist/module/apis/eventActions.js.map +1 -1
  21. package/dist/module/apis/fileActions.js +15 -15
  22. package/dist/module/apis/fileActions.js.map +1 -1
  23. package/dist/module/apis/followerActions.js +8 -8
  24. package/dist/module/apis/followerActions.js.map +1 -1
  25. package/dist/module/apis/index.js +12 -12
  26. package/dist/module/apis/index.js.map +1 -1
  27. package/dist/module/apis/notificationActions.js +17 -17
  28. package/dist/module/apis/notificationActions.js.map +1 -1
  29. package/dist/module/apis/profileActions.js +4 -4
  30. package/dist/module/apis/profileActions.js.map +1 -1
  31. package/dist/module/apis/reactionActions.js +15 -15
  32. package/dist/module/apis/reactionActions.js.map +1 -1
  33. package/dist/module/apis/settingActions.js +6 -6
  34. package/dist/module/apis/settingActions.js.map +1 -1
  35. package/dist/module/apis/stringActions.js +8 -8
  36. package/dist/module/apis/stringActions.js.map +1 -1
  37. package/dist/module/apis/typeActions.js +4 -4
  38. package/dist/module/apis/typeActions.js.map +1 -1
  39. package/dist/module/apis/userActions.js +8 -8
  40. package/dist/module/apis/userActions.js.map +1 -1
  41. package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  42. package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  43. package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  44. package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  45. package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  46. package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  47. package/dist/module/colours.js +26 -29
  48. package/dist/module/colours.js.map +1 -1
  49. package/dist/module/components/AddButton.js +8 -8
  50. package/dist/module/components/AddButton.js.map +1 -1
  51. package/dist/module/components/AddToCalendarButton.js +30 -29
  52. package/dist/module/components/AddToCalendarButton.js.map +1 -1
  53. package/dist/module/components/Attachment.js +10 -9
  54. package/dist/module/components/Attachment.js.map +1 -1
  55. package/dist/module/components/AudienceSelectorLauncher.js +11 -11
  56. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
  57. package/dist/module/components/AudienceSelectorPage.js +45 -44
  58. package/dist/module/components/AudienceSelectorPage.js.map +1 -1
  59. package/dist/module/components/AutoOffsetImage.js +13 -13
  60. package/dist/module/components/AutoOffsetImage.js.map +1 -1
  61. package/dist/module/components/BackButton.js +10 -10
  62. package/dist/module/components/BackButton.js.map +1 -1
  63. package/dist/module/components/CalendarPopup.js +21 -21
  64. package/dist/module/components/CalendarPopup.js.map +1 -1
  65. package/dist/module/components/CategoryTabs.js +30 -29
  66. package/dist/module/components/CategoryTabs.js.map +1 -1
  67. package/dist/module/components/CommentReply.js +43 -37
  68. package/dist/module/components/CommentReply.js.map +1 -1
  69. package/dist/module/components/CommentSection.js +74 -74
  70. package/dist/module/components/CommentSection.js.map +1 -1
  71. package/dist/module/components/ConfirmPopup.js +21 -20
  72. package/dist/module/components/ConfirmPopup.js.map +1 -1
  73. package/dist/module/components/ConfirmationPopup.js +11 -11
  74. package/dist/module/components/ConfirmationPopup.js.map +1 -1
  75. package/dist/module/components/DocumentUploader.js +50 -50
  76. package/dist/module/components/DocumentUploader.js.map +1 -1
  77. package/dist/module/components/DropDownItem.js +14 -13
  78. package/dist/module/components/DropDownItem.js.map +1 -1
  79. package/dist/module/components/DropDownMenu.js +5 -5
  80. package/dist/module/components/DropDownMenu.js.map +1 -1
  81. package/dist/module/components/EmptyStateMain.js +10 -9
  82. package/dist/module/components/EmptyStateMain.js.map +1 -1
  83. package/dist/module/components/EmptyStateWidget.js +7 -6
  84. package/dist/module/components/EmptyStateWidget.js.map +1 -1
  85. package/dist/module/components/FontScaleButton.js +5 -4
  86. package/dist/module/components/FontScaleButton.js.map +1 -1
  87. package/dist/module/components/FontScalePopup.js +11 -10
  88. package/dist/module/components/FontScalePopup.js.map +1 -1
  89. package/dist/module/components/Forbidden.js +13 -13
  90. package/dist/module/components/Forbidden.js.map +1 -1
  91. package/dist/module/components/FormCard.js +4 -4
  92. package/dist/module/components/FormCard.js.map +1 -1
  93. package/dist/module/components/FormCardSection.js +20 -18
  94. package/dist/module/components/FormCardSection.js.map +1 -1
  95. package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
  96. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
  97. package/dist/module/components/FormattedText.js +18 -16
  98. package/dist/module/components/FormattedText.js.map +1 -1
  99. package/dist/module/components/GenericInput.js +24 -21
  100. package/dist/module/components/GenericInput.js.map +1 -1
  101. package/dist/module/components/GenericInputSection.js +27 -26
  102. package/dist/module/components/GenericInputSection.js.map +1 -1
  103. package/dist/module/components/Header.js +70 -69
  104. package/dist/module/components/Header.js.map +1 -1
  105. package/dist/module/components/Icon.js +109 -0
  106. package/dist/module/components/Icon.js.map +1 -0
  107. package/dist/module/components/ImagePopup.js +211 -73
  108. package/dist/module/components/ImagePopup.js.map +1 -1
  109. package/dist/module/components/ImageUploadProgress.js +10 -9
  110. package/dist/module/components/ImageUploadProgress.js.map +1 -1
  111. package/dist/module/components/ImageUploader.js +116 -96
  112. package/dist/module/components/ImageUploader.js.map +1 -1
  113. package/dist/module/components/InlineButton.js +9 -8
  114. package/dist/module/components/InlineButton.js.map +1 -1
  115. package/dist/module/components/Input.js +28 -26
  116. package/dist/module/components/Input.js.map +1 -1
  117. package/dist/module/components/LoadingCircles.js +20 -20
  118. package/dist/module/components/LoadingCircles.js.map +1 -1
  119. package/dist/module/components/LoadingIndicator.js +11 -11
  120. package/dist/module/components/LoadingIndicator.js.map +1 -1
  121. package/dist/module/components/LoadingStateWidget.js +5 -5
  122. package/dist/module/components/LoadingStateWidget.js.map +1 -1
  123. package/dist/module/components/MediaPlayer.js +31 -31
  124. package/dist/module/components/MediaPlayer.js.map +1 -1
  125. package/dist/module/components/MiddlePopup.js +17 -11
  126. package/dist/module/components/MiddlePopup.js.map +1 -1
  127. package/dist/module/components/PDFPopup.js +52 -39
  128. package/dist/module/components/PDFPopup.js.map +1 -1
  129. package/dist/module/components/PlussChat.js +168 -149
  130. package/dist/module/components/PlussChat.js.map +1 -1
  131. package/dist/module/components/PlussChatMessage.js +42 -42
  132. package/dist/module/components/PlussChatMessage.js.map +1 -1
  133. package/dist/module/components/PlussChatTime.js +18 -17
  134. package/dist/module/components/PlussChatTime.js.map +1 -1
  135. package/dist/module/components/Popup.js +20 -19
  136. package/dist/module/components/Popup.js.map +1 -1
  137. package/dist/module/components/PopupMenu.js +15 -14
  138. package/dist/module/components/PopupMenu.js.map +1 -1
  139. package/dist/module/components/PositionedImage.js +20 -20
  140. package/dist/module/components/PositionedImage.js.map +1 -1
  141. package/dist/module/components/ProfilePic.js +10 -10
  142. package/dist/module/components/ProfilePic.js.map +1 -1
  143. package/dist/module/components/RadioButton.js +10 -9
  144. package/dist/module/components/RadioButton.js.map +1 -1
  145. package/dist/module/components/Reaction.js +18 -17
  146. package/dist/module/components/Reaction.js.map +1 -1
  147. package/dist/module/components/Reactions.js +7 -7
  148. package/dist/module/components/Reactions.js.map +1 -1
  149. package/dist/module/components/SharingTools.js +78 -43
  150. package/dist/module/components/SharingTools.js.map +1 -1
  151. package/dist/module/components/Spinner.js +5 -5
  152. package/dist/module/components/Spinner.js.map +1 -1
  153. package/dist/module/components/StickyFooter.js +6 -6
  154. package/dist/module/components/StickyFooter.js.map +1 -1
  155. package/dist/module/components/Text.js +57 -0
  156. package/dist/module/components/Text.js.map +1 -0
  157. package/dist/module/components/TickIcon.js +6 -6
  158. package/dist/module/components/TickIcon.js.map +1 -1
  159. package/dist/module/components/Toggle.js +10 -9
  160. package/dist/module/components/Toggle.js.map +1 -1
  161. package/dist/module/components/TouchableSearchBar.js +18 -17
  162. package/dist/module/components/TouchableSearchBar.js.map +1 -1
  163. package/dist/module/components/UserListPopup.js +20 -19
  164. package/dist/module/components/UserListPopup.js.map +1 -1
  165. package/dist/module/components/UserListing.js +41 -40
  166. package/dist/module/components/UserListing.js.map +1 -1
  167. package/dist/module/components/VideoPopup.js +20 -20
  168. package/dist/module/components/VideoPopup.js.map +1 -1
  169. package/dist/module/components/WarningPopup.js +21 -20
  170. package/dist/module/components/WarningPopup.js.map +1 -1
  171. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
  172. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
  173. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
  174. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
  175. package/dist/module/components/index.js +59 -58
  176. package/dist/module/components/index.js.map +1 -1
  177. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
  178. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
  179. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
  180. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
  181. package/dist/module/config.js +15 -10
  182. package/dist/module/config.js.map +1 -1
  183. package/dist/module/constants.js +3 -4
  184. package/dist/module/constants.js.map +1 -1
  185. package/dist/module/helper.js +83 -82
  186. package/dist/module/helper.js.map +1 -1
  187. package/dist/module/index.js +12 -12
  188. package/dist/module/index.js.map +1 -1
  189. package/dist/module/js/images/detectFaces.js +11 -10
  190. package/dist/module/js/images/detectFaces.js.map +1 -1
  191. package/dist/module/js/images/findLandmarkRange.js +8 -8
  192. package/dist/module/js/images/findLandmarkRange.js.map +1 -1
  193. package/dist/module/js/images/getScaledOffset.js.map +1 -1
  194. package/dist/module/js/site/getSiteLevelFromState.js +2 -2
  195. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
  196. package/dist/module/js/site/isTVEnabled.js +2 -2
  197. package/dist/module/js/site/isTVEnabled.js.map +1 -1
  198. package/dist/module/session.js +6 -6
  199. package/dist/module/session.js.map +1 -1
  200. package/dist/module/styles.js +17 -17
  201. package/dist/module/styles.js.map +1 -1
  202. package/dist/module/withNavigationFocus.js +30 -0
  203. package/dist/module/withNavigationFocus.js.map +1 -0
  204. package/package.json +71 -68
  205. package/src/actions/FollowerActions.js +36 -32
  206. package/src/actions/MediaActions.js +25 -20
  207. package/src/actions/ResidentActions.js +26 -21
  208. package/src/actions/UserActions.js +22 -22
  209. package/src/actions/UserSettingsActions.js +11 -11
  210. package/src/actions/index.js +5 -5
  211. package/src/actions/types.js +16 -16
  212. package/src/apis/analyticsActions.js +17 -17
  213. package/src/apis/contactActions.js +20 -20
  214. package/src/apis/eventActions.js +153 -144
  215. package/src/apis/fileActions.js +96 -86
  216. package/src/apis/followerActions.js +29 -29
  217. package/src/apis/index.js +12 -12
  218. package/src/apis/notificationActions.js +44 -44
  219. package/src/apis/profileActions.js +8 -8
  220. package/src/apis/reactionActions.js +81 -73
  221. package/src/apis/settingActions.js +15 -15
  222. package/src/apis/stringActions.js +29 -25
  223. package/src/apis/typeActions.js +10 -10
  224. package/src/apis/userActions.js +93 -93
  225. package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  226. package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  227. package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  228. package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  229. package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  230. package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  231. package/src/colours.js +116 -96
  232. package/src/components/AddButton.js +32 -27
  233. package/src/components/AddToCalendarButton.js +236 -202
  234. package/src/components/Attachment.js +59 -36
  235. package/src/components/AudienceSelectorLauncher.js +52 -48
  236. package/src/components/AudienceSelectorPage.js +353 -311
  237. package/src/components/AutoOffsetImage.js +237 -196
  238. package/src/components/BackButton.js +57 -41
  239. package/src/components/CalendarPopup.js +127 -97
  240. package/src/components/CategoryTabs.js +208 -163
  241. package/src/components/CommentReply.js +370 -309
  242. package/src/components/CommentSection.js +974 -781
  243. package/src/components/ConfirmPopup.js +141 -110
  244. package/src/components/ConfirmationPopup.js +80 -69
  245. package/src/components/DocumentUploader.js +245 -215
  246. package/src/components/DropDownItem.js +70 -60
  247. package/src/components/DropDownMenu.js +31 -27
  248. package/src/components/EmptyStateMain.js +51 -44
  249. package/src/components/EmptyStateWidget.js +47 -38
  250. package/src/components/FontScaleButton.js +29 -25
  251. package/src/components/FontScalePopup.js +67 -56
  252. package/src/components/Forbidden.js +48 -46
  253. package/src/components/FormCard.js +21 -17
  254. package/src/components/FormCardSection.js +284 -233
  255. package/src/components/FormCardSectionOptionLauncher.js +72 -46
  256. package/src/components/FormattedText.js +128 -111
  257. package/src/components/GenericInput.js +168 -136
  258. package/src/components/GenericInputSection.js +209 -161
  259. package/src/components/Header.js +620 -474
  260. package/src/components/Icon.js +119 -0
  261. package/src/components/ImagePopup.js +425 -221
  262. package/src/components/ImageUploadProgress.js +49 -41
  263. package/src/components/ImageUploader.js +968 -797
  264. package/src/components/InlineButton.js +79 -69
  265. package/src/components/Input.js +190 -156
  266. package/src/components/LoadingCircles.js +233 -233
  267. package/src/components/LoadingIndicator.js +87 -76
  268. package/src/components/LoadingStateWidget.js +47 -37
  269. package/src/components/MediaPlayer.js +416 -387
  270. package/src/components/MiddlePopup.js +62 -33
  271. package/src/components/PDFPopup.js +212 -159
  272. package/src/components/PlussChat.js +1224 -1025
  273. package/src/components/PlussChatMessage.js +329 -298
  274. package/src/components/PlussChatTime.js +57 -53
  275. package/src/components/Popup.js +138 -116
  276. package/src/components/PopupMenu.js +140 -110
  277. package/src/components/PositionedImage.js +281 -237
  278. package/src/components/ProfilePic.js +122 -113
  279. package/src/components/RadioButton.js +76 -52
  280. package/src/components/Reaction.js +134 -96
  281. package/src/components/Reactions.js +65 -63
  282. package/src/components/SharingTools.js +185 -134
  283. package/src/components/Spinner.js +13 -13
  284. package/src/components/StickyFooter.js +36 -26
  285. package/src/components/Text.js +62 -0
  286. package/src/components/TickIcon.js +20 -20
  287. package/src/components/Toggle.js +74 -73
  288. package/src/components/TouchableSearchBar.js +68 -50
  289. package/src/components/UserListPopup.js +161 -124
  290. package/src/components/UserListing.js +273 -238
  291. package/src/components/VideoPopup.js +110 -96
  292. package/src/components/WarningPopup.js +92 -71
  293. package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
  294. package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
  295. package/src/components/index.js +59 -58
  296. package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
  297. package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
  298. package/src/config.js +26 -21
  299. package/src/constants.js +8 -10
  300. package/src/helper.js +469 -438
  301. package/src/index.js +24 -12
  302. package/src/js/images/detectFaces.js +28 -21
  303. package/src/js/images/findLandmarkRange.js +97 -90
  304. package/src/js/images/getScaledOffset.js +80 -75
  305. package/src/js/site/getSiteLevelFromState.js +26 -26
  306. package/src/js/site/isTVEnabled.js +10 -10
  307. package/src/session.js +32 -32
  308. package/src/styles.js +61 -61
  309. package/src/withNavigationFocus.js +28 -0
  310. package/dist/module/components/TextStyle.js +0 -45
  311. package/dist/module/components/TextStyle.js.map +0 -1
  312. package/dist/module/fonts/index.js +0 -2
  313. package/dist/module/fonts/index.js.map +0 -1
  314. package/dist/module/fonts/pluss60-icons.js +0 -5
  315. package/dist/module/fonts/pluss60-icons.js.map +0 -1
  316. package/dist/module/fonts/pluss60-icons.json +0 -1097
  317. package/src/components/TextStyle.js +0 -48
  318. package/src/fonts/index.js +0 -1
  319. package/src/fonts/pluss60-icons.js +0 -7
  320. package/src/fonts/pluss60-icons.json +0 -1097
@@ -1,34 +1,58 @@
1
- import React, { Component } from 'react';
2
- import { View, Image, ImageBackground, TouchableOpacity, Text, KeyboardAvoidingView, Platform, ScrollView, Alert } from 'react-native';
3
- import { GiftedChat, Bubble, MessageText, Send, InputToolbar, Composer } from 'react-native-gifted-chat';
4
- import { connect } from 'react-redux';
5
- import _ from 'lodash';
6
- import moment from 'moment';
7
- import { Icon } from '@rneui/themed';
8
- import { getBottomSpace } from 'react-native-iphone-x-helper';
9
- import { Spinner } from './Spinner';
10
- import { ProfilePic } from './ProfilePic';
11
- import PlussChatTime from './PlussChatTime';
12
- import { PDFPopup } from './PDFPopup';
13
- import { Attachment } from './Attachment';
14
- import PlussChatMessage from './PlussChatMessage';
15
- import { TextStyle } from './TextStyle';
16
- import { ConfirmPopup } from './ConfirmPopup';
1
+ import React, { Component } from "react";
17
2
  import {
18
- TEXT_DARK,
19
- LINEGREY,
20
- TEXT_DARKEST,
21
- getMainBrandingColourFromState,
22
- getLightBrandingColourFromState,
23
- BG_GREY,
24
- TEXT_BLUEGREY,
25
- } from '../colours';
26
- import { getEnabledTabsFromState, get1400, getThumb300, imageExists, isVideo, getImageSource, getFileName } from '../helper';
27
- import Config, { Services } from '../config';
28
- import ImageUploader from './ImageUploader';
29
- import ImageUploadProgress from './ImageUploadProgress';
30
- import { ImagePopup } from './ImagePopup';
31
- import { VideoPopup } from './VideoPopup';
3
+ View,
4
+ Image,
5
+ ImageBackground,
6
+ TouchableOpacity,
7
+ KeyboardAvoidingView,
8
+ Platform,
9
+ ScrollView,
10
+ Alert,
11
+ TextInput,
12
+ } from "react-native";
13
+ import {
14
+ GiftedChat,
15
+ Bubble,
16
+ MessageText,
17
+ Send,
18
+ InputToolbar,
19
+ } from "react-native-gifted-chat";
20
+ import { connect } from "react-redux";
21
+ import _ from "lodash";
22
+ import moment from "moment";
23
+ import { Icon } from "@rneui/themed";
24
+ import { withSafeAreaInsets } from "react-native-safe-area-context";
25
+ import { Spinner } from "./Spinner";
26
+ import { ProfilePic } from "./ProfilePic";
27
+ import PlussChatTime from "./PlussChatTime";
28
+ import { PDFPopup } from "./PDFPopup";
29
+ import { Attachment } from "./Attachment";
30
+ import PlussChatMessage from "./PlussChatMessage";
31
+ import { Text } from ".";
32
+ import { ConfirmPopup } from "./ConfirmPopup";
33
+ import {
34
+ TEXT_DARK,
35
+ LINEGREY,
36
+ TEXT_DARKEST,
37
+ getMainBrandingColourFromState,
38
+ getLightBrandingColourFromState,
39
+ BG_GREY,
40
+ TEXT_BLUEGREY,
41
+ } from "../colours";
42
+ import {
43
+ getEnabledTabsFromState,
44
+ get1400,
45
+ getThumb300,
46
+ imageExists,
47
+ isVideo,
48
+ getImageSource,
49
+ getFileName,
50
+ } from "../helper";
51
+ import Config, { Services } from "../config";
52
+ import ImageUploader from "./ImageUploader";
53
+ import ImageUploadProgress from "./ImageUploadProgress";
54
+ import { ImagePopup } from "./ImagePopup";
55
+ import { VideoPopup } from "./VideoPopup";
32
56
 
33
57
  const IMAGE_SIZE_SMALL = 55;
34
58
  const IMAGE_SIZE_LARGE = 110;
@@ -38,1057 +62,1232 @@ const IMAGE_PREVIEW_AREA_HEIGHT = 105;
38
62
  const IMAGE_PREVIEW_SIZE = IMAGE_PREVIEW_AREA_HEIGHT - 25;
39
63
 
40
64
  class PlussChat extends Component {
41
- constructor(props) {
42
- super(props);
43
- const isSingleTab = this.props.tabCount === 1 && getBottomSpace() > 0;
44
- this.MIN_COMPOSER_HEIGHT = Platform.select({
45
- ios: isSingleTab ? 42 : 33,
46
- android: 41,
47
- });
65
+ constructor(props) {
66
+ super(props);
67
+ const bottomInset = this.props.insets?.bottom ?? 0;
68
+ const isSingleTab = this.props.tabCount === 1 && bottomInset > 0;
69
+ this.MIN_COMPOSER_HEIGHT = Platform.select({
70
+ ios: isSingleTab ? 42 : 33,
71
+ android: 41,
72
+ });
73
+
74
+ this.state = {
75
+ currentUser: {
76
+ _id: this.props.user.uid,
77
+ name: this.props.user.displayName,
78
+ avatar:
79
+ !_.isUndefined(this.props.user.profilePic) &&
80
+ !_.isEmpty(this.props.user.profilePic)
81
+ ? this.props.user.profilePic
82
+ : Config.env.tinyChatDefault,
83
+ },
84
+
85
+ messages: [],
86
+ imagePopupSource: [],
87
+ imagePopupIndex: 0,
88
+ imagePopupOpen: false,
89
+ imagesToUpload: [],
90
+ showFullscreenVideo: false,
91
+ currentVideoUrl: "",
92
+ showDeleteMessageConfirm: false,
93
+ messageToDelete: null,
94
+ composerHeight: this.MIN_COMPOSER_HEIGHT,
95
+ };
96
+ this.checkThumb = null;
97
+ }
48
98
 
49
- this.state = {
50
- currentUser: {
51
- _id: this.props.user.uid,
52
- name: this.props.user.displayName,
53
- avatar:
54
- !_.isUndefined(this.props.user.profilePic) && !_.isEmpty(this.props.user.profilePic)
55
- ? this.props.user.profilePic
56
- : Config.env.tinyChatDefault,
57
- },
99
+ UNSAFE_componentWillMount() {
100
+ this.updateMessages(this.props);
101
+ }
58
102
 
59
- messages: [],
60
- imagePopupSource: [],
61
- imagePopupIndex: 0,
62
- imagePopupOpen: false,
63
- imagesToUpload: [],
64
- showFullscreenVideo: false,
65
- currentVideoUrl: '',
66
- showDeleteMessageConfirm: false,
67
- messageToDelete: null,
68
- };
69
- this.checkThumb = null;
70
- }
103
+ UNSAFE_componentWillReceiveProps(nextProps) {
104
+ // Only update if messages actually changed
105
+ if (nextProps.messages !== this.props.messages) {
106
+ this.updateMessages(nextProps);
107
+ }
108
+ }
71
109
 
72
- UNSAFE_componentWillMount() {
73
- this.updateMessages(this.props);
74
- }
110
+ updateMessages(props) {
111
+ // Only update if messages actually changed
112
+ if (
113
+ !_.isUndefined(props.messages) &&
114
+ !_.isEqual(props.messages, this.state.messages)
115
+ ) {
116
+ this.setState({ messages: props.messages });
117
+ }
118
+ }
75
119
 
76
- UNSAFE_componentWillReceiveProps(nextProps) {
77
- this.updateMessages(nextProps);
78
- }
120
+ /***
121
+ *
122
+ * Messaging functionality
123
+ */
124
+ onSend(messages = []) {
125
+ // if (this.chatKey) {
126
+ // this.sendMessage(messages[0]);
127
+ // }
128
+ }
79
129
 
80
- updateMessages(props) {
81
- const newState = {};
82
- if (!_.isUndefined(props.messages)) {
83
- newState.messages = props.messages;
84
- }
85
- this.setState(newState);
86
- }
130
+ onPressEvent = (event) => {
131
+ Services.navigation.navigate("eventDetail", { event });
132
+ };
133
+ onPressAttachment = (attachment) => {
134
+ switch (attachment.Type) {
135
+ case "Event":
136
+ Services.navigation.navigate("eventDetail", { event: attachment });
137
+ break;
138
+ case "Place":
139
+ Services.navigation.navigate("placeDetail", { place: attachment });
140
+ break;
141
+ default:
142
+ return;
143
+ }
144
+ };
87
145
 
88
- /***
89
- *
90
- * Messaging functionality
91
- */
92
- onSend(messages = []) {
93
- // if (this.chatKey) {
94
- // this.sendMessage(messages[0]);
95
- // }
96
- }
146
+ hasImagesAttached = (imagesToUpload = null) => {
147
+ return !_.isEmpty(imagesToUpload || this.state.imagesToUpload);
148
+ };
97
149
 
98
- onPressEvent = event => {
99
- Services.navigation.navigate('eventDetail', { event });
100
- };
101
- onPressAttachment = attachment => {
102
- switch (attachment.Type) {
103
- case 'Event':
104
- Services.navigation.navigate('eventDetail', { event: attachment });
105
- break;
106
- case 'Place':
107
- Services.navigation.navigate('placeDetail', { place: attachment });
108
- break;
109
- default:
110
- return;
111
- }
112
- };
150
+ hasImagesReady = (imagesToUpload = null) => {
151
+ const upload = imagesToUpload || this.state.imagesToUpload;
152
+ return (
153
+ this.hasImagesAttached(upload) &&
154
+ upload.every((i) => !i.uploading && i.thumbNailExists)
155
+ );
156
+ };
113
157
 
114
- hasImagesAttached = (imagesToUpload = null) => {
115
- return !_.isEmpty(imagesToUpload || this.state.imagesToUpload);
116
- };
158
+ waitForThumbnails = () => {
159
+ if (this.checkThumb) return;
117
160
 
118
- hasImagesReady = (imagesToUpload = null) => {
119
- const upload = imagesToUpload || this.state.imagesToUpload;
120
- return this.hasImagesAttached(upload) && upload.every(i => !i.uploading && i.thumbNailExists);
121
- };
161
+ this.checkThumb = setInterval(async () => {
162
+ const imagesToUpload = [];
163
+ await Promise.all(
164
+ this.state.imagesToUpload.map((image) => {
165
+ return new Promise(async (resolve) => {
166
+ const newImage = { ...image };
167
+ imagesToUpload.push(newImage);
168
+ if (newImage.url && !newImage.thumbNailExists) {
169
+ newImage.uploading = false;
170
+ newImage.allowRetry = false;
171
+ newImage.thumbNailExists = await imageExists(
172
+ newImage.thumbNailUrl,
173
+ );
174
+ resolve(newImage.thumbNailExists);
175
+ }
176
+ resolve(true);
177
+ });
178
+ }),
179
+ );
180
+ const thumbnailsExist = imagesToUpload.every(
181
+ (image) => !image.url || image.thumbNailExists,
182
+ );
183
+ if (thumbnailsExist) {
184
+ clearInterval(this.checkThumb);
185
+ this.checkThumb = null;
186
+ this.setState({ imagesToUpload });
187
+ }
188
+ }, 2000);
189
+ };
122
190
 
123
- waitForThumbnails = () => {
124
- if (this.checkThumb) return;
191
+ onOpenAttachment = (a) => {
192
+ this.setState({
193
+ selectedPDF: a,
194
+ });
195
+ };
125
196
 
126
- this.checkThumb = setInterval(async () => {
127
- const imagesToUpload = [];
128
- await Promise.all(
129
- this.state.imagesToUpload.map(image => {
130
- return new Promise(async resolve => {
131
- const newImage = { ...image };
132
- imagesToUpload.push(newImage);
133
- if (newImage.url && !newImage.thumbNailExists) {
134
- newImage.uploading = false;
135
- newImage.allowRetry = false;
136
- newImage.thumbNailExists = await imageExists(newImage.thumbNailUrl);
137
- resolve(newImage.thumbNailExists);
138
- }
139
- resolve(true);
140
- });
141
- }),
142
- );
143
- const thumbnailsExist = imagesToUpload.every(image => !image.url || image.thumbNailExists);
144
- if (thumbnailsExist) {
145
- clearInterval(this.checkThumb);
146
- this.checkThumb = null;
147
- this.setState({ imagesToUpload });
148
- }
149
- }, 2000);
150
- };
197
+ onCloseAttachment = () => {
198
+ this.setState({
199
+ selectedPDF: null,
200
+ });
201
+ };
151
202
 
152
- onOpenAttachment = a => {
153
- this.setState({
154
- selectedPDF: a,
155
- });
156
- };
203
+ showUploadMenu() {
204
+ this.imageUploader.showUploadMenu();
205
+ }
157
206
 
158
- onCloseAttachment = () => {
159
- this.setState({
160
- selectedPDF: null,
161
- });
162
- };
207
+ onFocusInput = () => {
208
+ this.setState({
209
+ keyboardOpen: true,
210
+ });
211
+ if (this.props.keyboardOpen) {
212
+ this.props.keyboardOpen();
213
+ }
214
+ };
163
215
 
164
- showUploadMenu() {
165
- this.imageUploader.showUploadMenu();
166
- }
216
+ onBlurInput = () => {
217
+ this.setState({
218
+ keyboardOpen: false,
219
+ });
220
+ };
167
221
 
168
- onFocusInput = () => {
169
- this.setState({
170
- keyboardOpen: true,
171
- });
172
- if (this.props.keyboardOpen) {
173
- this.props.keyboardOpen();
174
- }
175
- };
222
+ onUploadStarted = (uploadUri, imageUri) => {
223
+ const imagesToUpload = [
224
+ ...this.state.imagesToUpload,
225
+ {
226
+ uploading: true,
227
+ uploadProgress: "0%",
228
+ uploadUri,
229
+ imageUri,
230
+ allowRetry: true,
231
+ },
232
+ ];
233
+ this.setState({ imagesToUpload });
234
+ };
176
235
 
177
- onBlurInput = () => {
178
- this.setState({
179
- keyboardOpen: false,
180
- });
181
- };
236
+ onUploadProgress = (progress) => {
237
+ const imagesToUpload = [...this.state.imagesToUpload];
238
+ imagesToUpload.map((img) => {
239
+ if (img.uploadUri === progress.uri) {
240
+ img.uploadProgress = progress.percentage;
241
+ img.uploading = true;
242
+ img.allowRetry = true;
243
+ }
244
+ });
245
+ this.setState({ imagesToUpload });
246
+ };
182
247
 
183
- onUploadStarted = (uploadUri, imageUri) => {
184
- const imagesToUpload = [
185
- ...this.state.imagesToUpload,
186
- {
187
- uploading: true,
188
- uploadProgress: '0%',
189
- uploadUri,
190
- imageUri,
191
- allowRetry: true,
192
- },
193
- ];
194
- this.setState({ imagesToUpload });
195
- };
248
+ onUploadSuccess = async (uri, uploadUri) => {
249
+ const imagesToUpload = [...this.state.imagesToUpload];
250
+ imagesToUpload.map((img) => {
251
+ if (img.uploadUri === uploadUri && img.uploading) {
252
+ img.url = uri.replace("/general/", "/general1400/");
253
+ img.thumbNailExists = false;
254
+ img.thumbNailUrl = getThumb300(img.url);
255
+ img.allowRetry = true;
256
+ }
257
+ });
258
+ this.setState({ imagesToUpload }, () => this.waitForThumbnails());
259
+ };
196
260
 
197
- onUploadProgress = progress => {
198
- const imagesToUpload = [...this.state.imagesToUpload];
199
- imagesToUpload.map(img => {
200
- if (img.uploadUri === progress.uri) {
201
- img.uploadProgress = progress.percentage;
202
- img.uploading = true;
203
- img.allowRetry = true;
204
- }
205
- });
206
- this.setState({ imagesToUpload });
207
- };
261
+ onUploadFailed = (uploadUri) => {
262
+ const imagesToUpload = [...this.state.imagesToUpload];
263
+ imagesToUpload.map((img) => {
264
+ if (img.uploadUri === uploadUri) {
265
+ img.uploading = true; // Requried for retry
266
+ img.uploadProgress = "";
267
+ img.allowRetry = true;
268
+ }
269
+ });
270
+ this.setState({ imagesToUpload });
271
+ };
208
272
 
209
- onUploadSuccess = async (uri, uploadUri) => {
210
- const imagesToUpload = [...this.state.imagesToUpload];
211
- imagesToUpload.map(img => {
212
- if (img.uploadUri === uploadUri && img.uploading) {
213
- img.url = uri.replace('/general/', '/general1400/');
214
- img.thumbNailExists = false;
215
- img.thumbNailUrl = getThumb300(img.url);
216
- img.allowRetry = true;
217
- }
218
- });
219
- this.setState({ imagesToUpload }, () => this.waitForThumbnails());
220
- };
273
+ onLibrarySelected = (uri) => {
274
+ const imagesToUpload = [
275
+ ...this.state.imagesToUpload,
276
+ {
277
+ uploading: false,
278
+ allowRetry: false,
279
+ url: get1400(uri),
280
+ thumbNailExists: true,
281
+ thumbNailUrl: getThumb300(uri),
282
+ },
283
+ ];
284
+ this.setState({ imagesToUpload });
285
+ };
221
286
 
222
- onUploadFailed = uploadUri => {
223
- const imagesToUpload = [...this.state.imagesToUpload];
224
- imagesToUpload.map(img => {
225
- if (img.uploadUri === uploadUri) {
226
- img.uploading = true; // Requried for retry
227
- img.uploadProgress = '';
228
- img.allowRetry = true;
229
- }
230
- });
231
- this.setState({ imagesToUpload });
232
- };
287
+ onPressImage = (images, selected) => {
288
+ this.setState({
289
+ imagePopupSource: images,
290
+ imagePopupIndex: images.indexOf(selected),
291
+ imagePopupOpen: true,
292
+ });
293
+ };
233
294
 
234
- onLibrarySelected = uri => {
235
- const imagesToUpload = [
236
- ...this.state.imagesToUpload,
237
- {
238
- uploading: false,
239
- allowRetry: false,
240
- url: get1400(uri),
241
- thumbNailExists: true,
242
- thumbNailUrl: getThumb300(uri),
243
- },
244
- ];
245
- this.setState({ imagesToUpload });
246
- };
295
+ onReply = (message) => {
296
+ this.setState({
297
+ replyingTo: message,
298
+ });
299
+ };
247
300
 
248
- onPressImage = (images, selected) => {
249
- this.setState({
250
- imagePopupSource: images,
251
- imagePopupIndex: images.indexOf(selected),
252
- imagePopupOpen: true,
253
- });
254
- };
301
+ onDelete = (message) => {
302
+ // Only proceed if delete handler is provided
303
+ if (!this.props.onDeleteMessage) {
304
+ return;
305
+ }
255
306
 
256
- onReply = message => {
257
- this.setState({
258
- replyingTo: message,
259
- });
260
- };
307
+ // Only allow deletion of own messages
308
+ if (message.user._id !== this.props.user.uid) {
309
+ return;
310
+ }
261
311
 
262
- onDelete = message => {
263
- // Only proceed if delete handler is provided
264
- if (!this.props.onDeleteMessage) {
265
- return;
266
- }
312
+ this.setState({
313
+ showDeleteMessageConfirm: true,
314
+ messageToDelete: message,
315
+ });
316
+ };
267
317
 
268
- // Only allow deletion of own messages
269
- if (message.user._id !== this.props.user.uid) {
270
- return;
271
- }
318
+ onCancelDeleteMessage = () => {
319
+ this.setState({
320
+ showDeleteMessageConfirm: false,
321
+ messageToDelete: null,
322
+ });
323
+ };
272
324
 
273
- this.setState({
274
- showDeleteMessageConfirm: true,
275
- messageToDelete: message,
276
- });
277
- };
325
+ onConfirmDeleteMessage = async () => {
326
+ const { messageToDelete } = this.state;
327
+ if (!messageToDelete) return;
278
328
 
279
- onCancelDeleteMessage = () => {
280
- this.setState({
281
- showDeleteMessageConfirm: false,
282
- messageToDelete: null,
283
- });
284
- };
329
+ this.setState({
330
+ showDeleteMessageConfirm: false,
331
+ });
285
332
 
286
- onConfirmDeleteMessage = async () => {
287
- const { messageToDelete } = this.state;
288
- if (!messageToDelete) return;
333
+ try {
334
+ // Call the parent's delete handler if provided
335
+ if (this.props.onDeleteMessage) {
336
+ await this.props.onDeleteMessage(messageToDelete);
337
+ }
289
338
 
290
- this.setState({
291
- showDeleteMessageConfirm: false,
292
- });
339
+ this.setState({
340
+ messageToDelete: null,
341
+ });
342
+ } catch (error) {
343
+ // Handle error gracefully if parent handler fails
344
+ console.log("onConfirmDeleteMessage error", error);
345
+ // Error is already handled by parent component
346
+ this.setState({ messageToDelete: null });
347
+ }
348
+ };
293
349
 
294
- try {
295
- // Call the parent's delete handler if provided
296
- if (this.props.onDeleteMessage) {
297
- await this.props.onDeleteMessage(messageToDelete);
298
- }
350
+ closeGallery() {
351
+ this.setState({
352
+ imagePopupSource: [],
353
+ imagePopupIndex: 0,
354
+ imagePopupOpen: false,
355
+ });
356
+ }
299
357
 
300
- this.setState({
301
- messageToDelete: null,
302
- });
303
- } catch (error) {
304
- // Handle error gracefully if parent handler fails
305
- console.log('onConfirmDeleteMessage error', error);
306
- // Error is already handled by parent component
307
- this.setState({ messageToDelete: null });
308
- }
309
- };
358
+ onRemoveImage = (url) => {
359
+ const imagesToUpload = this.state.imagesToUpload.filter(
360
+ (image) => image.url !== url,
361
+ );
362
+ this.setState({ imagesToUpload });
363
+ };
310
364
 
311
- closeGallery() {
312
- this.setState({
313
- imagePopupSource: [],
314
- imagePopupIndex: 0,
315
- imagePopupOpen: false,
316
- });
317
- }
365
+ toggleFullscreenVideo = (url) => {
366
+ if (typeof url !== "string") url = "";
367
+ this.setState({
368
+ showFullscreenVideo: url.length > 0,
369
+ currentVideoUrl: url,
370
+ });
371
+ };
318
372
 
319
- onRemoveImage = url => {
320
- const imagesToUpload = this.state.imagesToUpload.filter(image => image.url !== url);
321
- this.setState({ imagesToUpload });
322
- };
373
+ sendMessages(messages) {
374
+ if (this.hasImagesAttached()) {
375
+ // Don't allow send if attached images aren't ready
376
+ if (!this.hasImagesReady()) return;
377
+ messages[0].image = this.state.imagesToUpload.map((image) => image.url);
378
+ }
379
+ if (_.isEmpty(messages[0].text)) {
380
+ messages[0].text = "";
381
+ }
382
+ if (!messages[0].text && !messages[0].image) return;
323
383
 
324
- toggleFullscreenVideo = url => {
325
- if (typeof url !== 'string') url = '';
326
- this.setState({ showFullscreenVideo: url.length > 0, currentVideoUrl: url });
327
- };
384
+ if (this.state.replyingTo) {
385
+ messages[0].replyingTo = this.state.replyingTo;
386
+ }
328
387
 
329
- sendMessages(messages) {
330
- if (this.hasImagesAttached()) {
331
- // Don't allow send if attached images aren't ready
332
- if (!this.hasImagesReady()) return;
333
- messages[0].image = this.state.imagesToUpload.map(image => image.url);
334
- }
335
- if (_.isEmpty(messages[0].text)) {
336
- messages[0].text = '';
337
- }
338
- if (!messages[0].text && !messages[0].image) return;
388
+ this.props.onSend(messages);
389
+ this.setState({ imagesToUpload: [], replyingTo: null });
390
+ }
339
391
 
340
- if (this.state.replyingTo) {
341
- messages[0].replyingTo = this.state.replyingTo;
342
- }
392
+ /**
393
+ *
394
+ * Render Functions
395
+ */
396
+ renderBubble(bubbleProps) {
397
+ const wrapperStyle = {};
398
+ if (
399
+ !_.isEmpty(bubbleProps.currentMessage.text) &&
400
+ !_.isEmpty(bubbleProps.currentMessage.image)
401
+ ) {
402
+ wrapperStyle.paddingTop = 8;
403
+ wrapperStyle.paddingBottom = 16;
404
+ wrapperStyle.minWidth = 142; // 110 image width + 16 padding either side
405
+ }
406
+ if (!_.isEmpty(bubbleProps.currentMessage.attachments)) {
407
+ wrapperStyle.paddingTop = 8;
408
+ wrapperStyle.paddingBottom = 16;
409
+ wrapperStyle.paddingHorizontal = 16;
410
+ }
411
+ return (
412
+ <Bubble
413
+ {...bubbleProps}
414
+ renderMessageImage={() => null}
415
+ isCustomViewBottom={true}
416
+ wrapperStyle={{
417
+ left: {
418
+ backgroundColor: LINEGREY,
419
+ borderRadius: 25,
420
+ ...wrapperStyle,
421
+ },
422
+ right: {
423
+ backgroundColor: this.props.colourBrandingLight,
424
+ borderRadius: 25,
425
+ ...wrapperStyle,
426
+ },
427
+ }}
428
+ containerToNextStyle={{
429
+ left: {
430
+ borderBottomLeftRadius: 5,
431
+ },
432
+ right: {
433
+ borderBottomRightRadius: 5,
434
+ },
435
+ }}
436
+ containerToPreviousStyle={{
437
+ left: {
438
+ borderTopLeftRadius: 5,
439
+ },
440
+ right: {
441
+ borderTopRightRadius: 5,
442
+ },
443
+ }}
444
+ />
445
+ );
446
+ }
447
+ renderMessage(props) {
448
+ return (
449
+ <PlussChatMessage
450
+ key={props.RowId}
451
+ colourBrandingMain={this.props.colourBrandingMain}
452
+ onPressReply={() => {
453
+ this.onReply(props.currentMessage);
454
+ }}
455
+ onPressDelete={
456
+ this.props.onDeleteMessage
457
+ ? () => {
458
+ this.onDelete(props.currentMessage);
459
+ }
460
+ : null
461
+ }
462
+ {...props}
463
+ />
464
+ );
465
+ }
466
+ renderMessageText(messageTextProps) {
467
+ // If message is deleted, show placeholder text
468
+ const props = messageTextProps.currentMessage.deleted
469
+ ? {
470
+ ...messageTextProps,
471
+ currentMessage: {
472
+ ...messageTextProps.currentMessage,
473
+ text: "[Message deleted]",
474
+ },
475
+ }
476
+ : messageTextProps;
343
477
 
344
- this.props.onSend(messages);
345
- this.setState({ imagesToUpload: [], replyingTo: null });
346
- }
478
+ return (
479
+ <MessageText
480
+ {...props}
481
+ textStyle={{
482
+ left: {
483
+ fontFamily: "sf-regular",
484
+ fontSize: 16,
485
+ color: TEXT_DARKEST,
486
+ marginTop: 10,
487
+ marginBottom: 10,
488
+ marginLeft: 15,
489
+ marginRight: 15,
490
+ },
491
+ right: {
492
+ fontFamily: "sf-regular",
493
+ fontSize: 16,
494
+ color: this.props.colourBrandingMain,
495
+ marginTop: 10,
496
+ marginBottom: 10,
497
+ marginLeft: 15,
498
+ marginRight: 15,
499
+ },
500
+ }}
501
+ linkStyle={{
502
+ left: {
503
+ color: TEXT_DARKEST,
504
+ },
505
+ right: {
506
+ color: this.props.colourBrandingMain,
507
+ },
508
+ }}
509
+ textProps={{
510
+ selectable: true,
511
+ }}
512
+ />
513
+ );
514
+ }
515
+ renderTime() {
516
+ return null;
517
+ }
518
+ renderDay(dayProps) {
519
+ return (
520
+ <PlussChatTime
521
+ {...dayProps}
522
+ textStyle={{
523
+ fontFamily: "sf-semibold",
524
+ color: TEXT_DARK,
525
+ fontSize: 12,
526
+ }}
527
+ />
528
+ );
529
+ }
530
+ renderCustomView({ currentMessage, position }) {
531
+ // Don't show images or attachments for deleted messages
532
+ if (currentMessage.deleted) {
533
+ return null;
534
+ }
347
535
 
348
- /**
349
- *
350
- * Render Functions
351
- */
352
- renderBubble(bubbleProps) {
353
- const wrapperStyle = {};
354
- if (!_.isEmpty(bubbleProps.currentMessage.text) && !_.isEmpty(bubbleProps.currentMessage.image)) {
355
- wrapperStyle.paddingTop = 8;
356
- wrapperStyle.paddingBottom = 16;
357
- wrapperStyle.minWidth = 142; // 110 image width + 16 padding either side
358
- }
359
- if (!_.isEmpty(bubbleProps.currentMessage.attachments)) {
360
- wrapperStyle.paddingTop = 8;
361
- wrapperStyle.paddingBottom = 16;
362
- wrapperStyle.paddingHorizontal = 16;
363
- }
364
- return (
365
- <Bubble
366
- {...bubbleProps}
367
- renderMessageImage={() => null}
368
- isCustomViewBottom={true}
369
- wrapperStyle={{
370
- left: {
371
- backgroundColor: LINEGREY,
372
- borderRadius: 25,
373
- ...wrapperStyle,
374
- },
375
- right: {
376
- backgroundColor: this.props.colourBrandingLight,
377
- borderRadius: 25,
378
- ...wrapperStyle,
379
- },
380
- }}
381
- containerToNextStyle={{
382
- left: {
383
- borderBottomLeftRadius: 5,
384
- },
385
- right: {
386
- borderBottomRightRadius: 5,
387
- },
388
- }}
389
- containerToPreviousStyle={{
390
- left: {
391
- borderTopLeftRadius: 5,
392
- },
393
- right: {
394
- borderTopRightRadius: 5,
395
- },
396
- }}
397
- />
398
- );
399
- }
400
- renderMessage(props) {
401
- return (
402
- <PlussChatMessage
403
- key={props.RowId}
404
- colourBrandingMain={this.props.colourBrandingMain}
405
- onPressReply={() => {
406
- this.onReply(props.currentMessage);
407
- }}
408
- onPressDelete={
409
- this.props.onDeleteMessage
410
- ? () => {
411
- this.onDelete(props.currentMessage);
412
- }
413
- : null
414
- }
415
- {...props}
416
- />
417
- );
418
- }
419
- renderMessageText(messageTextProps) {
420
- // If message is deleted, show placeholder text
421
- const props = messageTextProps.currentMessage.deleted
422
- ? {
423
- ...messageTextProps,
424
- currentMessage: {
425
- ...messageTextProps.currentMessage,
426
- text: '[Message deleted]',
427
- },
428
- }
429
- : messageTextProps;
536
+ if (currentMessage.image) {
537
+ const images =
538
+ typeof currentMessage.image === "string"
539
+ ? [currentMessage.image]
540
+ : currentMessage.image;
541
+ const containerWidth = (() => {
542
+ if (images.length === 0) return 0;
543
+ if (images.length === 1) return IMAGE_SIZE_LARGE;
544
+ if (images.length <= IMAGES_PER_ROW)
545
+ return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * images.length;
546
+ return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * IMAGES_PER_ROW;
547
+ })();
548
+ return (
549
+ <View
550
+ style={[
551
+ styles.imagesContainer,
552
+ {
553
+ width: containerWidth,
554
+ paddingVertical: currentMessage.text ? 0 : 20,
555
+ },
556
+ ]}
557
+ >
558
+ {images.map((img) => {
559
+ const thumb = getThumb300(img);
560
+ if (isVideo(img)) {
561
+ return (
562
+ <TouchableOpacity
563
+ key={thumb}
564
+ onPress={this.toggleFullscreenVideo.bind(this, img)}
565
+ >
566
+ <ImageBackground
567
+ style={
568
+ images.length > 1
569
+ ? styles.messageImageSmall
570
+ : styles.messageImageLarge
571
+ }
572
+ source={{ uri: thumb }}
573
+ >
574
+ <View style={styles.imagePlayContainer}>
575
+ <Icon
576
+ name="play"
577
+ type="font-awesome"
578
+ iconStyle={styles.imageControlIcon}
579
+ />
580
+ </View>
581
+ </ImageBackground>
582
+ </TouchableOpacity>
583
+ );
584
+ }
585
+ return (
586
+ <TouchableOpacity
587
+ key={thumb}
588
+ onPress={() => this.onPressImage(images, img)}
589
+ >
590
+ <Image
591
+ source={{ uri: thumb }}
592
+ style={
593
+ images.length > 1
594
+ ? styles.messageImageSmall
595
+ : styles.messageImageLarge
596
+ }
597
+ />
598
+ </TouchableOpacity>
599
+ );
600
+ })}
601
+ </View>
602
+ );
603
+ }
604
+ if (!_.isEmpty(currentMessage.attachments)) {
605
+ return (
606
+ <View>
607
+ {currentMessage.attachments.map((url, i) => {
608
+ return (
609
+ <Attachment
610
+ onPress={() => {
611
+ this.onOpenAttachment(url);
612
+ }}
613
+ key={i}
614
+ title={getFileName(url)}
615
+ />
616
+ );
617
+ })}
618
+ </View>
619
+ );
620
+ }
621
+ if (currentMessage.event) {
622
+ return (
623
+ <TouchableOpacity
624
+ onPress={this.onPressEvent.bind(this, currentMessage.event)}
625
+ >
626
+ <View style={styles.eventContainer[position]}>
627
+ <Image
628
+ style={[styles.eventImage, styles.eventImageMargin[position]]}
629
+ source={{ uri: currentMessage.event.Thumbnail }}
630
+ />
631
+ <View style={styles.eventInfo}>
632
+ <Text
633
+ numberOfLines={3}
634
+ style={[
635
+ styles.eventTitle,
636
+ styles.eventInfoAlign[position],
637
+ { color: this.props.colourBrandingMain },
638
+ ]}
639
+ >
640
+ {currentMessage.event.Title}
641
+ </Text>
642
+ <Text
643
+ style={[
644
+ styles.eventDate,
645
+ styles.eventInfoAlign[position],
646
+ { color: this.props.colourBrandingMain },
647
+ ]}
648
+ >
649
+ {moment
650
+ .utc(currentMessage.event.StartTime)
651
+ .local()
652
+ .format("ddd D MMM")}
653
+ </Text>
654
+ </View>
655
+ </View>
656
+ </TouchableOpacity>
657
+ );
658
+ }
659
+ if (currentMessage.attachment) {
660
+ return (
661
+ <TouchableOpacity
662
+ onPress={this.onPressAttachment.bind(this, currentMessage.attachment)}
663
+ >
664
+ <View style={styles.eventContainer[position]}>
665
+ <Image
666
+ style={[styles.eventImage, styles.eventImageMargin[position]]}
667
+ source={{ uri: currentMessage.attachment.Thumbnail }}
668
+ />
669
+ <View style={styles.eventInfo}>
670
+ <Text
671
+ numberOfLines={3}
672
+ style={[
673
+ styles.eventTitle,
674
+ styles.eventInfoAlign[position],
675
+ { color: this.props.colourBrandingMain },
676
+ ]}
677
+ >
678
+ {currentMessage.attachment.Title}
679
+ </Text>
680
+ {currentMessage.attachment.StartTime && (
681
+ <Text
682
+ style={[
683
+ styles.eventDate,
684
+ styles.eventInfoAlign[position],
685
+ { color: this.props.colourBrandingMain },
686
+ ]}
687
+ >
688
+ {moment
689
+ .utc(currentMessage.attachment.StartTime)
690
+ .local()
691
+ .format("ddd D MMM")}
692
+ </Text>
693
+ )}
694
+ </View>
695
+ </View>
696
+ </TouchableOpacity>
697
+ );
698
+ }
699
+ return null;
700
+ }
430
701
 
431
- return (
432
- <MessageText
433
- {...props}
434
- textStyle={{
435
- left: {
436
- fontFamily: 'sf-regular',
437
- fontSize: 16,
438
- color: TEXT_DARKEST,
439
- marginTop: 10,
440
- marginBottom: 10,
441
- marginLeft: 15,
442
- marginRight: 15,
443
- },
444
- right: {
445
- fontFamily: 'sf-regular',
446
- fontSize: 16,
447
- color: this.props.colourBrandingMain,
448
- marginTop: 10,
449
- marginBottom: 10,
450
- marginLeft: 15,
451
- marginRight: 15,
452
- },
453
- }}
454
- linkStyle={{
455
- left: {
456
- color: TEXT_DARKEST,
457
- },
458
- right: {
459
- color: this.props.colourBrandingMain,
460
- },
461
- }}
462
- />
463
- );
464
- }
465
- renderTime() {
466
- return null;
467
- }
468
- renderDay(dayProps) {
469
- return (
470
- <PlussChatTime
471
- {...dayProps}
472
- textStyle={{
473
- fontFamily: 'sf-semibold',
474
- color: TEXT_DARK,
475
- fontSize: 12,
476
- }}
477
- />
478
- );
479
- }
480
- renderCustomView({ currentMessage, position }) {
481
- // Don't show images or attachments for deleted messages
482
- if (currentMessage.deleted) {
483
- return null;
484
- }
702
+ renderSend(props) {
703
+ const buttonTopOffset = this.state.replyingTo ? 46 : 4;
704
+ const showSendButton =
705
+ !_.isEmpty(props.text) || this.hasImagesReady(props.imagesToUpload);
706
+ return (
707
+ <View
708
+ style={{
709
+ position: "absolute",
710
+ top: buttonTopOffset,
711
+ right: 8,
712
+ flexDirection: "row",
713
+ alignItems: "center",
714
+ }}
715
+ >
716
+ {/* Image upload button - always visible */}
717
+ <TouchableOpacity
718
+ onPress={this.showUploadMenu.bind(this)}
719
+ style={[
720
+ styles.sendContainer,
721
+ {
722
+ right:
723
+ _.isEmpty(props.text) &&
724
+ !this.hasImagesReady(props.imagesToUpload)
725
+ ? 0
726
+ : this.MIN_COMPOSER_HEIGHT,
485
727
 
486
- if (currentMessage.image) {
487
- const images = typeof currentMessage.image === 'string' ? [currentMessage.image] : currentMessage.image;
488
- const containerWidth = (() => {
489
- if (images.length === 0) return 0;
490
- if (images.length === 1) return IMAGE_SIZE_LARGE;
491
- if (images.length <= IMAGES_PER_ROW) return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * images.length;
492
- return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * IMAGES_PER_ROW;
493
- })();
494
- return (
495
- <View style={[styles.imagesContainer, { width: containerWidth, paddingVertical: currentMessage.text ? 0 : 20 }]}>
496
- {images.map(img => {
497
- const thumb = getThumb300(img);
498
- if (isVideo(img)) {
499
- return (
500
- <TouchableOpacity key={thumb} onPress={this.toggleFullscreenVideo.bind(this, img)}>
501
- <ImageBackground style={images.length > 1 ? styles.messageImageSmall : styles.messageImageLarge} source={{ uri: thumb }}>
502
- <View style={styles.imagePlayContainer}>
503
- <Icon name="play" type="font-awesome" iconStyle={styles.imageControlIcon} />
504
- </View>
505
- </ImageBackground>
506
- </TouchableOpacity>
507
- );
508
- }
509
- return (
510
- <TouchableOpacity key={thumb} onPress={() => this.onPressImage(images, img)}>
511
- <Image source={{ uri: thumb }} style={images.length > 1 ? styles.messageImageSmall : styles.messageImageLarge} />
512
- </TouchableOpacity>
513
- );
514
- })}
515
- </View>
516
- );
517
- }
518
- if (!_.isEmpty(currentMessage.attachments)) {
519
- return (
520
- <View>
521
- {currentMessage.attachments.map((url, i) => {
522
- return (
523
- <Attachment
524
- onPress={() => {
525
- this.onOpenAttachment(url);
526
- }}
527
- key={i}
528
- title={getFileName(url)}
529
- />
530
- );
531
- })}
532
- </View>
533
- );
534
- }
535
- if (currentMessage.event) {
536
- return (
537
- <TouchableOpacity onPress={this.onPressEvent.bind(this, currentMessage.event)}>
538
- <View style={styles.eventContainer[position]}>
539
- <Image style={[styles.eventImage, styles.eventImageMargin[position]]} source={{ uri: currentMessage.event.Thumbnail }} />
540
- <View style={styles.eventInfo}>
541
- <Text
542
- numberOfLines={3}
543
- style={[styles.eventTitle, styles.eventInfoAlign[position], { color: this.props.colourBrandingMain }]}
544
- >
545
- {currentMessage.event.Title}
546
- </Text>
547
- <Text style={[styles.eventDate, styles.eventInfoAlign[position], { color: this.props.colourBrandingMain }]}>
548
- {moment
549
- .utc(currentMessage.event.StartTime)
550
- .local()
551
- .format('ddd D MMM')}
552
- </Text>
553
- </View>
554
- </View>
555
- </TouchableOpacity>
556
- );
557
- }
558
- if (currentMessage.attachment) {
559
- return (
560
- <TouchableOpacity onPress={this.onPressAttachment.bind(this, currentMessage.attachment)}>
561
- <View style={styles.eventContainer[position]}>
562
- <Image style={[styles.eventImage, styles.eventImageMargin[position]]} source={{ uri: currentMessage.attachment.Thumbnail }} />
563
- <View style={styles.eventInfo}>
564
- <Text
565
- numberOfLines={3}
566
- style={[styles.eventTitle, styles.eventInfoAlign[position], { color: this.props.colourBrandingMain }]}
567
- >
568
- {currentMessage.attachment.Title}
569
- </Text>
570
- {currentMessage.attachment.StartTime && (
571
- <Text style={[styles.eventDate, styles.eventInfoAlign[position], { color: this.props.colourBrandingMain }]}>
572
- {moment
573
- .utc(currentMessage.attachment.StartTime)
574
- .local()
575
- .format('ddd D MMM')}
576
- </Text>
577
- )}
578
- </View>
579
- </View>
580
- </TouchableOpacity>
581
- );
582
- }
583
- return null;
584
- }
728
+ width: this.MIN_COMPOSER_HEIGHT,
729
+ height: this.MIN_COMPOSER_HEIGHT,
730
+ },
731
+ ]}
732
+ >
733
+ <Icon
734
+ name={"picture-o"}
735
+ type="font-awesome"
736
+ iconStyle={[styles.send, { width: this.MIN_COMPOSER_HEIGHT }]}
737
+ />
738
+ </TouchableOpacity>
585
739
 
586
- renderSend(props) {
587
- return (
588
- <View style={[{ position: 'absolute', top: 0, right: 0 }, !!this.state.replyingTo && { marginTop: 38 }]}>
589
- {(!_.isEmpty(props.text) || this.hasImagesReady(props.imagesToUpload)) && (
590
- <Send
591
- {...props}
592
- alwaysShowSend={true}
593
- containerStyle={[
594
- styles.sendContainer,
595
- {
596
- width: this.MIN_COMPOSER_HEIGHT,
597
- height: this.MIN_COMPOSER_HEIGHT,
598
- },
599
- ]}
600
- >
601
- <Icon name={'paper-plane'} type="font-awesome" iconStyle={[styles.send, { width: this.MIN_COMPOSER_HEIGHT }]} />
602
- </Send>
603
- )}
604
- <TouchableOpacity
605
- onPress={this.showUploadMenu.bind(this)}
606
- style={[
607
- styles.sendContainer,
608
- {
609
- right: _.isEmpty(props.text) && !this.hasImagesReady(props.imagesToUpload) ? 0 : 8 + this.MIN_COMPOSER_HEIGHT,
610
- width: this.MIN_COMPOSER_HEIGHT,
611
- height: this.MIN_COMPOSER_HEIGHT,
612
- },
613
- ]}
614
- >
615
- <Icon name={'picture-o'} type="font-awesome" iconStyle={[styles.send, { width: this.MIN_COMPOSER_HEIGHT }]} />
616
- </TouchableOpacity>
617
- </View>
618
- );
619
- }
740
+ {/* Send button - only visible when there's text or images */}
741
+ {showSendButton && (
742
+ <Send
743
+ {...props}
744
+ alwaysShowSend={true}
745
+ onSend={props.onSend}
746
+ text={props.text || " "}
747
+ containerStyle={[
748
+ styles.sendContainer,
749
+ {
750
+ width: this.MIN_COMPOSER_HEIGHT,
751
+ height: this.MIN_COMPOSER_HEIGHT,
752
+ },
753
+ ]}
754
+ >
755
+ <Icon
756
+ name={"paper-plane"}
757
+ type="font-awesome"
758
+ iconStyle={[styles.send, { width: this.MIN_COMPOSER_HEIGHT }]}
759
+ />
760
+ </Send>
761
+ )}
762
+ </View>
763
+ );
764
+ }
620
765
 
621
- renderAccessory(props) {
622
- const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
623
- if (!hasAttachment) {
624
- return null;
625
- }
626
- return (
627
- <ScrollView horizontal style={styles.uploadImagesContainer}>
628
- {props.imagesToUpload.map(image => {
629
- if (image.uploading) {
630
- return (
631
- <ImageUploadProgress
632
- key={image.uploadUri}
633
- uploader={this.imageUploader}
634
- image={image}
635
- color={this.props.colourBrandingMain}
636
- style={{ width: IMAGE_PREVIEW_SIZE, marginRight: 10 }}
637
- progressTextStyle={{ fontSize: 10 }}
638
- />
639
- );
640
- }
641
- const isVideoUrl = isVideo(image.url);
642
- return (
643
- <View key={image.url} style={styles.accessoryImageContainer}>
644
- <ImageBackground
645
- style={styles.accessoryImage}
646
- imageStyle={styles.accessoryImageBorder}
647
- source={getImageSource(image.thumbNailExists ? image.thumbNailUrl : image.url)}
648
- >
649
- {isVideoUrl && (
650
- <View style={styles.imagePlayContainer}>
651
- <TouchableOpacity onPress={this.toggleFullscreenVideo.bind(this, image.url)}>
652
- <Icon name="play" type="font-awesome" iconStyle={styles.imageControlIcon} />
653
- </TouchableOpacity>
654
- </View>
655
- )}
656
- </ImageBackground>
657
- <TouchableOpacity
658
- style={styles.previewItemRemoveButton}
659
- onPress={() => this.onRemoveImage(image.url)}
660
- hitSlop={{ top: 8, right: 8, bottom: 8, left: 8 }}
661
- >
662
- <View style={[styles.previewItemRemoveContainer, { backgroundColor: this.props.colourBrandingMain }]}>
663
- <Icon name="times" type="font-awesome" iconStyle={styles.previewItemRemoveIcon} />
664
- </View>
665
- </TouchableOpacity>
666
- </View>
667
- );
668
- })}
669
- </ScrollView>
670
- );
671
- }
766
+ renderAccessory(props) {
767
+ const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
768
+ if (!hasAttachment) {
769
+ return null;
770
+ }
771
+ return (
772
+ <ScrollView horizontal style={styles.uploadImagesContainer}>
773
+ {props.imagesToUpload.map((image) => {
774
+ if (image.uploading) {
775
+ return (
776
+ <ImageUploadProgress
777
+ key={image.uploadUri}
778
+ uploader={this.imageUploader}
779
+ image={image}
780
+ color={this.props.colourBrandingMain}
781
+ style={{ width: IMAGE_PREVIEW_SIZE, marginRight: 10 }}
782
+ progressTextStyle={{ fontSize: 10 }}
783
+ />
784
+ );
785
+ }
786
+ const isVideoUrl = isVideo(image.url);
787
+ return (
788
+ <View key={image.url} style={styles.accessoryImageContainer}>
789
+ <ImageBackground
790
+ style={styles.accessoryImage}
791
+ imageStyle={styles.accessoryImageBorder}
792
+ source={getImageSource(
793
+ image.thumbNailExists ? image.thumbNailUrl : image.url,
794
+ )}
795
+ >
796
+ {isVideoUrl && (
797
+ <View style={styles.imagePlayContainer}>
798
+ <TouchableOpacity
799
+ onPress={this.toggleFullscreenVideo.bind(this, image.url)}
800
+ >
801
+ <Icon
802
+ name="play"
803
+ type="font-awesome"
804
+ iconStyle={styles.imageControlIcon}
805
+ />
806
+ </TouchableOpacity>
807
+ </View>
808
+ )}
809
+ </ImageBackground>
810
+ <TouchableOpacity
811
+ style={styles.previewItemRemoveButton}
812
+ onPress={() => this.onRemoveImage(image.url)}
813
+ hitSlop={{ top: 8, right: 8, bottom: 8, left: 8 }}
814
+ >
815
+ <View
816
+ style={[
817
+ styles.previewItemRemoveContainer,
818
+ { backgroundColor: this.props.colourBrandingMain },
819
+ ]}
820
+ >
821
+ <Icon
822
+ name="times"
823
+ type="font-awesome"
824
+ iconStyle={styles.previewItemRemoveIcon}
825
+ />
826
+ </View>
827
+ </TouchableOpacity>
828
+ </View>
829
+ );
830
+ })}
831
+ </ScrollView>
832
+ );
833
+ }
672
834
 
673
- renderInputToolbar(props) {
674
- const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
675
- return (
676
- <InputToolbar
677
- {...props}
678
- containerStyle={styles.inputContainer}
679
- renderComposer={this.renderComposer.bind(this)}
680
- renderAccessory={hasAttachment ? this.renderAccessory.bind(this) : null}
681
- accessoryStyle={hasAttachment && styles.accessory}
682
- />
683
- );
684
- }
685
- renderFooter() {
686
- // if (this.state.keyboardOpen) {
687
- // return null;
688
- // }
689
- // fixes an issue where there's no gap between bottom message and reply container
690
- return <View style={{ height: 10 }} />;
691
- }
692
- renderLoading() {
693
- return (
694
- <View style={{ marginTop: 15, justifyContent: 'center', alignContent: 'center' }}>
695
- <Spinner size={'small'} color={this.props.colourBrandingMain} />
696
- </View>
697
- );
698
- }
699
- renderAvatar(props) {
700
- return (
701
- <View style={{ marginRight: 2 }}>
702
- <ProfilePic ProfilePic={props.currentMessage.user.avatar} Diameter={28} />
703
- </View>
704
- );
705
- }
706
- renderComposer(props) {
707
- return (
708
- <View style={styles.composerContainer}>
709
- {this.state.replyingTo && (
710
- <View style={styles.replyingTo}>
711
- <TextStyle type="body">
712
- Replying to {_.isEmpty(this.state.replyingTo?.user?.name) ? 'message' : this.state.replyingTo?.user?.name}
713
- </TextStyle>
714
- <TouchableOpacity
715
- style={styles.replyingRemoveButton}
716
- onPress={() => this.onReply(null)}
717
- hitSlop={{ top: 8, right: 8, bottom: 8, left: 8 }}
718
- >
719
- <View style={[styles.replyingRemoveContainer, { backgroundColor: this.props.colourBrandingMain }]}>
720
- <Icon name="times" type="font-awesome" iconStyle={styles.replyingRemoveIcon} />
721
- </View>
722
- </TouchableOpacity>
723
- </View>
724
- )}
725
- <View style={styles.composerInputWrapper}>
726
- <View
727
- style={[
728
- styles.input,
729
- {
730
- //height: props.composerHeight + 10,
731
- //borderRadius: (this.MIN_COMPOSER_HEIGHT + 10) / 2,
732
- marginRight:
733
- _.isEmpty(props.text) && !this.hasImagesReady(props.imagesToUpload)
734
- ? 8 + this.MIN_COMPOSER_HEIGHT
735
- : 2 * (this.MIN_COMPOSER_HEIGHT + 8),
736
- justifyContent: 'center',
737
- },
738
- Platform.OS === 'ios' && {
739
- height: props.composerHeight + 10,
740
- },
741
- ]}
742
- >
743
- <Composer
744
- {...props}
745
- //composerHeight={props.composerHeight}
746
- placeholder="Type a message..."
747
- textInputStyle={styles.inputText}
748
- textInputProps={{
749
- onFocus: this.onFocusInput.bind(this),
750
- onBlur: this.onBlurInput.bind(this),
751
- }}
752
- />
753
- </View>
754
- </View>
755
- </View>
756
- );
757
- }
835
+ renderInputToolbar(props) {
836
+ const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
837
+ return (
838
+ <InputToolbar
839
+ {...props}
840
+ containerStyle={styles.inputContainer}
841
+ renderComposer={this.renderComposer.bind(this)}
842
+ renderAccessory={hasAttachment ? this.renderAccessory.bind(this) : null}
843
+ accessoryStyle={hasAttachment && styles.accessory}
844
+ />
845
+ );
846
+ }
847
+ renderFooter() {
848
+ // if (this.state.keyboardOpen) {
849
+ // return null;
850
+ // }
851
+ // fixes an issue where there's no gap between bottom message and reply container
852
+ return <View style={{ height: 10 }} />;
853
+ }
854
+ renderLoading() {
855
+ return (
856
+ <View
857
+ style={{
858
+ marginTop: 15,
859
+ justifyContent: "center",
860
+ alignContent: "center",
861
+ }}
862
+ >
863
+ <Spinner size={"small"} color={this.props.colourBrandingMain} />
864
+ </View>
865
+ );
866
+ }
867
+ renderAvatar(props) {
868
+ return (
869
+ <View style={{ marginRight: 2 }}>
870
+ <ProfilePic
871
+ ProfilePic={props.currentMessage.user.avatar}
872
+ Diameter={28}
873
+ />
874
+ </View>
875
+ );
876
+ }
877
+ renderComposer(props) {
878
+ return (
879
+ <View style={{ width: "100%" }}>
880
+ {/* Replying to section - stacked vertically on top */}
881
+ {this.state.replyingTo && (
882
+ <View style={styles.replyingTo}>
883
+ <Text type="body">
884
+ Replying to{" "}
885
+ {_.isEmpty(this.state.replyingTo?.user?.name)
886
+ ? "message"
887
+ : this.state.replyingTo?.user?.name}
888
+ </Text>
889
+ <TouchableOpacity
890
+ style={styles.replyingRemoveButton}
891
+ onPress={() => this.onReply(null)}
892
+ hitSlop={{ top: 8, right: 8, bottom: 8, left: 8 }}
893
+ >
894
+ <View
895
+ style={[
896
+ styles.replyingRemoveContainer,
897
+ { backgroundColor: this.props.colourBrandingMain },
898
+ ]}
899
+ >
900
+ <Icon
901
+ name="times"
902
+ type="font-awesome"
903
+ iconStyle={styles.replyingRemoveIcon}
904
+ />
905
+ </View>
906
+ </TouchableOpacity>
907
+ </View>
908
+ )}
909
+ {/* Horizontal row for input - buttons are absolutely positioned via renderSend */}
910
+ <View
911
+ style={{
912
+ flexDirection: "row",
913
+ alignItems: "flex-end",
914
+ width: "100%",
915
+ paddingBottom: 8,
916
+ }}
917
+ >
918
+ <View
919
+ style={[
920
+ styles.input,
921
+ {
922
+ flex: 1,
923
+ marginRight:
924
+ _.isEmpty(props.text) &&
925
+ !this.hasImagesReady(props.imagesToUpload)
926
+ ? 16 + this.MIN_COMPOSER_HEIGHT
927
+ : 2 * (this.MIN_COMPOSER_HEIGHT + 8),
928
+ paddingHorizontal: 12,
929
+ paddingVertical: Platform.select({ ios: 8, android: 6 }),
930
+ },
931
+ ]}
932
+ >
933
+ <TextInput
934
+ maxFontSizeMultiplier={1.2}
935
+ placeholder="Type a message..."
936
+ multiline
937
+ value={props.text}
938
+ onChangeText={props.onTextChanged}
939
+ style={[
940
+ styles.inputText,
941
+ {
942
+ lineHeight: 20,
943
+ minHeight: this.MIN_COMPOSER_HEIGHT - 16,
944
+ maxHeight: 100,
945
+ },
946
+ ]}
947
+ onFocus={this.onFocusInput.bind(this)}
948
+ onBlur={this.onBlurInput.bind(this)}
949
+ placeholderTextColor="#999"
950
+ />
951
+ </View>
952
+ </View>
953
+ </View>
954
+ );
955
+ }
758
956
 
759
- /***
760
- * Main Render
761
- */
762
- renderChat() {
763
- const { tabCount, noTab } = this.props;
764
- const iosBottomOffset = (tabCount === 1 || noTab ? -10 : 52) + getBottomSpace();
765
- const minInputToolbarHeight =
766
- this.MIN_COMPOSER_HEIGHT + 16 + (this.state.replyingTo ? 30 : 0) + (this.hasImagesAttached() ? IMAGE_PREVIEW_AREA_HEIGHT : 0);
957
+ /***
958
+ * Main Render
959
+ */
960
+ renderChat() {
961
+ const minInputToolbarHeight =
962
+ this.MIN_COMPOSER_HEIGHT +
963
+ 32 +
964
+ (this.state.replyingTo ? 38 : 0) +
965
+ (this.hasImagesAttached() ? IMAGE_PREVIEW_AREA_HEIGHT : 0);
767
966
 
768
- return (
769
- <GiftedChat
770
- alwaysShowSend={false}
771
- keyboardShouldPersistTaps={'never'}
772
- renderAvatarOnTop
773
- minInputToolbarHeight={minInputToolbarHeight}
774
- bottomOffset={Platform.OS === 'android' ? 0 : iosBottomOffset}
775
- onSend={this.sendMessages.bind(this)}
776
- messages={this.state.messages}
777
- user={this.state.currentUser}
778
- renderBubble={this.renderBubble.bind(this)}
779
- renderMessage={this.renderMessage.bind(this)}
780
- renderMessageText={this.renderMessageText.bind(this)}
781
- renderTime={this.renderTime.bind(this)}
782
- renderDay={this.renderDay.bind(this)}
783
- renderCustomView={this.renderCustomView.bind(this)}
784
- renderSend={this.renderSend.bind(this)}
785
- renderInputToolbar={this.renderInputToolbar.bind(this)}
786
- renderFooter={this.renderFooter.bind(this)}
787
- renderLoading={this.renderLoading.bind(this)}
788
- renderAvatar={this.renderAvatar.bind(this)}
789
- imagesToUpload={this.state.imagesToUpload}
790
- />
791
- );
792
- }
967
+ return (
968
+ <GiftedChat
969
+ isKeyboardInternallyHandled={false}
970
+ alwaysShowSend={false}
971
+ keyboardShouldPersistTaps={"never"}
972
+ renderAvatarOnTop
973
+ minInputToolbarHeight={minInputToolbarHeight}
974
+ minComposerHeight={this.MIN_COMPOSER_HEIGHT}
975
+ bottomOffset={0}
976
+ onSend={this.sendMessages.bind(this)}
977
+ messages={this.state.messages}
978
+ user={this.state.currentUser}
979
+ renderBubble={this.renderBubble.bind(this)}
980
+ renderMessage={this.renderMessage.bind(this)}
981
+ renderMessageText={this.renderMessageText.bind(this)}
982
+ renderTime={this.renderTime.bind(this)}
983
+ renderDay={this.renderDay.bind(this)}
984
+ renderCustomView={this.renderCustomView.bind(this)}
985
+ renderSend={this.renderSend.bind(this)}
986
+ renderInputToolbar={this.renderInputToolbar.bind(this)}
987
+ renderFooter={this.renderFooter.bind(this)}
988
+ renderLoading={this.renderLoading.bind(this)}
989
+ renderAvatar={this.renderAvatar.bind(this)}
990
+ imagesToUpload={this.state.imagesToUpload}
991
+ />
992
+ );
993
+ }
793
994
 
794
- renderImageUploader() {
795
- return (
796
- <ImageUploader
797
- ref={ref => (this.imageUploader = ref)}
798
- onUploadStarted={this.onUploadStarted}
799
- onUploadProgress={this.onUploadProgress}
800
- onUploadSuccess={this.onUploadSuccess}
801
- onUploadFailed={this.onUploadFailed}
802
- onLibrarySelected={this.onLibrarySelected}
803
- quality={0.8}
804
- allowsEditing={false}
805
- fileName={'imageInput'}
806
- popupTitle={'Add Image'}
807
- userId={this.props.user.uid}
808
- multiple
809
- allowVideo
810
- />
811
- );
812
- }
995
+ renderImageUploader() {
996
+ return (
997
+ <ImageUploader
998
+ ref={(ref) => (this.imageUploader = ref)}
999
+ onUploadStarted={this.onUploadStarted}
1000
+ onUploadProgress={this.onUploadProgress}
1001
+ onUploadSuccess={this.onUploadSuccess}
1002
+ onUploadFailed={this.onUploadFailed}
1003
+ onLibrarySelected={this.onLibrarySelected}
1004
+ quality={0.8}
1005
+ allowsEditing={false}
1006
+ fileName={"imageInput"}
1007
+ popupTitle={"Add Image"}
1008
+ userId={this.props.user.uid}
1009
+ multiple
1010
+ allowVideo
1011
+ />
1012
+ );
1013
+ }
813
1014
 
814
- renderImagePopup() {
815
- const { imagePopupOpen, imagePopupSource, imagePopupIndex } = this.state;
816
- return (
817
- <ImagePopup
818
- visible={imagePopupOpen}
819
- images={imagePopupSource}
820
- index={imagePopupIndex}
821
- onClose={this.closeGallery.bind(this)}
822
- ref="imagePopup"
823
- />
824
- );
825
- }
1015
+ renderImagePopup() {
1016
+ const { imagePopupOpen, imagePopupSource, imagePopupIndex } = this.state;
1017
+ return (
1018
+ <ImagePopup
1019
+ visible={imagePopupOpen}
1020
+ images={imagePopupSource}
1021
+ index={imagePopupIndex}
1022
+ onClose={this.closeGallery.bind(this)}
1023
+ />
1024
+ );
1025
+ }
826
1026
 
827
- renderVideoPlayerPopup() {
828
- const { showFullscreenVideo, currentVideoUrl } = this.state;
829
- if (!currentVideoUrl) return;
1027
+ renderVideoPlayerPopup() {
1028
+ const { showFullscreenVideo, currentVideoUrl } = this.state;
1029
+ if (!currentVideoUrl) return;
830
1030
 
831
- return <VideoPopup uri={currentVideoUrl} visible={showFullscreenVideo} onClose={this.toggleFullscreenVideo} />;
832
- }
1031
+ return (
1032
+ <VideoPopup
1033
+ uri={currentVideoUrl}
1034
+ visible={showFullscreenVideo}
1035
+ onClose={this.toggleFullscreenVideo}
1036
+ />
1037
+ );
1038
+ }
833
1039
 
834
- renderPDF() {
835
- if (_.isEmpty(this.state.selectedPDF)) {
836
- return null;
837
- }
838
- return (
839
- <PDFPopup source={this.state.selectedPDF} onClose={this.onCloseAttachment} title={getFileName(this.state.selectedPDF)} pdfCount={1} />
840
- );
841
- }
1040
+ renderPDF() {
1041
+ if (_.isEmpty(this.state.selectedPDF)) {
1042
+ return null;
1043
+ }
1044
+ return (
1045
+ <PDFPopup
1046
+ source={this.state.selectedPDF}
1047
+ onClose={this.onCloseAttachment}
1048
+ title={getFileName(this.state.selectedPDF)}
1049
+ pdfCount={1}
1050
+ />
1051
+ );
1052
+ }
842
1053
 
843
- renderDeleteConfirmPopup() {
844
- return (
845
- <ConfirmPopup
846
- visible={this.state.showDeleteMessageConfirm}
847
- onConfirm={this.onConfirmDeleteMessage}
848
- onCancel={this.onCancelDeleteMessage}
849
- text="Are you sure you want to delete this message?"
850
- yesText="Delete"
851
- noText="Cancel"
852
- />
853
- );
854
- }
1054
+ renderDeleteConfirmPopup() {
1055
+ return (
1056
+ <ConfirmPopup
1057
+ visible={this.state.showDeleteMessageConfirm}
1058
+ onConfirm={this.onConfirmDeleteMessage}
1059
+ onCancel={this.onCancelDeleteMessage}
1060
+ text="Are you sure you want to delete this message?"
1061
+ yesText="Delete"
1062
+ noText="Cancel"
1063
+ />
1064
+ );
1065
+ }
855
1066
 
856
- render() {
857
- if (Platform.OS === 'android' && !this.props.noAndroidAvoid) {
858
- return (
859
- <KeyboardAvoidingView behavior={'padding'} style={styles.chatContainer}>
860
- {this.renderChat()}
861
- {this.renderImageUploader()}
862
- {this.renderImagePopup()}
863
- {this.renderVideoPlayerPopup()}
864
- {this.renderPDF()}
865
- {this.renderDeleteConfirmPopup()}
866
- </KeyboardAvoidingView>
867
- );
868
- }
869
- return (
870
- <View style={styles.chatContainer}>
871
- {this.renderChat()}
872
- {this.renderImageUploader()}
873
- {this.renderImagePopup()}
874
- {this.renderVideoPlayerPopup()}
875
- {this.renderPDF()}
876
- {this.renderDeleteConfirmPopup()}
877
- </View>
878
- );
879
- }
1067
+ render() {
1068
+ return (
1069
+ <KeyboardAvoidingView behavior="padding" style={styles.chatContainer}>
1070
+ {this.renderChat()}
1071
+ {this.renderImageUploader()}
1072
+ {this.renderImagePopup()}
1073
+ {this.renderVideoPlayerPopup()}
1074
+ {this.renderPDF()}
1075
+ {this.renderDeleteConfirmPopup()}
1076
+ </KeyboardAvoidingView>
1077
+ );
1078
+ }
880
1079
  }
881
1080
 
882
1081
  const styles = {
883
- chatContainer: {
884
- flex: 1,
885
- justifyContent: 'center',
886
- },
887
- eventContainer: {
888
- left: {
889
- paddingTop: 5,
890
- paddingLeft: 15,
891
- paddingRight: 15,
892
- paddingBottom: 5,
893
- flexDirection: 'row',
894
- },
895
- right: {
896
- paddingTop: 5,
897
- paddingLeft: 15,
898
- paddingRight: 15,
899
- paddingBottom: 5,
900
- flexDirection: 'row-reverse',
901
- },
902
- },
903
- eventImage: {
904
- width: 80,
905
- height: 80,
906
- resizeMode: 'cover',
907
- borderRadius: 2,
908
- },
909
- eventImageMargin: {
910
- right: {
911
- marginLeft: 15,
912
- },
913
- left: {
914
- marginRight: 15,
915
- },
916
- },
917
- eventInfo: {
918
- minHeight: 80,
919
- width: 150,
920
- },
921
- eventTitle: {
922
- fontSize: 12,
923
- fontFamily: 'sf-bold',
924
- backgroundColor: 'rgba(255,255,255,0)',
925
- },
926
- eventInfoAlign: {
927
- left: {
928
- textAlign: 'left',
929
- },
930
- right: {
931
- textAlign: 'right',
932
- },
933
- },
934
- messageImageLarge: {
935
- width: IMAGE_SIZE_LARGE,
936
- height: IMAGE_SIZE_LARGE,
937
- borderRadius: 2,
938
- alignSelf: 'center',
939
- },
940
- messageImageSmall: {
941
- width: IMAGE_SIZE_SMALL,
942
- height: IMAGE_SIZE_SMALL,
943
- borderRadius: 2,
944
- alignSelf: 'center',
945
- marginRight: IMAGE_MARGIN,
946
- marginBottom: IMAGE_MARGIN,
947
- },
948
- eventDate: {
949
- fontSize: 12,
950
- fontFamily: 'sf-regular',
951
- backgroundColor: 'rgba(255,255,255,0)',
952
- },
953
- inputContainer: {
954
- backgroundColor: '#fff',
955
- paddingVertical: 8,
956
- paddingHorizontal: 8,
957
- },
958
- inputText: {
959
- color: TEXT_DARKEST,
960
- fontSize: 14,
961
- fontFamily: 'sf-medium',
962
- },
963
- input: {
964
- margin: 0,
965
- backgroundColor: BG_GREY,
966
- borderRadius: 5,
967
- flex: 1,
968
- },
969
- composerContainer: {
970
- flex: 1,
971
- },
972
- composerInputWrapper: {
973
- flex: 1,
974
- flexDirection: 'row',
975
- },
976
- replyingTo: {
977
- minHeight: 30,
978
- flexDirection: 'row',
979
- alignItems: 'center',
980
- borderBottomWidth: 1,
981
- borderBottomColor: LINEGREY,
982
- marginBottom: 8,
983
- },
984
- replyingRemoveButton: {
985
- marginLeft: 10,
986
- },
987
- replyingRemoveContainer: {
988
- justifyContent: 'center',
989
- alignItems: 'center',
990
- borderRadius: 10,
991
- width: 20,
992
- height: 20,
993
- borderWidth: 2,
994
- borderColor: '#fff',
995
- },
996
- replyingRemoveIcon: {
997
- fontSize: 10,
998
- color: '#fff',
999
- marginBottom: 1,
1000
- },
1001
- sendContainer: {
1002
- position: 'absolute',
1003
- top: 0,
1004
- right: 0,
1005
- height: 30,
1006
- width: 30,
1007
- alignItems: 'center',
1008
- justifyContent: 'center',
1009
- backgroundColor: '#fff',
1010
- },
1011
- send: {
1012
- fontSize: 15,
1013
- color: TEXT_BLUEGREY,
1014
- fontSize: 24,
1015
- textAlign: 'center',
1016
- },
1017
- accessory: {
1018
- height: IMAGE_PREVIEW_AREA_HEIGHT,
1019
- borderTopWidth: 1,
1020
- borderTopColor: LINEGREY,
1021
- paddingTop: 8,
1022
- marginTop: 8,
1023
- },
1024
- accessoryImageContainer: {
1025
- paddingRight: 8,
1026
- paddingTop: 8,
1027
- marginRight: 5,
1028
- },
1029
- accessoryImage: {
1030
- width: IMAGE_PREVIEW_SIZE,
1031
- height: IMAGE_PREVIEW_SIZE,
1032
- },
1033
- accessoryImageBorder: {
1034
- borderRadius: 2,
1035
- },
1036
- settingDropDownOpen: {
1037
- height: 'auto',
1038
- },
1039
- imagesContainer: {
1040
- marginLeft: 10,
1041
- marginRight: 10,
1042
- flexDirection: 'row',
1043
- flexWrap: 'wrap',
1044
- },
1045
- uploadImagesContainer: {
1046
- flexDirection: 'row',
1047
- overflow: 'visible',
1048
- },
1049
- previewItemRemoveButton: {
1050
- position: 'absolute',
1051
- top: 0,
1052
- right: 0,
1053
- },
1054
- previewItemRemoveContainer: {
1055
- justifyContent: 'center',
1056
- alignItems: 'center',
1057
- borderRadius: 10,
1058
- width: 20,
1059
- height: 20,
1060
- borderWidth: 2,
1061
- borderColor: '#fff',
1062
- },
1063
- previewItemRemoveIcon: {
1064
- fontSize: 10,
1065
- color: '#fff',
1066
- marginBottom: 1,
1067
- },
1068
- imagePlayContainer: {
1069
- position: 'absolute',
1070
- top: 0,
1071
- left: 0,
1072
- right: 0,
1073
- bottom: 0,
1074
- alignItems: 'center',
1075
- justifyContent: 'center',
1076
- },
1077
- imageControlIcon: {
1078
- color: '#fff',
1079
- fontSize: 20,
1080
- textShadowColor: 'rgba(0,0,0,0.3)',
1081
- textShadowOffset: { width: 2, height: 2 },
1082
- },
1082
+ chatContainer: {
1083
+ flex: 1,
1084
+ justifyContent: "center",
1085
+ },
1086
+ eventContainer: {
1087
+ left: {
1088
+ paddingTop: 5,
1089
+ paddingLeft: 15,
1090
+ paddingRight: 15,
1091
+ paddingBottom: 5,
1092
+ flexDirection: "row",
1093
+ },
1094
+ right: {
1095
+ paddingTop: 5,
1096
+ paddingLeft: 15,
1097
+ paddingRight: 15,
1098
+ paddingBottom: 5,
1099
+ flexDirection: "row-reverse",
1100
+ },
1101
+ },
1102
+ eventImage: {
1103
+ width: 80,
1104
+ height: 80,
1105
+ resizeMode: "cover",
1106
+ borderRadius: 2,
1107
+ },
1108
+ eventImageMargin: {
1109
+ right: {
1110
+ marginLeft: 15,
1111
+ },
1112
+ left: {
1113
+ marginRight: 15,
1114
+ },
1115
+ },
1116
+ eventInfo: {
1117
+ minHeight: 80,
1118
+ width: 150,
1119
+ },
1120
+ eventTitle: {
1121
+ fontSize: 12,
1122
+ fontFamily: "sf-bold",
1123
+ backgroundColor: "rgba(255,255,255,0)",
1124
+ },
1125
+ eventInfoAlign: {
1126
+ left: {
1127
+ textAlign: "left",
1128
+ },
1129
+ right: {
1130
+ textAlign: "right",
1131
+ },
1132
+ },
1133
+ messageImageLarge: {
1134
+ width: IMAGE_SIZE_LARGE,
1135
+ height: IMAGE_SIZE_LARGE,
1136
+ borderRadius: 2,
1137
+ alignSelf: "center",
1138
+ },
1139
+ messageImageSmall: {
1140
+ width: IMAGE_SIZE_SMALL,
1141
+ height: IMAGE_SIZE_SMALL,
1142
+ borderRadius: 2,
1143
+ alignSelf: "center",
1144
+ marginRight: IMAGE_MARGIN,
1145
+ marginBottom: IMAGE_MARGIN,
1146
+ },
1147
+ eventDate: {
1148
+ fontSize: 12,
1149
+ fontFamily: "sf-regular",
1150
+ backgroundColor: "rgba(255,255,255,0)",
1151
+ },
1152
+ inputContainer: {
1153
+ backgroundColor: "#fff",
1154
+ paddingVertical: 8,
1155
+ paddingHorizontal: 8,
1156
+ },
1157
+ inputText: {
1158
+ color: TEXT_DARKEST,
1159
+ fontSize: 14,
1160
+ fontFamily: "sf-medium",
1161
+ },
1162
+ input: {
1163
+ margin: 0,
1164
+ backgroundColor: BG_GREY,
1165
+ borderRadius: 5,
1166
+ flex: 1,
1167
+ },
1168
+ composerContainer: {
1169
+ flex: 1,
1170
+ },
1171
+ composerInputWrapper: {
1172
+ flex: 1,
1173
+ flexDirection: "row",
1174
+ },
1175
+ replyingTo: {
1176
+ minHeight: 30,
1177
+ flexDirection: "row",
1178
+ alignItems: "center",
1179
+ borderBottomWidth: 1,
1180
+ borderBottomColor: LINEGREY,
1181
+ marginBottom: 8,
1182
+ },
1183
+ replyingRemoveButton: {
1184
+ marginLeft: 10,
1185
+ },
1186
+ replyingRemoveContainer: {
1187
+ justifyContent: "center",
1188
+ alignItems: "center",
1189
+ borderRadius: 10,
1190
+ width: 20,
1191
+ height: 20,
1192
+ borderWidth: 2,
1193
+ borderColor: "#fff",
1194
+ },
1195
+ replyingRemoveIcon: {
1196
+ fontSize: 10,
1197
+ color: "#fff",
1198
+ marginBottom: 1,
1199
+ },
1200
+ sendContainer: {
1201
+ position: "absolute",
1202
+ top: 0,
1203
+ right: 0,
1204
+ height: 30,
1205
+ width: 30,
1206
+ alignItems: "center",
1207
+ justifyContent: "center",
1208
+ backgroundColor: "#fff",
1209
+ },
1210
+ send: {
1211
+ fontSize: 15,
1212
+ color: TEXT_BLUEGREY,
1213
+ fontSize: 24,
1214
+ textAlign: "center",
1215
+ },
1216
+ accessory: {
1217
+ height: IMAGE_PREVIEW_AREA_HEIGHT,
1218
+ borderTopWidth: 1,
1219
+ borderTopColor: LINEGREY,
1220
+ paddingTop: 8,
1221
+ marginTop: 8,
1222
+ },
1223
+ accessoryImageContainer: {
1224
+ paddingRight: 8,
1225
+ paddingTop: 8,
1226
+ marginRight: 5,
1227
+ },
1228
+ accessoryImage: {
1229
+ width: IMAGE_PREVIEW_SIZE,
1230
+ height: IMAGE_PREVIEW_SIZE,
1231
+ },
1232
+ accessoryImageBorder: {
1233
+ borderRadius: 2,
1234
+ },
1235
+ settingDropDownOpen: {
1236
+ height: "auto",
1237
+ },
1238
+ imagesContainer: {
1239
+ marginLeft: 10,
1240
+ marginRight: 10,
1241
+ flexDirection: "row",
1242
+ flexWrap: "wrap",
1243
+ },
1244
+ uploadImagesContainer: {
1245
+ flexDirection: "row",
1246
+ overflow: "visible",
1247
+ },
1248
+ previewItemRemoveButton: {
1249
+ position: "absolute",
1250
+ top: 0,
1251
+ right: 0,
1252
+ },
1253
+ previewItemRemoveContainer: {
1254
+ justifyContent: "center",
1255
+ alignItems: "center",
1256
+ borderRadius: 10,
1257
+ width: 20,
1258
+ height: 20,
1259
+ borderWidth: 2,
1260
+ borderColor: "#fff",
1261
+ },
1262
+ previewItemRemoveIcon: {
1263
+ fontSize: 10,
1264
+ color: "#fff",
1265
+ marginBottom: 1,
1266
+ },
1267
+ imagePlayContainer: {
1268
+ position: "absolute",
1269
+ top: 0,
1270
+ left: 0,
1271
+ right: 0,
1272
+ bottom: 0,
1273
+ alignItems: "center",
1274
+ justifyContent: "center",
1275
+ },
1276
+ imageControlIcon: {
1277
+ color: "#fff",
1278
+ fontSize: 20,
1279
+ textShadowColor: "rgba(0,0,0,0.3)",
1280
+ textShadowOffset: { width: 2, height: 2 },
1281
+ },
1083
1282
  };
1084
1283
 
1085
- const mapStateToProps = state => {
1086
- return {
1087
- user: state.user,
1088
- colourBrandingMain: getMainBrandingColourFromState(state),
1089
- colourBrandingLight: getLightBrandingColourFromState(state),
1090
- tabCount: getEnabledTabsFromState(state).length,
1091
- };
1284
+ const mapStateToProps = (state) => {
1285
+ return {
1286
+ user: state.user,
1287
+ colourBrandingMain: getMainBrandingColourFromState(state),
1288
+ colourBrandingLight: getLightBrandingColourFromState(state),
1289
+ tabCount: getEnabledTabsFromState(state).length,
1290
+ };
1092
1291
  };
1093
1292
 
1094
- export default connect(mapStateToProps, {})(PlussChat);
1293
+ export default connect(mapStateToProps, {})(withSafeAreaInsets(PlussChat));