@plusscommunities/pluss-maintenance-app 1.1.13 → 1.2.1

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 (45) hide show
  1. package/dist/module/actions/JobActions.js +14 -0
  2. package/dist/module/actions/JobActions.js.map +1 -0
  3. package/dist/module/actions/index.js +2 -0
  4. package/dist/module/actions/index.js.map +1 -0
  5. package/dist/module/actions/types.js +3 -0
  6. package/dist/module/actions/types.js.map +1 -0
  7. package/dist/module/apis/generalActions.js +145 -0
  8. package/dist/module/apis/generalActions.js.map +1 -0
  9. package/dist/module/apis/index.js +2 -0
  10. package/dist/module/apis/index.js.map +1 -0
  11. package/dist/module/components/MaintenanceList.js +240 -0
  12. package/dist/module/components/MaintenanceList.js.map +1 -0
  13. package/dist/module/components/MaintenanceListItem.js +282 -0
  14. package/dist/module/components/MaintenanceListItem.js.map +1 -0
  15. package/dist/module/components/MaintenanceWidgetItem.js +161 -0
  16. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -0
  17. package/dist/module/components/StatusSelectorPopup.js +93 -0
  18. package/dist/module/components/StatusSelectorPopup.js.map +1 -0
  19. package/dist/module/components/WidgetLarge.js +12 -0
  20. package/dist/module/components/WidgetLarge.js.map +1 -0
  21. package/dist/module/components/WidgetSmall.js +185 -0
  22. package/dist/module/components/WidgetSmall.js.map +1 -0
  23. package/dist/module/core.config.js +17 -0
  24. package/dist/module/core.config.js.map +1 -0
  25. package/dist/module/feature.config.js +91 -0
  26. package/dist/module/feature.config.js.map +1 -0
  27. package/dist/module/helper.js +28 -0
  28. package/dist/module/helper.js.map +1 -0
  29. package/dist/module/images/speechbubble.png +0 -0
  30. package/dist/module/index.js +20 -0
  31. package/dist/module/index.js.map +1 -0
  32. package/dist/module/reducers/JobsReducer.js +59 -0
  33. package/dist/module/reducers/JobsReducer.js.map +1 -0
  34. package/dist/module/screens/JobTypePicker.js +139 -0
  35. package/dist/module/screens/JobTypePicker.js.map +1 -0
  36. package/dist/module/screens/MaintenancePage.js +99 -0
  37. package/dist/module/screens/MaintenancePage.js.map +1 -0
  38. package/dist/module/screens/RequestDetail.js +839 -0
  39. package/dist/module/screens/RequestDetail.js.map +1 -0
  40. package/dist/module/screens/RequestNotes.js +420 -0
  41. package/dist/module/screens/RequestNotes.js.map +1 -0
  42. package/dist/module/screens/ServiceRequest.js +803 -0
  43. package/dist/module/screens/ServiceRequest.js.map +1 -0
  44. package/package.json +27 -14
  45. package/src/screens/RequestDetail.js +1 -0
