@plusscommunities/pluss-core-app 4.0.4-auth.0 → 6.0.0-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 (195) hide show
  1. package/dist/module/actions/FollowerActions.js +34 -0
  2. package/dist/module/actions/FollowerActions.js.map +1 -0
  3. package/dist/module/actions/MediaActions.js +29 -0
  4. package/dist/module/actions/MediaActions.js.map +1 -0
  5. package/dist/module/actions/ResidentActions.js +26 -0
  6. package/dist/module/actions/ResidentActions.js.map +1 -0
  7. package/dist/module/actions/UserActions.js +223 -0
  8. package/dist/module/actions/UserActions.js.map +1 -0
  9. package/dist/module/actions/UserSettingsActions.js +14 -0
  10. package/dist/module/actions/UserSettingsActions.js.map +1 -0
  11. package/dist/module/actions/index.js +6 -0
  12. package/dist/module/actions/index.js.map +1 -0
  13. package/dist/module/actions/types.js +17 -0
  14. package/dist/module/actions/types.js.map +1 -0
  15. package/dist/module/apis/analyticsActions.js +20 -0
  16. package/dist/module/apis/analyticsActions.js.map +1 -0
  17. package/dist/module/apis/contactActions.js +27 -0
  18. package/dist/module/apis/contactActions.js.map +1 -0
  19. package/dist/module/apis/eventActions.js +161 -0
  20. package/dist/module/apis/eventActions.js.map +1 -0
  21. package/dist/module/apis/fileActions.js +86 -0
  22. package/dist/module/apis/fileActions.js.map +1 -0
  23. package/dist/module/apis/followerActions.js +38 -0
  24. package/dist/module/apis/followerActions.js.map +1 -0
  25. package/dist/module/apis/index.js +12 -0
  26. package/dist/module/apis/index.js.map +1 -0
  27. package/dist/module/apis/notificationActions.js +60 -0
  28. package/dist/module/apis/notificationActions.js.map +1 -0
  29. package/dist/module/apis/profileActions.js +14 -0
  30. package/dist/module/apis/profileActions.js.map +1 -0
  31. package/dist/module/apis/reactionActions.js +76 -0
  32. package/dist/module/apis/reactionActions.js.map +1 -0
  33. package/dist/module/apis/stringActions.js +30 -0
  34. package/dist/module/apis/stringActions.js.map +1 -0
  35. package/dist/module/apis/typeActions.js +15 -0
  36. package/dist/module/apis/typeActions.js.map +1 -0
  37. package/dist/module/apis/userActions.js +104 -0
  38. package/dist/module/apis/userActions.js.map +1 -0
  39. package/dist/module/assets/icons/reactions/heart.png +0 -0
  40. package/dist/module/assets/icons/reactions/party.png +0 -0
  41. package/dist/module/assets/icons/reactions/sad.png +0 -0
  42. package/dist/module/assets/icons/reactions/smile.png +0 -0
  43. package/dist/module/colours.js +168 -0
  44. package/dist/module/colours.js.map +1 -0
  45. package/dist/module/components/AddButton.js +43 -0
  46. package/dist/module/components/AddButton.js.map +1 -0
  47. package/dist/module/components/AddToCalendarButton.js +225 -0
  48. package/dist/module/components/AddToCalendarButton.js.map +1 -0
  49. package/dist/module/components/Attachment.js +54 -0
  50. package/dist/module/components/Attachment.js.map +1 -0
  51. package/dist/module/components/AudienceSelectorLauncher.js +64 -0
  52. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
  53. package/dist/module/components/AudienceSelectorPage.js +350 -0
  54. package/dist/module/components/AudienceSelectorPage.js.map +1 -0
  55. package/dist/module/components/AutoOffsetImage.js +186 -0
  56. package/dist/module/components/AutoOffsetImage.js.map +1 -0
  57. package/dist/module/components/BackButton.js +58 -0
  58. package/dist/module/components/BackButton.js.map +1 -0
  59. package/dist/module/components/CategoryTabs.js +154 -0
  60. package/dist/module/components/CategoryTabs.js.map +1 -0
  61. package/dist/module/components/CommentReply.js +328 -0
  62. package/dist/module/components/CommentReply.js.map +1 -0
  63. package/dist/module/components/CommentSection.js +822 -0
  64. package/dist/module/components/CommentSection.js.map +1 -0
  65. package/dist/module/components/ConfirmPopup.js +108 -0
  66. package/dist/module/components/ConfirmPopup.js.map +1 -0
  67. package/dist/module/components/ConfirmationPopup.js +72 -0
  68. package/dist/module/components/ConfirmationPopup.js.map +1 -0
  69. package/dist/module/components/DropDownItem.js +74 -0
  70. package/dist/module/components/DropDownItem.js.map +1 -0
  71. package/dist/module/components/DropDownMenu.js +41 -0
  72. package/dist/module/components/DropDownMenu.js.map +1 -0
  73. package/dist/module/components/EmptyStateMain.js +50 -0
  74. package/dist/module/components/EmptyStateMain.js.map +1 -0
  75. package/dist/module/components/EmptyStateWidget.js +47 -0
  76. package/dist/module/components/EmptyStateWidget.js.map +1 -0
  77. package/dist/module/components/FontScaleButton.js +36 -0
  78. package/dist/module/components/FontScaleButton.js.map +1 -0
  79. package/dist/module/components/FontScalePopup.js +75 -0
  80. package/dist/module/components/FontScalePopup.js.map +1 -0
  81. package/dist/module/components/FormCard.js +25 -0
  82. package/dist/module/components/FormCard.js.map +1 -0
  83. package/dist/module/components/FormCardSection.js +212 -0
  84. package/dist/module/components/FormCardSection.js.map +1 -0
  85. package/dist/module/components/FormCardSectionOptionLauncher.js +72 -0
  86. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
  87. package/dist/module/components/FormattedText.js +131 -0
  88. package/dist/module/components/FormattedText.js.map +1 -0
  89. package/dist/module/components/GenericInput.js +148 -0
  90. package/dist/module/components/GenericInput.js.map +1 -0
  91. package/dist/module/components/GenericInputSection.js +158 -0
  92. package/dist/module/components/GenericInputSection.js.map +1 -0
  93. package/dist/module/components/Header.js +458 -0
  94. package/dist/module/components/Header.js.map +1 -0
  95. package/dist/module/components/ImagePopup.js +240 -0
  96. package/dist/module/components/ImagePopup.js.map +1 -0
  97. package/dist/module/components/ImageUploadProgress.js +68 -0
  98. package/dist/module/components/ImageUploadProgress.js.map +1 -0
  99. package/dist/module/components/ImageUploader.js +795 -0
  100. package/dist/module/components/ImageUploader.js.map +1 -0
  101. package/dist/module/components/InlineButton.js +65 -0
  102. package/dist/module/components/InlineButton.js.map +1 -0
  103. package/dist/module/components/Input.js +154 -0
  104. package/dist/module/components/Input.js.map +1 -0
  105. package/dist/module/components/LoadingCircles.js +220 -0
  106. package/dist/module/components/LoadingCircles.js.map +1 -0
  107. package/dist/module/components/LoadingIndicator.js +86 -0
  108. package/dist/module/components/LoadingIndicator.js.map +1 -0
  109. package/dist/module/components/LoadingStateWidget.js +46 -0
  110. package/dist/module/components/LoadingStateWidget.js.map +1 -0
  111. package/dist/module/components/MediaPlayer.js +418 -0
  112. package/dist/module/components/MediaPlayer.js.map +1 -0
  113. package/dist/module/components/MiddlePopup.js +43 -0
  114. package/dist/module/components/MiddlePopup.js.map +1 -0
  115. package/dist/module/components/PDFPopup.js +191 -0
  116. package/dist/module/components/PDFPopup.js.map +1 -0
  117. package/dist/module/components/PlussChat.js +986 -0
  118. package/dist/module/components/PlussChat.js.map +1 -0
  119. package/dist/module/components/PlussChatMessage.js +262 -0
  120. package/dist/module/components/PlussChatMessage.js.map +1 -0
  121. package/dist/module/components/PlussChatTime.js +58 -0
  122. package/dist/module/components/PlussChatTime.js.map +1 -0
  123. package/dist/module/components/Popup.js +125 -0
  124. package/dist/module/components/Popup.js.map +1 -0
  125. package/dist/module/components/PopupMenu.js +119 -0
  126. package/dist/module/components/PopupMenu.js.map +1 -0
  127. package/dist/module/components/PositionedImage.js +313 -0
  128. package/dist/module/components/PositionedImage.js.map +1 -0
  129. package/dist/module/components/ProfilePic.js +106 -0
  130. package/dist/module/components/ProfilePic.js.map +1 -0
  131. package/dist/module/components/RadioButton.js +77 -0
  132. package/dist/module/components/RadioButton.js.map +1 -0
  133. package/dist/module/components/Reaction.js +116 -0
  134. package/dist/module/components/Reaction.js.map +1 -0
  135. package/dist/module/components/Reactions.js +71 -0
  136. package/dist/module/components/Reactions.js.map +1 -0
  137. package/dist/module/components/SharingTools.js +154 -0
  138. package/dist/module/components/SharingTools.js.map +1 -0
  139. package/dist/module/components/Spinner.js +22 -0
  140. package/dist/module/components/Spinner.js.map +1 -0
  141. package/dist/module/components/StickyFooter.js +34 -0
  142. package/dist/module/components/StickyFooter.js.map +1 -0
  143. package/dist/module/components/TextStyle.js +45 -0
  144. package/dist/module/components/TextStyle.js.map +1 -0
  145. package/dist/module/components/Toggle.js +65 -0
  146. package/dist/module/components/Toggle.js.map +1 -0
  147. package/dist/module/components/TouchableSearchBar.js +67 -0
  148. package/dist/module/components/TouchableSearchBar.js.map +1 -0
  149. package/dist/module/components/UserListPopup.js +135 -0
  150. package/dist/module/components/UserListPopup.js.map +1 -0
  151. package/dist/module/components/UserListing.js +267 -0
  152. package/dist/module/components/UserListing.js.map +1 -0
  153. package/dist/module/components/VideoPopup.js +113 -0
  154. package/dist/module/components/VideoPopup.js.map +1 -0
  155. package/dist/module/components/WarningPopup.js +82 -0
  156. package/dist/module/components/WarningPopup.js.map +1 -0
  157. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +289 -0
  158. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
  159. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +116 -0
  160. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
  161. package/dist/module/components/index.js +55 -0
  162. package/dist/module/components/index.js.map +1 -0
  163. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +385 -0
  164. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
  165. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +387 -0
  166. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
  167. package/dist/module/config.js +32 -0
  168. package/dist/module/config.js.map +1 -0
  169. package/dist/module/constants.js +19 -0
  170. package/dist/module/constants.js.map +1 -0
  171. package/dist/module/fonts/index.js +2 -0
  172. package/dist/module/fonts/index.js.map +1 -0
  173. package/dist/module/fonts/pluss60-icons.js +5 -0
  174. package/dist/module/fonts/pluss60-icons.js.map +1 -0
  175. package/dist/module/fonts/pluss60-icons.json +1097 -0
  176. package/dist/module/helper.js +397 -0
  177. package/dist/module/helper.js.map +1 -0
  178. package/dist/module/index.js +13 -0
  179. package/dist/module/index.js.map +1 -0
  180. package/dist/module/js/images/detectFaces.js +30 -0
  181. package/dist/module/js/images/detectFaces.js.map +1 -0
  182. package/dist/module/js/images/findLandmarkRange.js +93 -0
  183. package/dist/module/js/images/findLandmarkRange.js.map +1 -0
  184. package/dist/module/js/images/getScaledOffset.js +81 -0
  185. package/dist/module/js/images/getScaledOffset.js.map +1 -0
  186. package/dist/module/js/site/getSiteLevelFromState.js +29 -0
  187. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -0
  188. package/dist/module/js/site/isTVEnabled.js +10 -0
  189. package/dist/module/js/site/isTVEnabled.js.map +1 -0
  190. package/dist/module/session.js +58 -0
  191. package/dist/module/session.js.map +1 -0
  192. package/dist/module/styles.js +67 -0
  193. package/dist/module/styles.js.map +1 -0
  194. package/package.json +20 -24
  195. package/src/js/images/detectFaces.js +8 -4
