@plusscommunities/pluss-maintenance-app-forms 8.0.17 → 8.0.18

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.
@@ -6,12 +6,11 @@ import {
6
6
  Modal,
7
7
  ScrollView,
8
8
  Dimensions,
9
+ Platform,
9
10
  } from "react-native";
10
- import {
11
- SafeAreaProvider,
12
- SafeAreaView,
13
- } from "react-native-safe-area-context";
11
+ import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
14
12
  import { connect } from "react-redux";
13
+ import { withSafeAreaInsets } from "react-native-safe-area-context";
15
14
  import _ from "lodash";
16
15
  import { maintenanceActions } from "../apis";
17
16
  import { Colours, Helper } from "../core.config";
@@ -162,9 +161,16 @@ class FilterPopupMenu extends Component {
162
161
 
163
162
  renderCancel() {
164
163
  const { colourBrandingMain, cancelText } = this.props;
164
+ const bottom =
165
+ Platform.OS === "android" ? (this.props.insets?.bottom ?? 0) : 0;
165
166
  return (
166
167
  <TouchableOpacity onPress={this.onDone}>
167
- <View style={styles.cancelContainer}>
168
+ <View
169
+ style={[
170
+ styles.cancelContainer,
171
+ bottom > 0 && { paddingBottom: 16 + bottom },
172
+ ]}
173
+ >
168
174
  <Text style={[styles.cancelText, { color: colourBrandingMain }]}>
169
175
  {cancelText || "Done"}
170
176
  </Text>
@@ -357,4 +363,7 @@ const mapStateToProps = (state) => {
357
363
  };
358
364
  };
359
365
 
360
- export default connect(mapStateToProps, {})(FilterPopupMenu);
366
+ export default connect(
367
+ mapStateToProps,
368
+ {},
369
+ )(withSafeAreaInsets(FilterPopupMenu));
@@ -1,6 +1,12 @@
1
1
  import React, { Component } from "react";
2
2
  import { Text } from "@plusscommunities/pluss-core-app/components";
3
- import { View, StyleSheet, FlatList, TouchableOpacity, Animated } from "react-native";
3
+ import {
4
+ View,
5
+ StyleSheet,
6
+ FlatList,
7
+ TouchableOpacity,
8
+ Animated,
9
+ } from "react-native";
4
10
  import _ from "lodash";
5
11
  import { connect } from "react-redux";
6
12
  import { maintenanceActions } from "../apis";
@@ -62,7 +68,9 @@ class MaintenanceList extends Component {
62
68
  const incompleteStatuses = statusTypes
63
69
  .filter((s) => s.category !== "Completed")
64
70
  .map((s) => s.text);
65
- return incompleteStatuses.length > 0 ? incompleteStatuses.join(",") : status;
71
+ return incompleteStatuses.length > 0
72
+ ? incompleteStatuses.join(",")
73
+ : status;
66
74
  };
67
75
 
68
76
  refresh = (overrideFilters) => {
@@ -443,10 +451,7 @@ class MaintenanceList extends Component {
443
451
 
444
452
  return (
445
453
  <Animated.View
446
- style={[
447
- styles.filterOverlay,
448
- { opacity: this._overlayOpacity },
449
- ]}
454
+ style={[styles.filterOverlay, { opacity: this._overlayOpacity }]}
450
455
  pointerEvents="none"
451
456
  >
452
457
  <View style={styles.filterOverlayInner}>
@@ -420,13 +420,16 @@ class RequestDetail extends Component {
420
420
  <View style={styles.jobTitleContainer}>
421
421
  {job.jobId ? (
422
422
  <Text
423
+ maxFontSizeMultiplier={1.5}
423
424
  style={[
424
425
  styles.jobIdText,
425
426
  { color: this.props.colourBrandingMain },
426
427
  ]}
427
428
  >{`${values.textEntityName} #${job.jobId}`}</Text>
428
429
  ) : null}
429
- <Text style={styles.jobTitleText}>{job.title}</Text>
430
+ <Text style={styles.jobTitleText} maxFontSizeMultiplier={1.4}>
431
+ {job.title}
432
+ </Text>
430
433
  <View style={styles.jobTypeSeenContainer}>
431
434
  <View
432
435
  style={[
@@ -473,7 +476,9 @@ class RequestDetail extends Component {
473
476
 
474
477
  {job.lastActivityUnix && (
475
478
  <View style={styles.textSectionInner}>
476
- <Text style={styles.textSectionLabel}>Last Updated On</Text>
479
+ <Text style={styles.textSectionLabel} maxFontSizeMultiplier={1.5}>
480
+ Last Updated On
481
+ </Text>
477
482
  <View style={styles.textSectionTextContainer}>
478
483
  <Text style={styles.textSectionText}>
479
484
  {moment(job.lastActivityUnix).format("ddd D MMMM, h:mm A")}
@@ -498,7 +503,9 @@ class RequestDetail extends Component {
498
503
  <View style={styles.jobInfoContainer}>
499
504
  <View style={styles.jobStatusExpectedContainer}>
500
505
  <View style={styles.jobStatusOuterContainer}>
501
- <Text style={styles.jobStatusHeading}>STATUS</Text>
506
+ <Text style={styles.jobStatusHeading} maxFontSizeMultiplier={1.5}>
507
+ STATUS
508
+ </Text>
502
509
  <TouchableOpacity
503
510
  onPress={canEdit ? this.onOpenStatusPicker : null}
504
511
  >
@@ -508,7 +515,12 @@ class RequestDetail extends Component {
508
515
  { backgroundColor: statusOption.color },
509
516
  ]}
510
517
  >
511
- <Text style={styles.jobStatusText}>{statusOption?.text}</Text>
518
+ <Text
519
+ style={styles.jobStatusText}
520
+ maxFontSizeMultiplier={1.4}
521
+ >
522
+ {statusOption?.text}
523
+ </Text>
512
524
  </View>
513
525
  </TouchableOpacity>
514
526
  </View>
@@ -790,7 +802,7 @@ class RequestDetail extends Component {
790
802
  switch (field.type) {
791
803
  case "date":
792
804
  return (
793
- <Text style={styles.customText}>
805
+ <Text style={styles.customText} maxFontSizeMultiplier={1.5}>
794
806
  {field.answer
795
807
  ? moment(field.answer, "YYYY-MM-DD").format("DD MMM YYYY")
796
808
  : ""}
@@ -798,7 +810,7 @@ class RequestDetail extends Component {
798
810
  );
799
811
  case "time":
800
812
  return (
801
- <Text style={styles.customText}>
813
+ <Text style={styles.customText} maxFontSizeMultiplier={1.5}>
802
814
  {field.answer
803
815
  ? moment(field.answer, "HH:mm").format("h:mm a")
804
816
  : ""}
@@ -806,11 +818,13 @@ class RequestDetail extends Component {
806
818
  );
807
819
  case "yn":
808
820
  return (
809
- <Text style={styles.customText}>{field.answer ? "Yes" : "No"}</Text>
821
+ <Text style={styles.customText} maxFontSizeMultiplier={1.5}>
822
+ {field.answer ? "Yes" : "No"}
823
+ </Text>
810
824
  );
811
825
  case "checkbox":
812
826
  return (
813
- <Text style={styles.customText}>
827
+ <Text style={styles.customText} maxFontSizeMultiplier={1.5}>
814
828
  {field.answer && Array.isArray(field.answer)
815
829
  ? field.answer.join(", ")
816
830
  : ""}
@@ -829,7 +843,11 @@ class RequestDetail extends Component {
829
843
  </View>
830
844
  );
831
845
  default:
832
- return <Text style={styles.customText}>{field.answer}</Text>;
846
+ return (
847
+ <Text style={styles.customText} maxFontSizeMultiplier={1.5}>
848
+ {field.answer}
849
+ </Text>
850
+ );
833
851
  }
834
852
  };
835
853
 
@@ -843,7 +861,9 @@ class RequestDetail extends Component {
843
861
  return null;
844
862
  return (
845
863
  <View key={index}>
846
- <Text style={styles.customLabel}>{field.label}</Text>
864
+ <Text style={styles.customLabel} maxFontSizeMultiplier={1.5}>
865
+ {field.label}
866
+ </Text>
847
867
  {renderAnswer(field)}
848
868
  </View>
849
869
  );
@@ -871,14 +891,21 @@ class RequestDetail extends Component {
871
891
  <>
872
892
  {this.renderImage(job.images, job.image)}
873
893
  {!_.isEmpty(job.description) && (
874
- <Text style={styles.jobDescriptionText}>
894
+ <Text
895
+ style={styles.jobDescriptionText}
896
+ maxFontSizeMultiplier={1.5}
897
+ >
875
898
  {job.description}
876
899
  </Text>
877
900
  )}
878
901
  </>
879
902
  ) : null}
880
- <Text style={styles.locationLabel}>Address</Text>
881
- <Text style={styles.locationText}>{job.room}</Text>
903
+ <Text style={styles.locationLabel} maxFontSizeMultiplier={1.5}>
904
+ Address
905
+ </Text>
906
+ <Text style={styles.locationText} maxFontSizeMultiplier={1.5}>
907
+ {job.room}
908
+ </Text>
882
909
  {!hasCustomFields && job.isHome ? (
883
910
  <View style={styles.detailsSection}>
884
911
  <Text style={styles.locationLabel}>Must be home</Text>
@@ -18,7 +18,7 @@ import _ from "lodash";
18
18
  import moment from "moment";
19
19
  import { jobAdded } from "../actions";
20
20
  import { maintenanceActions } from "../apis";
21
- import { getBottomSpace } from "react-native-iphone-x-helper";
21
+ import { withSafeAreaInsets } from "react-native-safe-area-context";
22
22
  import { Services } from "../feature.config";
23
23
  import { Components, Colours, Helper } from "../core.config";
24
24
  import { values } from "../values.config";
@@ -758,7 +758,14 @@ class RequestNotes extends Component {
758
758
  )}
759
759
  </Components.GenericInputSection>
760
760
  </ScrollView>
761
- <View style={styles.popupFooter}>{this.renderFooterContent()}</View>
761
+ <View
762
+ style={[
763
+ styles.popupFooter,
764
+ { paddingBottom: (this.props.insets?.bottom ?? 0) + 16 },
765
+ ]}
766
+ >
767
+ {this.renderFooterContent()}
768
+ </View>
762
769
  {this.renderVideoPlayerPopup()}
763
770
  </KeyboardAvoidingView>
764
771
  </Modal>
@@ -803,7 +810,7 @@ const styles = {
803
810
  },
804
811
  popupFooter: {
805
812
  paddingHorizontal: 16,
806
- paddingBottom: getBottomSpace() + 16,
813
+ paddingBottom: 16, // bottom inset added dynamically
807
814
  },
808
815
  noteContainer: {
809
816
  ...Helper.getShadowStyle(),
@@ -953,4 +960,6 @@ const mapStateToProps = (state) => {
953
960
  };
954
961
  };
955
962
 
956
- export default connect(mapStateToProps, { jobAdded })(RequestNotes);
963
+ export default connect(mapStateToProps, { jobAdded })(
964
+ withSafeAreaInsets(RequestNotes),
965
+ );
@@ -572,9 +572,10 @@ class MaintenanceRequest extends Component {
572
572
  return field;
573
573
  });
574
574
 
575
- const userID = this.state.canCreateOnBehalf && this.state.selectedUser
576
- ? (this.state.selectedUser.userId || this.state.selectedUser.Id)
577
- : this.props.uid;
575
+ const userID =
576
+ this.state.canCreateOnBehalf && this.state.selectedUser
577
+ ? this.state.selectedUser.userId || this.state.selectedUser.Id
578
+ : this.props.uid;
578
579
 
579
580
  maintenanceActions
580
581
  .sendMaintenanceRequest(