@@ -0,0 +1,839 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import React, { Component } from 'react';
4
+ import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground } from 'react-native';
5
+ import DateTimePicker from 'react-native-modal-datetime-picker';
6
+ import { Icon } from 'react-native-elements';
7
+ import _ from 'lodash';
8
+ import moment from 'moment';
9
+ import { connect } from 'react-redux';
10
+ import { generalActions } from '../apis';
11
+ import { jobAdded } from '../actions';
12
+ import StatusSelectorPopup from '../components/StatusSelectorPopup';
13
+ import { jobStatusOptions, getJobStatusProps } from '../helper';
14
+ import { Services } from '../feature.config';
15
+ import { Colours, Helper, Components, Config } from '../core.config';
16
+
17
+ class RequestDetail extends Component {
18
+ constructor(props) {
19
+ super(props);
20
+
21
+ _defineProperty(this, "markSeen", () => {
22
+ const {
23
+ user
24
+ } = this.props;
25
+ const {
26
+ job
27
+ } = this.state; // Must have maintenance permission and not the requester
28
+ // console.log('markSeen check', job.userID, user.Id);
29
+
30
+ if (job.seen === true) return;
31
+ if (!this.hasPermission()) return;
32
+ if (user.Id === job.userID) return;
33
+ this.setState({
34
+ loading: true
35
+ }, async () => {
36
+ try {
37
+ const updated = {
38
+ id: job.id,
39
+ seen: true,
40
+ status: job.status || 'Unassigned'
41
+ };
42
+ const res = await generalActions.editJob(updated, user.site); // console.log('markSeen updated');
43
+
44
+ this.props.jobAdded(res.data.job);
45
+ this.setState({
46
+ loading: false,
47
+ seen: true
48
+ });
49
+ } catch (error) {
50
+ console.log('markSeen error', error);
51
+ this.setState({
52
+ loading: false
53
+ });
54
+ }
55
+ });
56
+ });
57
+
58
+ _defineProperty(this, "updateJob", () => {
59
+ this.setState({
60
+ loading: true
61
+ }, async () => {
62
+ const {
63
+ user
64
+ } = this.props;
65
+ const {
66
+ job
67
+ } = this.state;
68
+
69
+ try {
70
+ const updated = {
71
+ id: job.id
72
+ };
73
+
74
+ if (this.state.expectedDate) {
75
+ updated.expectedDate = moment(this.state.expectedDate).utc().toISOString();
76
+ }
77
+
78
+ const res = await generalActions.editJob(updated, user.site);
79
+ this.props.jobAdded(res.data.job);
80
+ } catch (error) {
81
+ console.log('updateJob error', error);
82
+ } finally {
83
+ this.setState({
84
+ loading: false
85
+ });
86
+ }
87
+ });
88
+ });
89
+
90
+ _defineProperty(this, "updateJobStatus", () => {
91
+ this.setState({
92
+ loading: true
93
+ }, async () => {
94
+ try {
95
+ const res = await generalActions.editJobStatus(this.props.job.id, this.state.status);
96
+ this.props.jobAdded(res.data.job);
97
+ } catch (error) {
98
+ console.log('updateJobStatus error', error);
99
+ } finally {
100
+ this.setState({
101
+ loading: false
102
+ });
103
+ }
104
+ });
105
+ });
106
+
107
+ _defineProperty(this, "onPressBack", () => {
108
+ Services.navigation.goBack();
109
+ });
110
+
111
+ _defineProperty(this, "onOpenStatusPicker", () => {
112
+ this.setState({
113
+ showStatusPopup: true
114
+ });
115
+ });
116
+
117
+ _defineProperty(this, "onCloseStatusPopup", () => {
118
+ this.setState({
119
+ showStatusPopup: false
120
+ });
121
+ });
122
+
123
+ _defineProperty(this, "onSelectStatus", status => {
124
+ this.setState({
125
+ status,
126
+ showStatusPopup: false
127
+ }, () => {
128
+ this.updateJobStatus();
129
+ });
130
+ });
131
+
132
+ _defineProperty(this, "openStaffNotes", () => {
133
+ Services.navigation.navigate('requestNotes', {
134
+ job: this.state.job
135
+ });
136
+ });
137
+
138
+ _defineProperty(this, "onOpenDatePicker", () => {
139
+ this.setState({
140
+ popUpType: 'date',
141
+ isDateTimePickerVisible: true
142
+ });
143
+ });
144
+
145
+ _defineProperty(this, "onCloseDatePicker", () => {
146
+ this.setState({
147
+ isDateTimePickerVisible: false
148
+ });
149
+ });
150
+
151
+ _defineProperty(this, "onDateSelected", date => {
152
+ if (this.state.popUpType === 'date') {
153
+ date = moment(date);
154
+ this.setState({
155
+ expectedDate: date,
156
+ expectedDateText: date.format('DD/MM/YYYY'),
157
+ isDateTimePickerVisible: false
158
+ }, () => {
159
+ this.updateJob();
160
+ });
161
+ }
162
+ });
163
+
164
+ _defineProperty(this, "onToggleDetails", () => {
165
+ this.setState({
166
+ showMore: !this.state.showMore
167
+ });
168
+ });
169
+
170
+ _defineProperty(this, "onLeaveMessage", () => {
171
+ this.setState({
172
+ showMessages: true
173
+ });
174
+ });
175
+
176
+ _defineProperty(this, "onCommentsLoaded", count => {
177
+ if (count > 0) {
178
+ this.setState({
179
+ showMessages: true
180
+ });
181
+ }
182
+ });
183
+
184
+ _defineProperty(this, "onCommentAdded", () => {
185
+ this.setState({
186
+ loading: true
187
+ }, async () => {
188
+ try {
189
+ const job = await generalActions.getJob(this.props.user.site, this.props.job.id); // console.log('onCommentAdded', job?.data);
190
+
191
+ this.props.jobAdded(job.data);
192
+ } catch (error) {
193
+ console.log('onCommentAdded error', error);
194
+ } finally {
195
+ this.setState({
196
+ loading: false
197
+ });
198
+ }
199
+ });
200
+ });
201
+
202
+ _defineProperty(this, "hasPermission", () => {
203
+ const {
204
+ permissions
205
+ } = this.props.user;
206
+ return _.includes(permissions, 'maintenanceTracking');
207
+ });
208
+
209
+ _defineProperty(this, "toggleFullscreenVideo", url => {
210
+ if (typeof url !== 'string') url = '';
211
+ this.setState({
212
+ showFullscreenVideo: url.length > 0,
213
+ currentVideoUrl: url
214
+ });
215
+ });
216
+
217
+ this.state = {
218
+ job: {},
219
+ isDateTimePickerVisible: false,
220
+ popUpType: '',
221
+ status: '',
222
+ expectedDate: null,
223
+ expectedDateText: '',
224
+ seen: false,
225
+ showMore: false,
226
+ showStatusPopup: false,
227
+ loading: false,
228
+ showFullscreenVideo: false,
229
+ currentVideoUrl: '',
230
+ galleryOpen: false,
231
+ showMessages: false
232
+ };
233
+ }
234
+
235
+ componentDidMount() {
236
+ this.updateJobState();
237
+ }
238
+
239
+ componentDidUpdate(prevProps) {
240
+ if (prevProps.jobs !== this.props.jobs) {
241
+ this.updateJobState();
242
+ }
243
+ }
244
+
245
+ updateJobState() {
246
+ const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || this.props.job;
247
+ const newState = {
248
+ job,
249
+ status: job.status
250
+ };
251
+
252
+ if (job.expectedDate) {
253
+ newState.expectedDate = moment(job.expectedDate);
254
+ newState.expectedDateText = newState.expectedDate.format('DD/MM/YYYY');
255
+ }
256
+
257
+ if (job.seen) newState.seen = job.seen;
258
+ this.setState(newState, () => {
259
+ this.markSeen();
260
+ });
261
+ }
262
+
263
+ openGallery(index) {
264
+ this.setState({
265
+ galleryOpen: true
266
+ });
267
+ this.refs.imagePopup.scrollTo(index);
268
+ }
269
+
270
+ closeGallery() {
271
+ this.setState({
272
+ galleryOpen: false
273
+ });
274
+ }
275
+
276
+ renderLoading() {
277
+ return /*#__PURE__*/React.createElement(Components.LoadingIndicator, {
278
+ visible: this.state.loading
279
+ });
280
+ }
281
+
282
+ renderTop() {
283
+ const {
284
+ status,
285
+ job
286
+ } = this.state;
287
+ const {
288
+ statusText,
289
+ statusColor
290
+ } = getJobStatusProps(status);
291
+ const canEdit = this.hasPermission();
292
+ const showSeen = !status || status === jobStatusOptions[0].name;
293
+ return /*#__PURE__*/React.createElement(View, {
294
+ style: { ...Helper.getShadowStyle()
295
+ }
296
+ }, /*#__PURE__*/React.createElement(View, {
297
+ style: styles.jobTitleContainer
298
+ }, /*#__PURE__*/React.createElement(Text, {
299
+ style: styles.jobTitleText
300
+ }, job.title), /*#__PURE__*/React.createElement(View, {
301
+ style: styles.jobTypeSeenContainer
302
+ }, /*#__PURE__*/React.createElement(View, {
303
+ style: [styles.jobTypeContainer, {
304
+ backgroundColor: Colours.hexToRGBAstring(this.props.colourBrandingMain, 0.2)
305
+ }]
306
+ }, /*#__PURE__*/React.createElement(Text, {
307
+ style: [styles.jobTypeText, {
308
+ color: this.props.colourBrandingMain
309
+ }]
310
+ }, job.type)), showSeen && this.state.seen && /*#__PURE__*/React.createElement(View, {
311
+ style: styles.jobSeenContainer
312
+ }, /*#__PURE__*/React.createElement(Icon, {
313
+ name: "check",
314
+ type: "font-awesome",
315
+ iconStyle: [styles.jobSeenIcon, {
316
+ color: this.props.colourBrandingMain
317
+ }]
318
+ }), /*#__PURE__*/React.createElement(Text, {
319
+ style: [styles.jobSeenText, {
320
+ color: this.props.colourBrandingMain
321
+ }]
322
+ }, "Seen"))), job.lastActivityUnix && /*#__PURE__*/React.createElement(View, {
323
+ style: styles.textSectionInner
324
+ }, /*#__PURE__*/React.createElement(Text, {
325
+ style: styles.textSectionLabel
326
+ }, "Last Updated On"), /*#__PURE__*/React.createElement(View, {
327
+ style: styles.textSectionTextContainer
328
+ }, /*#__PURE__*/React.createElement(Text, {
329
+ style: styles.textSectionText
330
+ }, moment(job.lastActivityUnix).format('ddd D MMMM, h:mm A')))), /*#__PURE__*/React.createElement(View, {
331
+ style: styles.textSectionInner
332
+ }, /*#__PURE__*/React.createElement(Text, {
333
+ style: styles.textSectionLabel
334
+ }, "Expected Date"), /*#__PURE__*/React.createElement(TouchableOpacity, {
335
+ onPress: this.onOpenDatePicker
336
+ }, /*#__PURE__*/React.createElement(View, {
337
+ style: styles.textSectionTextContainer
338
+ }, /*#__PURE__*/React.createElement(Text, {
339
+ style: styles.textSectionText
340
+ }, this.state.expectedDateText || 'Select Date'), /*#__PURE__*/React.createElement(Icon, {
341
+ name: "angle-right",
342
+ type: "font-awesome",
343
+ iconStyle: [styles.textSectionAngleRight, {
344
+ color: this.props.colourBrandingMain
345
+ }]
346
+ }))))), /*#__PURE__*/React.createElement(View, {
347
+ style: styles.jobStatusExpectedContainer
348
+ }, /*#__PURE__*/React.createElement(View, {
349
+ style: styles.jobStatusOuterContainer
350
+ }, /*#__PURE__*/React.createElement(Text, {
351
+ style: styles.jobStatusHeading
352
+ }, "STATUS"), /*#__PURE__*/React.createElement(TouchableOpacity, {
353
+ onPress: canEdit ? this.onOpenStatusPicker : null
354
+ }, /*#__PURE__*/React.createElement(View, {
355
+ style: [styles.jobStatusContainer, {
356
+ backgroundColor: statusColor
357
+ }]
358
+ }, /*#__PURE__*/React.createElement(Icon, {
359
+ name: "wrench",
360
+ type: "font-awesome",
361
+ iconStyle: styles.jobStatusIcon
362
+ }), /*#__PURE__*/React.createElement(Text, {
363
+ style: styles.jobStatusText
364
+ }, statusText)))), this.hasPermission() && /*#__PURE__*/React.createElement(View, {
365
+ style: styles.jobStatusOuterContainer
366
+ }, /*#__PURE__*/React.createElement(Text, {
367
+ style: styles.jobStatusHeading
368
+ }, "STAFF NOTES"), /*#__PURE__*/React.createElement(TouchableOpacity, {
369
+ onPress: this.openStaffNotes
370
+ }, /*#__PURE__*/React.createElement(View, {
371
+ style: [styles.jobStatusContainer, {
372
+ backgroundColor: this.props.colourBrandingMain
373
+ }]
374
+ }, /*#__PURE__*/React.createElement(Icon, {
375
+ name: "pencil-square-o",
376
+ type: "font-awesome",
377
+ iconStyle: styles.jobStatusIcon
378
+ }), /*#__PURE__*/React.createElement(Text, {
379
+ style: styles.jobStatusText
380
+ }, "Notes (", (job.Notes || []).length, ")"))))));
381
+ }
382
+
383
+ renderPlayableImageUrl(url, index, containerStyle, showMore) {
384
+ const thumbUrl = Helper.getThumb300(url);
385
+
386
+ if (Helper.isVideo(url)) {
387
+ return /*#__PURE__*/React.createElement(ImageBackground, {
388
+ style: [{
389
+ flex: 1
390
+ }, containerStyle],
391
+ source: {
392
+ uri: thumbUrl
393
+ }
394
+ }, /*#__PURE__*/React.createElement(View, {
395
+ style: styles.imagePlayContainer
396
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
397
+ onPress: this.toggleFullscreenVideo.bind(this, url)
398
+ }, /*#__PURE__*/React.createElement(Icon, {
399
+ name: "play",
400
+ type: "font-awesome",
401
+ iconStyle: styles.imageControlIcon
402
+ }))));
403
+ }
404
+
405
+ const imageUrl = Helper.get1400(url);
406
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
407
+ style: containerStyle,
408
+ onPress: this.openGallery.bind(this, index || 0)
409
+ }, /*#__PURE__*/React.createElement(ImageBackground, {
410
+ style: styles.imageContainer,
411
+ source: {
412
+ uri: imageUrl
413
+ }
414
+ }, showMore && /*#__PURE__*/React.createElement(Text, {
415
+ style: styles.plusImages
416
+ }, "+", this.state.job.images.length - 2)));
417
+ }
418
+
419
+ renderPlayableImage(index, containerStyle, showMore) {
420
+ const url = this.state.job.images[index];
421
+ return this.renderPlayableImageUrl(url, index, containerStyle, showMore);
422
+ }
423
+
424
+ renderImage() {
425
+ const {
426
+ job
427
+ } = this.state;
428
+
429
+ if (!_.isNil(job.images) && !_.isEmpty(job.images)) {
430
+ if (job.images.length >= 2) {
431
+ return /*#__PURE__*/React.createElement(View, {
432
+ style: styles.sideBySideImages
433
+ }, this.renderPlayableImage(0, styles.sideBySideImageContainer), this.renderPlayableImage(1, styles.sideBySideImageContainer, job.images.length > 2));
434
+ } else {
435
+ return /*#__PURE__*/React.createElement(View, {
436
+ style: styles.singleImageContainer
437
+ }, this.renderPlayableImage(0));
438
+ }
439
+ } else if (!_.isNil(job.image)) {
440
+ return /*#__PURE__*/React.createElement(View, {
441
+ style: styles.singleImageContainer
442
+ }, this.renderPlayableImageUrl(job.image));
443
+ }
444
+
445
+ return null;
446
+ }
447
+
448
+ renderImagePopup() {
449
+ return /*#__PURE__*/React.createElement(Components.ImagePopup, {
450
+ visible: this.state.galleryOpen,
451
+ images: this.state.job.images || [this.state.job.image],
452
+ onClose: this.closeGallery.bind(this),
453
+ ref: "imagePopup"
454
+ });
455
+ }
456
+
457
+ rendeDetails() {
458
+ const {
459
+ job
460
+ } = this.state;
461
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Components.FormCardSectionOptionLauncher, {
462
+ onPress: this.onToggleDetails,
463
+ title: "Details",
464
+ icon: this.state.showMore ? 'angle-up' : 'angle-down',
465
+ textStyle: styles.detailsText,
466
+ sectionStyle: styles.detailsSection
467
+ }), this.state.showMore && /*#__PURE__*/React.createElement(View, null, this.renderImage(), !_.isEmpty(job.description) && /*#__PURE__*/React.createElement(Text, {
468
+ numberOfLines: 10,
469
+ style: styles.jobDescriptionText
470
+ }, job.description), /*#__PURE__*/React.createElement(Text, {
471
+ style: styles.locationLabel
472
+ }, "Location"), /*#__PURE__*/React.createElement(Text, {
473
+ style: styles.locationText
474
+ }, job.room), /*#__PURE__*/React.createElement(Text, {
475
+ style: styles.requesterLabel
476
+ }, "Person Requesting"), /*#__PURE__*/React.createElement(View, {
477
+ style: styles.profileContainer
478
+ }, /*#__PURE__*/React.createElement(Components.ProfilePic, {
479
+ ProfilePic: job.userProfilePic,
480
+ Diameter: 40
481
+ }), /*#__PURE__*/React.createElement(View, {
482
+ style: styles.nameContainer
483
+ }, /*#__PURE__*/React.createElement(Text, {
484
+ style: styles.nameText
485
+ }, job.userName), !_.isEmpty(job.phone) && /*#__PURE__*/React.createElement(Text, {
486
+ style: styles.phoneText
487
+ }, job.phone)))));
488
+ }
489
+
490
+ renderMessages() {
491
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Components.CommentSection, {
492
+ ref: ref => {
493
+ this.commentSection = ref;
494
+ },
495
+ commentReply: this.commentReply,
496
+ scrollView: this.scrollView,
497
+ adminPermission: "maintenanceTracking",
498
+ entityType: "maintenancerequest",
499
+ entityId: this.props.job.id,
500
+ entityName: this.props.job.title,
501
+ live: true,
502
+ refreshFrequency: 10000,
503
+ placeHolder: '',
504
+ style: {
505
+ flex: 1,
506
+ paddingHorizontal: 0,
507
+ paddingTop: 16
508
+ },
509
+ onCommentsLoaded: this.onCommentsLoaded,
510
+ onCommentAdded: this.onCommentAdded,
511
+ hideAddComment: true,
512
+ disableFlag: true
513
+ }), !this.state.showMessages && /*#__PURE__*/React.createElement(Components.InlineButton, {
514
+ onPress: this.onLeaveMessage,
515
+ color: this.props.colourBrandingMain,
516
+ touchableStyle: {
517
+ marginTop: 10
518
+ },
519
+ style: {
520
+ height: 36
521
+ },
522
+ textStyle: {
523
+ color: '#fff'
524
+ },
525
+ fullWidth: true
526
+ }, "Leave Message"));
527
+ }
528
+
529
+ renderMessagesReply() {
530
+ if (!this.state.showMessages) return null;
531
+ return /*#__PURE__*/React.createElement(Components.CommentReply, {
532
+ ref: ref => {
533
+ this.commentReply = ref;
534
+ },
535
+ commentSection: this.commentSection,
536
+ scrollView: this.scrollView,
537
+ entityType: "maintenancerequest",
538
+ entityId: this.props.job.id,
539
+ entityName: this.props.job.title,
540
+ site: this.state.job.site || this.state.job.location // noScroll={true}
541
+ // style={{ position: 'absolute', bottom: 0, left: 0, right: 0 }}
542
+
543
+ });
544
+ }
545
+
546
+ renderStatusPopup() {
547
+ if (!this.state.showStatusPopup) return null;
548
+ return /*#__PURE__*/React.createElement(StatusSelectorPopup, {
549
+ onClose: this.onCloseStatusPopup,
550
+ onSelect: this.onSelectStatus
551
+ });
552
+ }
553
+
554
+ render() {
555
+ return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
556
+ behavior: Platform.OS === 'ios' && 'padding',
557
+ style: styles.container
558
+ }, /*#__PURE__*/React.createElement(Components.Header, {
559
+ leftIcon: "angle-left",
560
+ onPressLeft: this.onPressBack,
561
+ text: Config.env.strings.MAINTENANCE_REQUEST_DETAILS
562
+ }), this.renderLoading(), /*#__PURE__*/React.createElement(ScrollView, {
563
+ ref: ref => {
564
+ this.scrollView = ref;
565
+ },
566
+ contentContainerStyle: {
567
+ paddingBottom: 26
568
+ },
569
+ style: {
570
+ height: '100%'
571
+ }
572
+ }, /*#__PURE__*/React.createElement(View, {
573
+ style: styles.innerContainer
574
+ }, this.renderTop(), this.rendeDetails(), this.renderMessages())), this.renderMessagesReply(), this.renderStatusPopup(), this.renderImagePopup(), /*#__PURE__*/React.createElement(DateTimePicker, {
575
+ isVisible: this.state.isDateTimePickerVisible,
576
+ onConfirm: this.onDateSelected,
577
+ onCancel: this.onCloseDatePicker,
578
+ mode: this.state.popUpType,
579
+ headerTextIOS: `Pick a ${this.state.popUpType}`
580
+ }));
581
+ }
582
+
583
+ }
584
+
585
+ const styles = StyleSheet.create({
586
+ container: {
587
+ flex: 1,
588
+ backgroundColor: '#fff'
589
+ },
590
+ innerContainer: {
591
+ paddingTop: 23,
592
+ paddingHorizontal: 16
593
+ },
594
+ jobTitleContainer: {
595
+ paddingVertical: 14,
596
+ paddingHorizontal: 12
597
+ },
598
+ jobTitleText: {
599
+ fontFamily: 'sf-semibold',
600
+ fontSize: 20,
601
+ color: Colours.TEXT_DARKEST,
602
+ marginBottom: 8
603
+ },
604
+ jobTypeSeenContainer: {
605
+ flexDirection: 'row',
606
+ alignItems: 'center'
607
+ },
608
+ jobTypeContainer: {
609
+ height: 20,
610
+ width: 80,
611
+ borderRadius: 4,
612
+ justifyContent: 'center'
613
+ },
614
+ jobTypeText: {
615
+ fontFamily: 'sf-semibold',
616
+ fontSize: 12,
617
+ textAlign: 'center'
618
+ },
619
+ jobSeenContainer: {
620
+ flexDirection: 'row',
621
+ alignItems: 'center',
622
+ marginLeft: 10
623
+ },
624
+ jobSeenIcon: {
625
+ fontSize: 12
626
+ },
627
+ jobSeenText: {
628
+ fontFamily: 'sf-semibold',
629
+ fontSize: 12,
630
+ marginLeft: 4
631
+ },
632
+ jobStatusDateText: {
633
+ marginTop: 8,
634
+ fontFamily: 'sf-medium',
635
+ fontSize: 13,
636
+ color: Colours.TEXT_LIGHT
637
+ },
638
+ jobStatusExpectedContainer: {
639
+ flexDirection: 'row',
640
+ alignItems: 'flex-start',
641
+ justifyContent: 'space-between',
642
+ borderTopWidth: 1,
643
+ borderTopColor: Colours.LINEGREY,
644
+ paddingVertical: 14,
645
+ paddingHorizontal: 12
646
+ },
647
+ jobStatusOuterContainer: {// marginRight: 50,
648
+ },
649
+ jobStatusHeading: {
650
+ fontFamily: 'sf-bold',
651
+ fontSize: 11,
652
+ letterSpacing: 0.8,
653
+ color: Colours.TEXT_DARK,
654
+ marginBottom: 6
655
+ },
656
+ jobStatusContainer: {
657
+ flexDirection: 'row',
658
+ alignItems: 'center',
659
+ width: 120,
660
+ height: 30,
661
+ paddingHorizontal: 8,
662
+ borderRadius: 4
663
+ },
664
+ jobStatusIcon: {
665
+ color: '#fff',
666
+ fontSize: 14,
667
+ marginRight: 8
668
+ },
669
+ jobStatusText: {
670
+ color: '#fff',
671
+ textAlign: 'center',
672
+ fontFamily: 'sf-semibold',
673
+ fontSize: 13,
674
+ flex: 1,
675
+ textAlign: 'center'
676
+ },
677
+ jobExpectedDateContainer: {
678
+ backgroundColor: Colours.BOXGREY,
679
+ flexDirection: 'row',
680
+ width: 115,
681
+ height: 30,
682
+ borderRadius: 4,
683
+ alignItems: 'center',
684
+ paddingLeft: 8
685
+ },
686
+ jobExpectedDate: {
687
+ fontFamily: 'sf-regular',
688
+ fontSize: 13,
689
+ color: Colours.hexToRGBAstring(Colours.TEXT_DARKEST, 0.5)
690
+ },
691
+ detailsText: {
692
+ fontFamily: 'sf-semibold',
693
+ fontSize: 16,
694
+ color: Colours.TEXT_DARKEST
695
+ },
696
+ detailsSection: {
697
+ marginTop: 8,
698
+ paddingHorizontal: 0,
699
+ paddingBottom: 12
700
+ },
701
+ sideBySideImages: {
702
+ flex: 1,
703
+ flexDirection: 'row',
704
+ justifyContent: 'space-between',
705
+ marginBottom: 16
706
+ },
707
+ sideBySideImageContainer: {
708
+ backgroundColor: '#fff',
709
+ width: '48%',
710
+ height: 150,
711
+ borderRadius: 2,
712
+ overflow: 'hidden'
713
+ },
714
+ singleImageContainer: {
715
+ backgroundColor: '#fff',
716
+ width: '100%',
717
+ height: 150,
718
+ flex: 1,
719
+ borderRadius: 2,
720
+ overflow: 'hidden',
721
+ marginBottom: 16
722
+ },
723
+ imageContainer: {
724
+ height: 150,
725
+ width: 'auto',
726
+ justifyContent: 'center'
727
+ },
728
+ imagePlayContainer: {
729
+ position: 'absolute',
730
+ top: 0,
731
+ left: 0,
732
+ right: 0,
733
+ bottom: 0,
734
+ alignItems: 'center',
735
+ justifyContent: 'center'
736
+ },
737
+ imageControlIcon: {
738
+ color: '#fff',
739
+ fontSize: 30,
740
+ textShadowColor: 'rgba(0,0,0,0.3)',
741
+ textShadowOffset: {
742
+ width: 2,
743
+ height: 2
744
+ }
745
+ },
746
+ plusImages: {
747
+ fontFamily: 'sf-bold',
748
+ fontSize: 32,
749
+ textAlign: 'center',
750
+ color: '#fff',
751
+ textShadowColor: 'rgba(0, 0, 0, 0.5)',
752
+ textShadowOffset: {
753
+ width: 0,
754
+ height: 2
755
+ },
756
+ textShadowRadius: 8
757
+ },
758
+ jobDescriptionText: {
759
+ fontFamily: 'sf-medium',
760
+ fontSize: 14,
761
+ color: Colours.TEXT_LIGHT,
762
+ paddingBottom: 16
763
+ },
764
+ locationLabel: {
765
+ fontFamily: 'sf-bold',
766
+ fontSize: 14,
767
+ color: Colours.TEXT_DARKEST
768
+ },
769
+ locationText: {
770
+ fontFamily: 'sf-regular',
771
+ fontSize: 16,
772
+ color: Colours.TEXT_DARKEST,
773
+ paddingVertical: 8
774
+ },
775
+ requesterLabel: {
776
+ fontFamily: 'sf-bold',
777
+ fontSize: 14,
778
+ color: Colours.TEXT_DARKEST,
779
+ paddingVertical: 10
780
+ },
781
+ profileContainer: {
782
+ flexDirection: 'row',
783
+ alignItems: 'center'
784
+ },
785
+ nameContainer: {
786
+ marginLeft: 18
787
+ },
788
+ nameText: {
789
+ fontSize: 'sf-semibold',
790
+ fontSize: 14,
791
+ color: Colours.TEXT_DARKEST,
792
+ marginBottom: 4
793
+ },
794
+ phoneText: {
795
+ fontSize: 'sf-medium',
796
+ fontSize: 14,
797
+ color: Colours.TEXT_LIGHT
798
+ },
799
+ textSectionInner: {
800
+ flexDirection: 'row',
801
+ justifyContent: 'space-between',
802
+ alignItems: 'center',
803
+ marginTop: 8
804
+ },
805
+ textSectionLabel: {
806
+ fontFamily: 'sf-semibold',
807
+ fontSize: 12,
808
+ lineHeight: 24,
809
+ color: Colours.TEXT_DARKEST
810
+ },
811
+ textSectionTextContainer: {
812
+ flexDirection: 'row',
813
+ alignItems: 'center'
814
+ },
815
+ textSectionText: {
816
+ fontFamily: 'sf-regular',
817
+ fontSize: 13,
818
+ lineHeight: 24,
819
+ color: Colours.TEXT_LIGHT
820
+ },
821
+ textSectionAngleRight: {
822
+ fontSize: 24,
823
+ marginLeft: 10,
824
+ lineHeight: 24
825
+ }
826
+ });
827
+
828
+ const mapStateToProps = state => {
829
+ return {
830
+ user: state.user,
831
+ colourBrandingMain: Colours.getMainBrandingColourFromState(state),
832
+ jobs: state.jobs.jobs
833
+ };
834
+ };
835
+
836
+ export default connect(mapStateToProps, {
837
+ jobAdded
838
+ })(RequestDetail);
839
+ //# sourceMappingURL=RequestDetail.js.map