@@ -0,0 +1,986 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import React, { Component } from 'react';
6
+ import { View, Image, ImageBackground, TouchableOpacity, Text, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
7
+ import { GiftedChat, Bubble, MessageText, Send, InputToolbar, Composer } from 'react-native-gifted-chat';
8
+ import { connect } from 'react-redux';
9
+ import _ from 'lodash';
10
+ import moment from 'moment';
11
+ import { Icon } from 'react-native-elements';
12
+ import { getBottomSpace } from 'react-native-iphone-x-helper';
13
+ import { Spinner } from './Spinner';
14
+ import { ProfilePic } from './ProfilePic';
15
+ import PlussChatTime from './PlussChatTime';
16
+ import { PDFPopup } from './PDFPopup';
17
+ import { Attachment } from './Attachment';
18
+ import PlussChatMessage from './PlussChatMessage';
19
+ import { TextStyle } from './TextStyle';
20
+ import { TEXT_DARK, LINEGREY, TEXT_DARKEST, getMainBrandingColourFromState, getLightBrandingColourFromState, BG_GREY, TEXT_BLUEGREY } from '../colours';
21
+ import { getEnabledTabsFromState, get1400, getThumb300, imageExists, isVideo, getImageSource, getFileName } from '../helper';
22
+ import Config, { Services } from '../config';
23
+ import ImageUploader from './ImageUploader';
24
+ import ImageUploadProgress from './ImageUploadProgress';
25
+ import { ImagePopup } from './ImagePopup';
26
+ import { VideoPopup } from './VideoPopup';
27
+ const IMAGE_SIZE_SMALL = 55;
28
+ const IMAGE_SIZE_LARGE = 110;
29
+ const IMAGES_PER_ROW = 4;
30
+ const IMAGE_MARGIN = 2;
31
+ const IMAGE_PREVIEW_AREA_HEIGHT = 105;
32
+ const IMAGE_PREVIEW_SIZE = IMAGE_PREVIEW_AREA_HEIGHT - 25;
33
+ class PlussChat extends Component {
34
+ constructor(props) {
35
+ super(props);
36
+ _defineProperty(this, "onPressEvent", event => {
37
+ Services.navigation.navigate('eventDetail', {
38
+ event
39
+ });
40
+ });
41
+ _defineProperty(this, "onPressAttachment", attachment => {
42
+ switch (attachment.Type) {
43
+ case 'Event':
44
+ Services.navigation.navigate('eventDetail', {
45
+ event: attachment
46
+ });
47
+ break;
48
+ case 'Place':
49
+ Services.navigation.navigate('placeDetail', {
50
+ place: attachment
51
+ });
52
+ break;
53
+ default:
54
+ return;
55
+ }
56
+ });
57
+ _defineProperty(this, "hasImagesAttached", (imagesToUpload = null) => {
58
+ return !_.isEmpty(imagesToUpload || this.state.imagesToUpload);
59
+ });
60
+ _defineProperty(this, "hasImagesReady", (imagesToUpload = null) => {
61
+ const upload = imagesToUpload || this.state.imagesToUpload;
62
+ return this.hasImagesAttached(upload) && upload.every(i => !i.uploading && i.thumbNailExists);
63
+ });
64
+ _defineProperty(this, "waitForThumbnails", () => {
65
+ if (this.checkThumb) return;
66
+ this.checkThumb = setInterval(async () => {
67
+ const imagesToUpload = [];
68
+ await Promise.all(this.state.imagesToUpload.map(image => {
69
+ return new Promise(async resolve => {
70
+ const newImage = {
71
+ ...image
72
+ };
73
+ imagesToUpload.push(newImage);
74
+ if (newImage.url && !newImage.thumbNailExists) {
75
+ newImage.uploading = false;
76
+ newImage.allowRetry = false;
77
+ newImage.thumbNailExists = await imageExists(newImage.thumbNailUrl);
78
+ resolve(newImage.thumbNailExists);
79
+ }
80
+ resolve(true);
81
+ });
82
+ }));
83
+ const thumbnailsExist = imagesToUpload.every(image => !image.url || image.thumbNailExists);
84
+ if (thumbnailsExist) {
85
+ clearInterval(this.checkThumb);
86
+ this.checkThumb = null;
87
+ this.setState({
88
+ imagesToUpload
89
+ });
90
+ }
91
+ }, 2000);
92
+ });
93
+ _defineProperty(this, "onOpenAttachment", a => {
94
+ this.setState({
95
+ selectedPDF: a
96
+ });
97
+ });
98
+ _defineProperty(this, "onCloseAttachment", () => {
99
+ this.setState({
100
+ selectedPDF: null
101
+ });
102
+ });
103
+ _defineProperty(this, "onFocusInput", () => {
104
+ this.setState({
105
+ keyboardOpen: true
106
+ });
107
+ if (this.props.keyboardOpen) {
108
+ this.props.keyboardOpen();
109
+ }
110
+ });
111
+ _defineProperty(this, "onBlurInput", () => {
112
+ this.setState({
113
+ keyboardOpen: false
114
+ });
115
+ });
116
+ _defineProperty(this, "onUploadStarted", (uploadUri, imageUri) => {
117
+ const imagesToUpload = [...this.state.imagesToUpload, {
118
+ uploading: true,
119
+ uploadProgress: '0%',
120
+ uploadUri,
121
+ imageUri,
122
+ allowRetry: true
123
+ }];
124
+ this.setState({
125
+ imagesToUpload
126
+ });
127
+ });
128
+ _defineProperty(this, "onUploadProgress", progress => {
129
+ const imagesToUpload = [...this.state.imagesToUpload];
130
+ imagesToUpload.map(img => {
131
+ if (img.uploadUri === progress.uri) {
132
+ img.uploadProgress = progress.percentage;
133
+ img.uploading = true;
134
+ img.allowRetry = true;
135
+ }
136
+ });
137
+ this.setState({
138
+ imagesToUpload
139
+ });
140
+ });
141
+ _defineProperty(this, "onUploadSuccess", async (uri, uploadUri) => {
142
+ const imagesToUpload = [...this.state.imagesToUpload];
143
+ imagesToUpload.map(img => {
144
+ if (img.uploadUri === uploadUri && img.uploading) {
145
+ img.url = uri.replace('/general/', '/general1400/');
146
+ img.thumbNailExists = false;
147
+ img.thumbNailUrl = getThumb300(img.url);
148
+ img.allowRetry = true;
149
+ }
150
+ });
151
+ this.setState({
152
+ imagesToUpload
153
+ }, () => this.waitForThumbnails());
154
+ });
155
+ _defineProperty(this, "onUploadFailed", uploadUri => {
156
+ const imagesToUpload = [...this.state.imagesToUpload];
157
+ imagesToUpload.map(img => {
158
+ if (img.uploadUri === uploadUri) {
159
+ img.uploading = true; // Requried for retry
160
+ img.uploadProgress = '';
161
+ img.allowRetry = true;
162
+ }
163
+ });
164
+ this.setState({
165
+ imagesToUpload
166
+ });
167
+ });
168
+ _defineProperty(this, "onLibrarySelected", uri => {
169
+ const imagesToUpload = [...this.state.imagesToUpload, {
170
+ uploading: false,
171
+ allowRetry: false,
172
+ url: get1400(uri),
173
+ thumbNailExists: true,
174
+ thumbNailUrl: getThumb300(uri)
175
+ }];
176
+ this.setState({
177
+ imagesToUpload
178
+ });
179
+ });
180
+ _defineProperty(this, "onPressImage", (images, selected) => {
181
+ this.setState({
182
+ imagePopupSource: images,
183
+ imagePopupIndex: images.indexOf(selected),
184
+ imagePopupOpen: true
185
+ });
186
+ });
187
+ _defineProperty(this, "onReply", message => {
188
+ this.setState({
189
+ replyingTo: message
190
+ });
191
+ });
192
+ _defineProperty(this, "onRemoveImage", url => {
193
+ const imagesToUpload = this.state.imagesToUpload.filter(image => image.url !== url);
194
+ this.setState({
195
+ imagesToUpload
196
+ });
197
+ });
198
+ _defineProperty(this, "toggleFullscreenVideo", url => {
199
+ if (typeof url !== 'string') url = '';
200
+ this.setState({
201
+ showFullscreenVideo: url.length > 0,
202
+ currentVideoUrl: url
203
+ });
204
+ });
205
+ const isSingleTab = this.props.tabCount === 1 && getBottomSpace() > 0;
206
+ this.MIN_COMPOSER_HEIGHT = Platform.select({
207
+ ios: isSingleTab ? 42 : 33,
208
+ android: 41
209
+ });
210
+ this.state = {
211
+ currentUser: {
212
+ _id: this.props.user.uid,
213
+ name: this.props.user.displayName,
214
+ avatar: !_.isUndefined(this.props.user.profilePic) && !_.isEmpty(this.props.user.profilePic) ? this.props.user.profilePic : Config.env.tinyChatDefault
215
+ },
216
+ messages: [],
217
+ imagePopupSource: [],
218
+ imagePopupIndex: 0,
219
+ imagePopupOpen: false,
220
+ imagesToUpload: [],
221
+ showFullscreenVideo: false,
222
+ currentVideoUrl: ''
223
+ };
224
+ this.checkThumb = null;
225
+ }
226
+ UNSAFE_componentWillMount() {
227
+ this.updateMessages(this.props);
228
+ }
229
+ UNSAFE_componentWillReceiveProps(nextProps) {
230
+ this.updateMessages(nextProps);
231
+ }
232
+ updateMessages(props) {
233
+ const newState = {};
234
+ if (!_.isUndefined(props.messages)) {
235
+ newState.messages = props.messages;
236
+ }
237
+ this.setState(newState);
238
+ }
239
+
240
+ /***
241
+ *
242
+ * Messaging functionality
243
+ */
244
+ onSend(messages = []) {
245
+ // if (this.chatKey) {
246
+ // this.sendMessage(messages[0]);
247
+ // }
248
+ }
249
+ showUploadMenu() {
250
+ this.imageUploader.showUploadMenu();
251
+ }
252
+ closeGallery() {
253
+ this.setState({
254
+ imagePopupSource: [],
255
+ imagePopupIndex: 0,
256
+ imagePopupOpen: false
257
+ });
258
+ }
259
+ sendMessages(messages) {
260
+ if (this.hasImagesAttached()) {
261
+ // Don't allow send if attached images aren't ready
262
+ if (!this.hasImagesReady()) return;
263
+ messages[0].image = this.state.imagesToUpload.map(image => image.url);
264
+ }
265
+ if (_.isEmpty(messages[0].text)) {
266
+ messages[0].text = '';
267
+ }
268
+ if (!messages[0].text && !messages[0].image) return;
269
+ if (this.state.replyingTo) {
270
+ messages[0].replyingTo = this.state.replyingTo;
271
+ }
272
+ this.props.onSend(messages);
273
+ this.setState({
274
+ imagesToUpload: [],
275
+ replyingTo: null
276
+ });
277
+ }
278
+
279
+ /**
280
+ *
281
+ * Render Functions
282
+ */
283
+ renderBubble(bubbleProps) {
284
+ const wrapperStyle = {};
285
+ if (!_.isEmpty(bubbleProps.currentMessage.text) && !_.isEmpty(bubbleProps.currentMessage.image)) {
286
+ wrapperStyle.paddingTop = 8;
287
+ wrapperStyle.paddingBottom = 16;
288
+ wrapperStyle.minWidth = 142; // 110 image width + 16 padding either side
289
+ }
290
+
291
+ if (!_.isEmpty(bubbleProps.currentMessage.attachments)) {
292
+ wrapperStyle.paddingTop = 8;
293
+ wrapperStyle.paddingBottom = 16;
294
+ wrapperStyle.paddingHorizontal = 16;
295
+ }
296
+ return /*#__PURE__*/React.createElement(Bubble, _extends({}, bubbleProps, {
297
+ renderMessageImage: () => null,
298
+ isCustomViewBottom: true,
299
+ wrapperStyle: {
300
+ left: {
301
+ backgroundColor: LINEGREY,
302
+ borderRadius: 25,
303
+ ...wrapperStyle
304
+ },
305
+ right: {
306
+ backgroundColor: this.props.colourBrandingLight,
307
+ borderRadius: 25,
308
+ ...wrapperStyle
309
+ }
310
+ },
311
+ containerToNextStyle: {
312
+ left: {
313
+ borderBottomLeftRadius: 5
314
+ },
315
+ right: {
316
+ borderBottomRightRadius: 5
317
+ }
318
+ },
319
+ containerToPreviousStyle: {
320
+ left: {
321
+ borderTopLeftRadius: 5
322
+ },
323
+ right: {
324
+ borderTopRightRadius: 5
325
+ }
326
+ }
327
+ }));
328
+ }
329
+ renderMessage(props) {
330
+ return /*#__PURE__*/React.createElement(PlussChatMessage, _extends({
331
+ key: props.RowId,
332
+ colourBrandingMain: this.props.colourBrandingMain,
333
+ onPressReply: () => {
334
+ this.onReply(props.currentMessage);
335
+ }
336
+ }, props));
337
+ }
338
+ renderMessageText(messageTextProps) {
339
+ return /*#__PURE__*/React.createElement(MessageText, _extends({}, messageTextProps, {
340
+ textStyle: {
341
+ left: {
342
+ fontFamily: 'sf-regular',
343
+ fontSize: 16,
344
+ color: TEXT_DARKEST,
345
+ marginTop: 10,
346
+ marginBottom: 10,
347
+ marginLeft: 15,
348
+ marginRight: 15
349
+ },
350
+ right: {
351
+ fontFamily: 'sf-regular',
352
+ fontSize: 16,
353
+ color: this.props.colourBrandingMain,
354
+ marginTop: 10,
355
+ marginBottom: 10,
356
+ marginLeft: 15,
357
+ marginRight: 15
358
+ }
359
+ },
360
+ linkStyle: {
361
+ left: {
362
+ color: TEXT_DARKEST
363
+ },
364
+ right: {
365
+ color: this.props.colourBrandingMain
366
+ }
367
+ }
368
+ }));
369
+ }
370
+ renderTime() {
371
+ return null;
372
+ }
373
+ renderDay(dayProps) {
374
+ return /*#__PURE__*/React.createElement(PlussChatTime, _extends({}, dayProps, {
375
+ textStyle: {
376
+ fontFamily: 'sf-semibold',
377
+ color: TEXT_DARK,
378
+ fontSize: 12
379
+ }
380
+ }));
381
+ }
382
+ renderCustomView({
383
+ currentMessage,
384
+ position
385
+ }) {
386
+ if (currentMessage.image) {
387
+ const images = typeof currentMessage.image === 'string' ? [currentMessage.image] : currentMessage.image;
388
+ const containerWidth = (() => {
389
+ if (images.length === 0) return 0;
390
+ if (images.length === 1) return IMAGE_SIZE_LARGE;
391
+ if (images.length <= IMAGES_PER_ROW) return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * images.length;
392
+ return (IMAGE_SIZE_SMALL + IMAGE_MARGIN) * IMAGES_PER_ROW;
393
+ })();
394
+ return /*#__PURE__*/React.createElement(View, {
395
+ style: [styles.imagesContainer, {
396
+ width: containerWidth,
397
+ paddingVertical: currentMessage.text ? 0 : 20
398
+ }]
399
+ }, images.map(img => {
400
+ const thumb = getThumb300(img);
401
+ if (isVideo(img)) {
402
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
403
+ key: thumb,
404
+ onPress: this.toggleFullscreenVideo.bind(this, img)
405
+ }, /*#__PURE__*/React.createElement(ImageBackground, {
406
+ style: images.length > 1 ? styles.messageImageSmall : styles.messageImageLarge,
407
+ source: {
408
+ uri: thumb
409
+ }
410
+ }, /*#__PURE__*/React.createElement(View, {
411
+ style: styles.imagePlayContainer
412
+ }, /*#__PURE__*/React.createElement(Icon, {
413
+ name: "play",
414
+ type: "font-awesome",
415
+ iconStyle: styles.imageControlIcon
416
+ }))));
417
+ }
418
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
419
+ key: thumb,
420
+ onPress: () => this.onPressImage(images, img)
421
+ }, /*#__PURE__*/React.createElement(Image, {
422
+ source: {
423
+ uri: thumb
424
+ },
425
+ style: images.length > 1 ? styles.messageImageSmall : styles.messageImageLarge
426
+ }));
427
+ }));
428
+ }
429
+ if (!_.isEmpty(currentMessage.attachments)) {
430
+ return /*#__PURE__*/React.createElement(View, null, currentMessage.attachments.map((url, i) => {
431
+ return /*#__PURE__*/React.createElement(Attachment, {
432
+ onPress: () => {
433
+ this.onOpenAttachment(url);
434
+ },
435
+ key: i,
436
+ title: getFileName(url)
437
+ });
438
+ }));
439
+ }
440
+ if (currentMessage.event) {
441
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
442
+ onPress: this.onPressEvent.bind(this, currentMessage.event)
443
+ }, /*#__PURE__*/React.createElement(View, {
444
+ style: styles.eventContainer[position]
445
+ }, /*#__PURE__*/React.createElement(Image, {
446
+ style: [styles.eventImage, styles.eventImageMargin[position]],
447
+ source: {
448
+ uri: currentMessage.event.Thumbnail
449
+ }
450
+ }), /*#__PURE__*/React.createElement(View, {
451
+ style: styles.eventInfo
452
+ }, /*#__PURE__*/React.createElement(Text, {
453
+ numberOfLines: 3,
454
+ style: [styles.eventTitle, styles.eventInfoAlign[position], {
455
+ color: this.props.colourBrandingMain
456
+ }]
457
+ }, currentMessage.event.Title), /*#__PURE__*/React.createElement(Text, {
458
+ style: [styles.eventDate, styles.eventInfoAlign[position], {
459
+ color: this.props.colourBrandingMain
460
+ }]
461
+ }, moment.utc(currentMessage.event.StartTime).local().format('ddd D MMM')))));
462
+ }
463
+ if (currentMessage.attachment) {
464
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
465
+ onPress: this.onPressAttachment.bind(this, currentMessage.attachment)
466
+ }, /*#__PURE__*/React.createElement(View, {
467
+ style: styles.eventContainer[position]
468
+ }, /*#__PURE__*/React.createElement(Image, {
469
+ style: [styles.eventImage, styles.eventImageMargin[position]],
470
+ source: {
471
+ uri: currentMessage.attachment.Thumbnail
472
+ }
473
+ }), /*#__PURE__*/React.createElement(View, {
474
+ style: styles.eventInfo
475
+ }, /*#__PURE__*/React.createElement(Text, {
476
+ numberOfLines: 3,
477
+ style: [styles.eventTitle, styles.eventInfoAlign[position], {
478
+ color: this.props.colourBrandingMain
479
+ }]
480
+ }, currentMessage.attachment.Title), currentMessage.attachment.StartTime && /*#__PURE__*/React.createElement(Text, {
481
+ style: [styles.eventDate, styles.eventInfoAlign[position], {
482
+ color: this.props.colourBrandingMain
483
+ }]
484
+ }, moment.utc(currentMessage.attachment.StartTime).local().format('ddd D MMM')))));
485
+ }
486
+ return null;
487
+ }
488
+ renderSend(props) {
489
+ return /*#__PURE__*/React.createElement(View, {
490
+ style: [{
491
+ position: 'absolute',
492
+ top: 0,
493
+ right: 0
494
+ }, !!this.state.replyingTo && {
495
+ marginTop: 38
496
+ }]
497
+ }, (!_.isEmpty(props.text) || this.hasImagesReady(props.imagesToUpload)) && /*#__PURE__*/React.createElement(Send, _extends({}, props, {
498
+ alwaysShowSend: true,
499
+ containerStyle: [styles.sendContainer, {
500
+ width: this.MIN_COMPOSER_HEIGHT,
501
+ height: this.MIN_COMPOSER_HEIGHT
502
+ }]
503
+ }), /*#__PURE__*/React.createElement(Icon, {
504
+ name: 'paper-plane',
505
+ type: "font-awesome",
506
+ iconStyle: [styles.send, {
507
+ width: this.MIN_COMPOSER_HEIGHT
508
+ }]
509
+ })), /*#__PURE__*/React.createElement(TouchableOpacity, {
510
+ onPress: this.showUploadMenu.bind(this),
511
+ style: [styles.sendContainer, {
512
+ right: _.isEmpty(props.text) && !this.hasImagesReady(props.imagesToUpload) ? 0 : 8 + this.MIN_COMPOSER_HEIGHT,
513
+ width: this.MIN_COMPOSER_HEIGHT,
514
+ height: this.MIN_COMPOSER_HEIGHT
515
+ }]
516
+ }, /*#__PURE__*/React.createElement(Icon, {
517
+ name: 'picture-o',
518
+ type: "font-awesome",
519
+ iconStyle: [styles.send, {
520
+ width: this.MIN_COMPOSER_HEIGHT
521
+ }]
522
+ })));
523
+ }
524
+ renderAccessory(props) {
525
+ const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
526
+ if (!hasAttachment) {
527
+ return null;
528
+ }
529
+ return /*#__PURE__*/React.createElement(ScrollView, {
530
+ horizontal: true,
531
+ style: styles.uploadImagesContainer
532
+ }, props.imagesToUpload.map(image => {
533
+ if (image.uploading) {
534
+ return /*#__PURE__*/React.createElement(ImageUploadProgress, {
535
+ key: image.uploadUri,
536
+ uploader: this.imageUploader,
537
+ image: image,
538
+ color: this.props.colourBrandingMain,
539
+ style: {
540
+ width: IMAGE_PREVIEW_SIZE,
541
+ marginRight: 10
542
+ },
543
+ progressTextStyle: {
544
+ fontSize: 10
545
+ }
546
+ });
547
+ }
548
+ const isVideoUrl = isVideo(image.url);
549
+ return /*#__PURE__*/React.createElement(View, {
550
+ key: image.url,
551
+ style: styles.accessoryImageContainer
552
+ }, /*#__PURE__*/React.createElement(ImageBackground, {
553
+ style: styles.accessoryImage,
554
+ imageStyle: styles.accessoryImageBorder,
555
+ source: getImageSource(image.thumbNailExists ? image.thumbNailUrl : image.url)
556
+ }, isVideoUrl && /*#__PURE__*/React.createElement(View, {
557
+ style: styles.imagePlayContainer
558
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
559
+ onPress: this.toggleFullscreenVideo.bind(this, image.url)
560
+ }, /*#__PURE__*/React.createElement(Icon, {
561
+ name: "play",
562
+ type: "font-awesome",
563
+ iconStyle: styles.imageControlIcon
564
+ })))), /*#__PURE__*/React.createElement(TouchableOpacity, {
565
+ style: styles.previewItemRemoveButton,
566
+ onPress: () => this.onRemoveImage(image.url),
567
+ hitSlop: {
568
+ top: 8,
569
+ right: 8,
570
+ bottom: 8,
571
+ left: 8
572
+ }
573
+ }, /*#__PURE__*/React.createElement(View, {
574
+ style: [styles.previewItemRemoveContainer, {
575
+ backgroundColor: this.props.colourBrandingMain
576
+ }]
577
+ }, /*#__PURE__*/React.createElement(Icon, {
578
+ name: "times",
579
+ type: "font-awesome",
580
+ iconStyle: styles.previewItemRemoveIcon
581
+ }))));
582
+ }));
583
+ }
584
+ renderInputToolbar(props) {
585
+ const hasAttachment = this.hasImagesAttached(props.imagesToUpload);
586
+ return /*#__PURE__*/React.createElement(InputToolbar, _extends({}, props, {
587
+ containerStyle: styles.inputContainer,
588
+ renderComposer: this.renderComposer.bind(this),
589
+ renderAccessory: hasAttachment ? this.renderAccessory.bind(this) : null,
590
+ accessoryStyle: hasAttachment && styles.accessory
591
+ }));
592
+ }
593
+ renderFooter() {
594
+ // if (this.state.keyboardOpen) {
595
+ // return null;
596
+ // }
597
+ // fixes an issue where there's no gap between bottom message and reply container
598
+ return /*#__PURE__*/React.createElement(View, {
599
+ style: {
600
+ height: 10
601
+ }
602
+ });
603
+ }
604
+ renderLoading() {
605
+ return /*#__PURE__*/React.createElement(View, {
606
+ style: {
607
+ marginTop: 15,
608
+ justifyContent: 'center',
609
+ alignContent: 'center'
610
+ }
611
+ }, /*#__PURE__*/React.createElement(Spinner, {
612
+ size: 'small',
613
+ color: this.props.colourBrandingMain
614
+ }));
615
+ }
616
+ renderAvatar(props) {
617
+ return /*#__PURE__*/React.createElement(View, {
618
+ style: {
619
+ marginRight: 2
620
+ }
621
+ }, /*#__PURE__*/React.createElement(ProfilePic, {
622
+ ProfilePic: props.currentMessage.user.avatar,
623
+ Diameter: 28
624
+ }));
625
+ }
626
+ renderComposer(props) {
627
+ var _this$state$replyingT, _this$state$replyingT2;
628
+ return /*#__PURE__*/React.createElement(View, {
629
+ style: styles.composerContainer
630
+ }, this.state.replyingTo && /*#__PURE__*/React.createElement(View, {
631
+ style: styles.replyingTo
632
+ }, /*#__PURE__*/React.createElement(TextStyle, {
633
+ type: "body"
634
+ }, "Replying to ", _.isEmpty((_this$state$replyingT = this.state.replyingTo) === null || _this$state$replyingT === void 0 || (_this$state$replyingT = _this$state$replyingT.user) === null || _this$state$replyingT === void 0 ? void 0 : _this$state$replyingT.name) ? 'message' : (_this$state$replyingT2 = this.state.replyingTo) === null || _this$state$replyingT2 === void 0 || (_this$state$replyingT2 = _this$state$replyingT2.user) === null || _this$state$replyingT2 === void 0 ? void 0 : _this$state$replyingT2.name), /*#__PURE__*/React.createElement(TouchableOpacity, {
635
+ style: styles.replyingRemoveButton,
636
+ onPress: () => this.onReply(null),
637
+ hitSlop: {
638
+ top: 8,
639
+ right: 8,
640
+ bottom: 8,
641
+ left: 8
642
+ }
643
+ }, /*#__PURE__*/React.createElement(View, {
644
+ style: [styles.replyingRemoveContainer, {
645
+ backgroundColor: this.props.colourBrandingMain
646
+ }]
647
+ }, /*#__PURE__*/React.createElement(Icon, {
648
+ name: "times",
649
+ type: "font-awesome",
650
+ iconStyle: styles.replyingRemoveIcon
651
+ })))), /*#__PURE__*/React.createElement(View, {
652
+ style: styles.composerInputWrapper
653
+ }, /*#__PURE__*/React.createElement(View, {
654
+ style: [styles.input, {
655
+ //height: props.composerHeight + 10,
656
+ //borderRadius: (this.MIN_COMPOSER_HEIGHT + 10) / 2,
657
+ marginRight: _.isEmpty(props.text) && !this.hasImagesReady(props.imagesToUpload) ? 8 + this.MIN_COMPOSER_HEIGHT : 2 * (this.MIN_COMPOSER_HEIGHT + 8),
658
+ justifyContent: 'center'
659
+ }, Platform.OS === 'ios' && {
660
+ height: props.composerHeight + 10
661
+ }]
662
+ }, /*#__PURE__*/React.createElement(Composer, _extends({}, props, {
663
+ //composerHeight={props.composerHeight}
664
+ placeholder: "Type a message...",
665
+ textInputStyle: styles.inputText,
666
+ textInputProps: {
667
+ onFocus: this.onFocusInput.bind(this),
668
+ onBlur: this.onBlurInput.bind(this)
669
+ }
670
+ })))));
671
+ }
672
+
673
+ /***
674
+ * Main Render
675
+ */
676
+ renderChat() {
677
+ const {
678
+ tabCount,
679
+ noTab
680
+ } = this.props;
681
+ const iosBottomOffset = (tabCount === 1 || noTab ? -10 : 52) + getBottomSpace();
682
+ const minInputToolbarHeight = this.MIN_COMPOSER_HEIGHT + 16 + (this.state.replyingTo ? 30 : 0) + (this.hasImagesAttached() ? IMAGE_PREVIEW_AREA_HEIGHT : 0);
683
+ return /*#__PURE__*/React.createElement(GiftedChat, {
684
+ alwaysShowSend: false,
685
+ keyboardShouldPersistTaps: 'never',
686
+ renderAvatarOnTop: true,
687
+ minInputToolbarHeight: minInputToolbarHeight,
688
+ bottomOffset: Platform.OS === 'android' ? 0 : iosBottomOffset,
689
+ onSend: this.sendMessages.bind(this),
690
+ messages: this.state.messages,
691
+ user: this.state.currentUser,
692
+ renderBubble: this.renderBubble.bind(this),
693
+ renderMessage: this.renderMessage.bind(this),
694
+ renderMessageText: this.renderMessageText.bind(this),
695
+ renderTime: this.renderTime.bind(this),
696
+ renderDay: this.renderDay.bind(this),
697
+ renderCustomView: this.renderCustomView.bind(this),
698
+ renderSend: this.renderSend.bind(this),
699
+ renderInputToolbar: this.renderInputToolbar.bind(this),
700
+ renderFooter: this.renderFooter.bind(this),
701
+ renderLoading: this.renderLoading.bind(this),
702
+ renderAvatar: this.renderAvatar.bind(this),
703
+ imagesToUpload: this.state.imagesToUpload
704
+ });
705
+ }
706
+ renderImageUploader() {
707
+ return /*#__PURE__*/React.createElement(ImageUploader, {
708
+ ref: ref => this.imageUploader = ref,
709
+ onUploadStarted: this.onUploadStarted,
710
+ onUploadProgress: this.onUploadProgress,
711
+ onUploadSuccess: this.onUploadSuccess,
712
+ onUploadFailed: this.onUploadFailed,
713
+ onLibrarySelected: this.onLibrarySelected,
714
+ quality: 0.8,
715
+ allowsEditing: false,
716
+ fileName: 'imageInput',
717
+ popupTitle: 'Add Image',
718
+ userId: this.props.user.uid,
719
+ multiple: true,
720
+ allowVideo: true
721
+ });
722
+ }
723
+ renderImagePopup() {
724
+ const {
725
+ imagePopupOpen,
726
+ imagePopupSource,
727
+ imagePopupIndex
728
+ } = this.state;
729
+ return /*#__PURE__*/React.createElement(ImagePopup, {
730
+ visible: imagePopupOpen,
731
+ images: imagePopupSource,
732
+ index: imagePopupIndex,
733
+ onClose: this.closeGallery.bind(this),
734
+ ref: "imagePopup"
735
+ });
736
+ }
737
+ renderVideoPlayerPopup() {
738
+ const {
739
+ showFullscreenVideo,
740
+ currentVideoUrl
741
+ } = this.state;
742
+ if (!currentVideoUrl) return;
743
+ return /*#__PURE__*/React.createElement(VideoPopup, {
744
+ uri: currentVideoUrl,
745
+ visible: showFullscreenVideo,
746
+ onClose: this.toggleFullscreenVideo
747
+ });
748
+ }
749
+ renderPDF() {
750
+ if (_.isEmpty(this.state.selectedPDF)) {
751
+ return null;
752
+ }
753
+ return /*#__PURE__*/React.createElement(PDFPopup, {
754
+ source: this.state.selectedPDF,
755
+ onClose: this.onCloseAttachment,
756
+ title: getFileName(this.state.selectedPDF),
757
+ pdfCount: 1
758
+ });
759
+ }
760
+ render() {
761
+ if (Platform.OS === 'android' && !this.props.noAndroidAvoid) {
762
+ return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
763
+ behavior: Platform.OS === 'ios' && 'padding',
764
+ style: styles.chatContainer
765
+ }, this.renderChat(), this.renderImageUploader(), this.renderImagePopup(), this.renderVideoPlayerPopup(), this.renderPDF());
766
+ }
767
+ return /*#__PURE__*/React.createElement(View, {
768
+ style: styles.chatContainer
769
+ }, this.renderChat(), this.renderImageUploader(), this.renderImagePopup(), this.renderVideoPlayerPopup(), this.renderPDF());
770
+ }
771
+ }
772
+ const styles = {
773
+ chatContainer: {
774
+ flex: 1,
775
+ justifyContent: 'center'
776
+ },
777
+ eventContainer: {
778
+ left: {
779
+ paddingTop: 5,
780
+ paddingLeft: 15,
781
+ paddingRight: 15,
782
+ paddingBottom: 5,
783
+ flexDirection: 'row'
784
+ },
785
+ right: {
786
+ paddingTop: 5,
787
+ paddingLeft: 15,
788
+ paddingRight: 15,
789
+ paddingBottom: 5,
790
+ flexDirection: 'row-reverse'
791
+ }
792
+ },
793
+ eventImage: {
794
+ width: 80,
795
+ height: 80,
796
+ resizeMode: 'cover',
797
+ borderRadius: 2
798
+ },
799
+ eventImageMargin: {
800
+ right: {
801
+ marginLeft: 15
802
+ },
803
+ left: {
804
+ marginRight: 15
805
+ }
806
+ },
807
+ eventInfo: {
808
+ minHeight: 80,
809
+ width: 150
810
+ },
811
+ eventTitle: {
812
+ fontSize: 12,
813
+ fontFamily: 'sf-bold',
814
+ backgroundColor: 'rgba(255,255,255,0)'
815
+ },
816
+ eventInfoAlign: {
817
+ left: {
818
+ textAlign: 'left'
819
+ },
820
+ right: {
821
+ textAlign: 'right'
822
+ }
823
+ },
824
+ messageImageLarge: {
825
+ width: IMAGE_SIZE_LARGE,
826
+ height: IMAGE_SIZE_LARGE,
827
+ borderRadius: 2,
828
+ alignSelf: 'center'
829
+ },
830
+ messageImageSmall: {
831
+ width: IMAGE_SIZE_SMALL,
832
+ height: IMAGE_SIZE_SMALL,
833
+ borderRadius: 2,
834
+ alignSelf: 'center',
835
+ marginRight: IMAGE_MARGIN,
836
+ marginBottom: IMAGE_MARGIN
837
+ },
838
+ eventDate: {
839
+ fontSize: 12,
840
+ fontFamily: 'sf-regular',
841
+ backgroundColor: 'rgba(255,255,255,0)'
842
+ },
843
+ inputContainer: {
844
+ backgroundColor: '#fff',
845
+ paddingVertical: 8,
846
+ paddingHorizontal: 8
847
+ },
848
+ inputText: {
849
+ color: TEXT_DARKEST,
850
+ fontSize: 14,
851
+ fontFamily: 'sf-medium'
852
+ },
853
+ input: {
854
+ margin: 0,
855
+ backgroundColor: BG_GREY,
856
+ borderRadius: 5,
857
+ flex: 1
858
+ },
859
+ composerContainer: {
860
+ flex: 1
861
+ },
862
+ composerInputWrapper: {
863
+ flex: 1,
864
+ flexDirection: 'row'
865
+ },
866
+ replyingTo: {
867
+ minHeight: 30,
868
+ flexDirection: 'row',
869
+ alignItems: 'center',
870
+ borderBottomWidth: 1,
871
+ borderBottomColor: LINEGREY,
872
+ marginBottom: 8
873
+ },
874
+ replyingRemoveButton: {
875
+ marginLeft: 10
876
+ },
877
+ replyingRemoveContainer: {
878
+ justifyContent: 'center',
879
+ alignItems: 'center',
880
+ borderRadius: 10,
881
+ width: 20,
882
+ height: 20,
883
+ borderWidth: 2,
884
+ borderColor: '#fff'
885
+ },
886
+ replyingRemoveIcon: {
887
+ fontSize: 10,
888
+ color: '#fff',
889
+ marginBottom: 1
890
+ },
891
+ sendContainer: {
892
+ position: 'absolute',
893
+ top: 0,
894
+ right: 0,
895
+ height: 30,
896
+ width: 30,
897
+ alignItems: 'center',
898
+ justifyContent: 'center',
899
+ backgroundColor: '#fff'
900
+ },
901
+ send: {
902
+ fontSize: 15,
903
+ color: TEXT_BLUEGREY,
904
+ fontSize: 24,
905
+ textAlign: 'center'
906
+ },
907
+ accessory: {
908
+ height: IMAGE_PREVIEW_AREA_HEIGHT,
909
+ borderTopWidth: 1,
910
+ borderTopColor: LINEGREY,
911
+ paddingTop: 8,
912
+ marginTop: 8
913
+ },
914
+ accessoryImageContainer: {
915
+ paddingRight: 8,
916
+ paddingTop: 8,
917
+ marginRight: 5
918
+ },
919
+ accessoryImage: {
920
+ width: IMAGE_PREVIEW_SIZE,
921
+ height: IMAGE_PREVIEW_SIZE
922
+ },
923
+ accessoryImageBorder: {
924
+ borderRadius: 2
925
+ },
926
+ settingDropDownOpen: {
927
+ height: 'auto'
928
+ },
929
+ imagesContainer: {
930
+ marginLeft: 10,
931
+ marginRight: 10,
932
+ flexDirection: 'row',
933
+ flexWrap: 'wrap'
934
+ },
935
+ uploadImagesContainer: {
936
+ flexDirection: 'row',
937
+ overflow: 'visible'
938
+ },
939
+ previewItemRemoveButton: {
940
+ position: 'absolute',
941
+ top: 0,
942
+ right: 0
943
+ },
944
+ previewItemRemoveContainer: {
945
+ justifyContent: 'center',
946
+ alignItems: 'center',
947
+ borderRadius: 10,
948
+ width: 20,
949
+ height: 20,
950
+ borderWidth: 2,
951
+ borderColor: '#fff'
952
+ },
953
+ previewItemRemoveIcon: {
954
+ fontSize: 10,
955
+ color: '#fff',
956
+ marginBottom: 1
957
+ },
958
+ imagePlayContainer: {
959
+ position: 'absolute',
960
+ top: 0,
961
+ left: 0,
962
+ right: 0,
963
+ bottom: 0,
964
+ alignItems: 'center',
965
+ justifyContent: 'center'
966
+ },
967
+ imageControlIcon: {
968
+ color: '#fff',
969
+ fontSize: 20,
970
+ textShadowColor: 'rgba(0,0,0,0.3)',
971
+ textShadowOffset: {
972
+ width: 2,
973
+ height: 2
974
+ }
975
+ }
976
+ };
977
+ const mapStateToProps = state => {
978
+ return {
979
+ user: state.user,
980
+ colourBrandingMain: getMainBrandingColourFromState(state),
981
+ colourBrandingLight: getLightBrandingColourFromState(state),
982
+ tabCount: getEnabledTabsFromState(state).length
983
+ };
984
+ };
985
+ export default connect(mapStateToProps, {})(PlussChat);
986
+ //# sourceMappingURL=PlussChat.js.map