@plusscommunities/pluss-core-app 6.1.6-beta.1 → 6.1.6

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 (145) hide show
  1. package/dist/module/actions/FollowerActions.js.map +1 -1
  2. package/dist/module/actions/MediaActions.js.map +1 -1
  3. package/dist/module/actions/ResidentActions.js.map +1 -1
  4. package/dist/module/actions/UserActions.js.map +1 -1
  5. package/dist/module/actions/UserSettingsActions.js.map +1 -1
  6. package/dist/module/actions/index.js.map +1 -1
  7. package/dist/module/actions/types.js.map +1 -1
  8. package/dist/module/apis/analyticsActions.js.map +1 -1
  9. package/dist/module/apis/contactActions.js.map +1 -1
  10. package/dist/module/apis/eventActions.js.map +1 -1
  11. package/dist/module/apis/fileActions.js.map +1 -1
  12. package/dist/module/apis/followerActions.js.map +1 -1
  13. package/dist/module/apis/index.js +0 -1
  14. package/dist/module/apis/index.js.map +1 -1
  15. package/dist/module/apis/notificationActions.js.map +1 -1
  16. package/dist/module/apis/profileActions.js.map +1 -1
  17. package/dist/module/apis/reactionActions.js.map +1 -1
  18. package/dist/module/apis/stringActions.js.map +1 -1
  19. package/dist/module/apis/typeActions.js.map +1 -1
  20. package/dist/module/apis/userActions.js.map +1 -1
  21. package/dist/module/colours.js.map +1 -1
  22. package/dist/module/components/AddButton.js.map +1 -1
  23. package/dist/module/components/AddToCalendarButton.js +4 -5
  24. package/dist/module/components/AddToCalendarButton.js.map +1 -1
  25. package/dist/module/components/Attachment.js.map +1 -1
  26. package/dist/module/components/AudienceSelectorLauncher.js +3 -3
  27. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
  28. package/dist/module/components/AudienceSelectorPage.js +3 -3
  29. package/dist/module/components/AudienceSelectorPage.js.map +1 -1
  30. package/dist/module/components/AutoOffsetImage.js +3 -5
  31. package/dist/module/components/AutoOffsetImage.js.map +1 -1
  32. package/dist/module/components/BackButton.js.map +1 -1
  33. package/dist/module/components/CalendarPopup.js +126 -0
  34. package/dist/module/components/CalendarPopup.js.map +1 -0
  35. package/dist/module/components/CategoryTabs.js.map +1 -1
  36. package/dist/module/components/CommentReply.js +3 -3
  37. package/dist/module/components/CommentReply.js.map +1 -1
  38. package/dist/module/components/CommentSection.js +3 -3
  39. package/dist/module/components/CommentSection.js.map +1 -1
  40. package/dist/module/components/ConfirmPopup.js.map +1 -1
  41. package/dist/module/components/ConfirmationPopup.js.map +1 -1
  42. package/dist/module/components/DropDownItem.js +3 -3
  43. package/dist/module/components/DropDownItem.js.map +1 -1
  44. package/dist/module/components/DropDownMenu.js +3 -3
  45. package/dist/module/components/DropDownMenu.js.map +1 -1
  46. package/dist/module/components/EmptyStateMain.js.map +1 -1
  47. package/dist/module/components/EmptyStateWidget.js.map +1 -1
  48. package/dist/module/components/FontScaleButton.js.map +1 -1
  49. package/dist/module/components/FontScalePopup.js.map +1 -1
  50. package/dist/module/components/Forbidden.js.map +1 -1
  51. package/dist/module/components/FormCard.js.map +1 -1
  52. package/dist/module/components/FormCardSection.js.map +1 -1
  53. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
  54. package/dist/module/components/FormattedText.js +3 -3
  55. package/dist/module/components/FormattedText.js.map +1 -1
  56. package/dist/module/components/GenericInput.js.map +1 -1
  57. package/dist/module/components/GenericInputSection.js +16 -2
  58. package/dist/module/components/GenericInputSection.js.map +1 -1
  59. package/dist/module/components/Header.js.map +1 -1
  60. package/dist/module/components/ImagePopup.js +3 -3
  61. package/dist/module/components/ImagePopup.js.map +1 -1
  62. package/dist/module/components/ImageUploadProgress.js +3 -3
  63. package/dist/module/components/ImageUploadProgress.js.map +1 -1
  64. package/dist/module/components/ImageUploader.js +3 -3
  65. package/dist/module/components/ImageUploader.js.map +1 -1
  66. package/dist/module/components/InlineButton.js.map +1 -1
  67. package/dist/module/components/Input.js +3 -3
  68. package/dist/module/components/Input.js.map +1 -1
  69. package/dist/module/components/LoadingCircles.js +3 -4
  70. package/dist/module/components/LoadingCircles.js.map +1 -1
  71. package/dist/module/components/LoadingIndicator.js +3 -3
  72. package/dist/module/components/LoadingIndicator.js.map +1 -1
  73. package/dist/module/components/LoadingStateWidget.js.map +1 -1
  74. package/dist/module/components/MediaPlayer.js +5 -4
  75. package/dist/module/components/MediaPlayer.js.map +1 -1
  76. package/dist/module/components/MiddlePopup.js.map +1 -1
  77. package/dist/module/components/PDFPopup.js +3 -4
  78. package/dist/module/components/PDFPopup.js.map +1 -1
  79. package/dist/module/components/PlussChat.js +4 -5
  80. package/dist/module/components/PlussChat.js.map +1 -1
  81. package/dist/module/components/PlussChatMessage.js +1 -1
  82. package/dist/module/components/PlussChatMessage.js.map +1 -1
  83. package/dist/module/components/PlussChatTime.js.map +1 -1
  84. package/dist/module/components/Popup.js.map +1 -1
  85. package/dist/module/components/PopupMenu.js.map +1 -1
  86. package/dist/module/components/PositionedImage.js +4 -4
  87. package/dist/module/components/PositionedImage.js.map +1 -1
  88. package/dist/module/components/ProfilePic.js +0 -1
  89. package/dist/module/components/ProfilePic.js.map +1 -1
  90. package/dist/module/components/RadioButton.js.map +1 -1
  91. package/dist/module/components/Reaction.js +3 -3
  92. package/dist/module/components/Reaction.js.map +1 -1
  93. package/dist/module/components/Reactions.js +3 -3
  94. package/dist/module/components/Reactions.js.map +1 -1
  95. package/dist/module/components/SharingTools.js +3 -3
  96. package/dist/module/components/SharingTools.js.map +1 -1
  97. package/dist/module/components/Spinner.js.map +1 -1
  98. package/dist/module/components/StickyFooter.js.map +1 -1
  99. package/dist/module/components/TextStyle.js +1 -1
  100. package/dist/module/components/TextStyle.js.map +1 -1
  101. package/dist/module/components/TickIcon.js +24 -0
  102. package/dist/module/components/TickIcon.js.map +1 -0
  103. package/dist/module/components/Toggle.js.map +1 -1
  104. package/dist/module/components/TouchableSearchBar.js +3 -3
  105. package/dist/module/components/TouchableSearchBar.js.map +1 -1
  106. package/dist/module/components/UserListPopup.js.map +1 -1
  107. package/dist/module/components/UserListing.js.map +1 -1
  108. package/dist/module/components/VideoPopup.js +3 -3
  109. package/dist/module/components/VideoPopup.js.map +1 -1
  110. package/dist/module/components/WarningPopup.js +3 -1
  111. package/dist/module/components/WarningPopup.js.map +1 -1
  112. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +3 -3
  113. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
  114. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
  115. package/dist/module/components/index.js +2 -0
  116. package/dist/module/components/index.js.map +1 -1
  117. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +3 -4
  118. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
  119. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +4 -4
  120. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
  121. package/dist/module/config.js.map +1 -1
  122. package/dist/module/constants.js.map +1 -1
  123. package/dist/module/fonts/index.js.map +1 -1
  124. package/dist/module/fonts/pluss60-icons.js.map +1 -1
  125. package/dist/module/helper.js +26 -3
  126. package/dist/module/helper.js.map +1 -1
  127. package/dist/module/index.js.map +1 -1
  128. package/dist/module/js/images/detectFaces.js.map +1 -1
  129. package/dist/module/js/images/findLandmarkRange.js.map +1 -1
  130. package/dist/module/js/images/getScaledOffset.js.map +1 -1
  131. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
  132. package/dist/module/js/site/isTVEnabled.js.map +1 -1
  133. package/dist/module/session.js.map +1 -1
  134. package/dist/module/styles.js.map +1 -1
  135. package/package.json +2 -1
  136. package/src/apis/index.js +0 -1
  137. package/src/components/CalendarPopup.js +111 -0
  138. package/src/components/GenericInputSection.js +14 -0
  139. package/src/components/TickIcon.js +25 -0
  140. package/src/components/WarningPopup.js +5 -1
  141. package/src/components/index.js +2 -0
  142. package/src/helper.js +30 -1
  143. package/dist/module/apis/settingActions.js +0 -22
  144. package/dist/module/apis/settingActions.js.map +0 -1
  145. package/src/apis/settingActions.js +0 -18
@@ -0,0 +1,111 @@
1
+ import moment from 'moment';
2
+ import React, { Component } from 'react';
3
+ import { Modal, View, TouchableOpacity, StyleSheet } from 'react-native';
4
+ import { Calendar } from 'react-native-calendars';
5
+ import { StatusBarHeight } from '../helper';
6
+ import { Pl60Icon } from '../fonts';
7
+ import { hexToRGBAstring, COLOUR_RED, TEXT_DARK } from '../colours';
8
+
9
+ class CalendarPopup extends Component {
10
+ constructor(props) {
11
+ super(props);
12
+
13
+ this.state = {};
14
+ }
15
+
16
+ onDayPress = date => {
17
+ const { onSelect } = this.props;
18
+ if (!onSelect) return;
19
+
20
+ // console.log('onDayPress', date);
21
+ onSelect(date.timestamp);
22
+ };
23
+
24
+ renderClose() {
25
+ const { onClose } = this.props;
26
+ return (
27
+ <TouchableOpacity style={styles.menuIconContainer} onPress={onClose} activeOpacity={0.6}>
28
+ <Pl60Icon name="close" style={styles.menuIcon} />
29
+ </TouchableOpacity>
30
+ );
31
+ }
32
+
33
+ render() {
34
+ const {
35
+ visible,
36
+ animationType,
37
+ onClose,
38
+ backgroundStyle,
39
+ selectedDate,
40
+ minDate,
41
+ maxDate,
42
+ enabledDates,
43
+ selectedColor,
44
+ enabledColor,
45
+ disabledColor,
46
+ theme,
47
+ } = this.props;
48
+
49
+ const initialDate = (selectedDate ? moment(selectedDate) : moment()).format('YYYY-MM-DD');
50
+ const min = minDate ? moment(minDate).format('YYYY-MM-DD') : undefined;
51
+ const max = maxDate ? moment(maxDate).format('YYYY-MM-DD') : undefined;
52
+ const dateMarkings = {};
53
+ (enabledDates || []).forEach(date => {
54
+ const { day, enabled } = date;
55
+ const key = moment(day).format('YYYY-MM-DD');
56
+ dateMarkings[key] = {
57
+ enabled,
58
+ disableTouchEvent: !enabled,
59
+ customStyles: { text: { color: enabled ? enabledColor || TEXT_DARK : disabledColor || COLOUR_RED } },
60
+ };
61
+ });
62
+ // console.log('CalendarPopup - enabled', JSON.stringify(dateMarkings, null, 2));
63
+ return (
64
+ <Modal transparent visible={visible || false} animationType={animationType || 'fade'} onRequestClose={onClose}>
65
+ <View style={[styles.popup, backgroundStyle || { backgroundColor: hexToRGBAstring('#fff', 1) }]}>
66
+ <Calendar
67
+ initialDate={initialDate}
68
+ minDate={min}
69
+ maxDate={max}
70
+ markingType={'custom'}
71
+ markedDates={{
72
+ ...dateMarkings,
73
+ [initialDate]: { selected: true, selectedColor: selectedColor || COLOUR_GRAPEFRUIT },
74
+ }}
75
+ onDayPress={this.onDayPress}
76
+ theme={theme}
77
+ />
78
+ </View>
79
+ {this.renderClose()}
80
+ </Modal>
81
+ );
82
+ }
83
+ }
84
+
85
+ const styles = StyleSheet.create({
86
+ container: {
87
+ backgroundColor: '#000',
88
+ },
89
+ popup: {
90
+ flex: 1,
91
+ justifyContent: 'center',
92
+ },
93
+ menuIconContainer: {
94
+ position: 'absolute',
95
+ top: StatusBarHeight(0),
96
+ right: 0,
97
+ width: 55,
98
+ height: 55,
99
+ zIndex: 3,
100
+ },
101
+ menuIcon: {
102
+ fontSize: 30,
103
+ padding: 15,
104
+ width: 65,
105
+ textAlign: 'center',
106
+ color: '#000',
107
+ zIndex: 3,
108
+ },
109
+ });
110
+
111
+ export { CalendarPopup };
@@ -78,11 +78,19 @@ class GenericInputSection extends PureComponent {
78
78
  return <GenericInput {...this.props} containerStyle={[styles.input, this.props.containerStyle]} />;
79
79
  }
80
80
 
81
+ renderError() {
82
+ if (this.props.showError === true && !this.props.isValid()) {
83
+ return <Text style={styles.errorText}>{this.props.errorText || 'Required'}</Text>;
84
+ }
85
+ return null;
86
+ }
87
+
81
88
  render() {
82
89
  return (
83
90
  <View style={[styles.container, this.props.sectionStyle]}>
84
91
  {this.renderLabel()}
85
92
  {this.renderInput()}
93
+ {this.renderError()}
86
94
  </View>
87
95
  );
88
96
  }
@@ -151,6 +159,12 @@ const styles = {
151
159
  fontFamily: 'sf-regular',
152
160
  fontSize: 16,
153
161
  },
162
+ errorText: {
163
+ paddingTop: 4,
164
+ fontSize: 13,
165
+ fontFamily: 'sf-regular',
166
+ color: COLOUR_GRAPEFRUIT,
167
+ },
154
168
  };
155
169
 
156
170
  const mapStateToProps = state => {
@@ -0,0 +1,25 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { View } from 'react-native';
3
+ import stylez from '../styles';
4
+ import { Pl60Icon } from '../fonts';
5
+
6
+ class TickIcon extends PureComponent {
7
+ render() {
8
+ const size = this.props.diameter || 20;
9
+ const radius = size / 2;
10
+ return (
11
+ <View
12
+ style={[
13
+ stylez.tickBox,
14
+ { height: size, width: size, borderRadius: radius },
15
+ this.props.color && { backgroundColor: this.props.color },
16
+ this.props.style,
17
+ ]}
18
+ >
19
+ <Pl60Icon name="tick" style={stylez.tickIcon} />
20
+ </View>
21
+ );
22
+ }
23
+ }
24
+
25
+ export { TickIcon };
@@ -12,7 +12,11 @@ const SCREEN_WIDTH = Dimensions.get('window').width;
12
12
  class WarningPopup extends PureComponent {
13
13
  render() {
14
14
  return (
15
- <MiddlePopup visible={this.props.visible} onClose={this.props.onClose} style={styles.popup}>
15
+ <MiddlePopup
16
+ visible={this.props.visible}
17
+ onClose={this.props.onClose}
18
+ style={[styles.popup, this.props.padHorizontal && { paddingHorizontal: 16 }]}
19
+ >
16
20
  {this.props.isSuccess && <Pl60Icon style={styles.icon} name="circleoutlined" />}
17
21
  <Text style={styles.text}>{this.props.confirmText}</Text>
18
22
  <View style={{ marginTop: 16, paddingHorizontal: 24 }}>
@@ -24,6 +24,7 @@ export * from './GenericInput';
24
24
  export * from './RadioButton';
25
25
  export * from './PDFPopup';
26
26
  export * from './TextStyle';
27
+ export * from './TickIcon';
27
28
  export * from './Toggle';
28
29
  export * from './Input';
29
30
  export * from './StickyFooter';
@@ -39,6 +40,7 @@ export * from './FontScaleButton';
39
40
  export * from './UserListPopup';
40
41
  export * from './Reactions';
41
42
  export * from './AudienceSelectorLauncher';
43
+ export * from './CalendarPopup';
42
44
  export { default as EmptyStateWidget } from './EmptyStateWidget';
43
45
  export { default as EmptyStateMain } from './EmptyStateMain';
44
46
  export { default as LoadingStateWidget } from './LoadingStateWidget';
package/src/helper.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import _ from 'lodash';
2
- import { Platform, StatusBar, Dimensions } from 'react-native';
2
+ import React from 'react';
3
+ import { Platform, StatusBar, Dimensions, Text } from 'react-native';
3
4
  import Constants from 'expo-constants';
4
5
  import Config from './config';
5
6
  import { LINEGREY } from './colours';
@@ -256,6 +257,18 @@ const getPluralOptions = (count, singular, plural) => {
256
257
  return plural;
257
258
  };
258
259
 
260
+ const isEmail = email => {
261
+ if (_.isEmpty(email)) {
262
+ return false;
263
+ }
264
+ const atpos = email.indexOf('@');
265
+ const dotpos = email.lastIndexOf('.');
266
+ if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= email.length) {
267
+ return false;
268
+ }
269
+ return true;
270
+ };
271
+
259
272
  const randomString = (name = '') => {
260
273
  return `xxxxxxxx4xxxyxxxxxxxxxxxxx${name}`.replace(/[xy]/g, c => {
261
274
  // eslint-disable-next-line
@@ -448,6 +461,20 @@ const allowComments = canComment => {
448
461
  return Config.env.defaultAllowComments;
449
462
  };
450
463
 
464
+ const toParagraphed = (text, style) => {
465
+ if (!text) {
466
+ return text;
467
+ }
468
+ const textSplit = text.split('\n');
469
+ return _.map(textSplit, (t, i) => {
470
+ return (
471
+ <Text key={`paragraph_${i}`} style={style}>
472
+ {t}
473
+ </Text>
474
+ );
475
+ });
476
+ };
477
+
451
478
  export {
452
479
  TIMESTAMP_FORMAT,
453
480
  DATE_FORMAT,
@@ -469,6 +496,7 @@ export {
469
496
  imageExists,
470
497
  getPluralS,
471
498
  getPluralOptions,
499
+ isEmail,
472
500
  formatTime,
473
501
  minutesToString,
474
502
  randomString,
@@ -487,6 +515,7 @@ export {
487
515
  getValidUrl,
488
516
  getUserPreview,
489
517
  allowComments,
518
+ toParagraphed,
490
519
  isVideoUrl,
491
520
  detectFaces,
492
521
  findLandmarkRange,
@@ -1,22 +0,0 @@
1
- import { authedFunction } from '../session';
2
- import { getUrl } from '../helper';
3
- export const settingActions = {
4
- getSetting: (site, key) => {
5
- return authedFunction({
6
- method: 'GET',
7
- url: getUrl('utility', `getSetting/${site}_${key}`)
8
- });
9
- },
10
- setSetting: (site, key, value) => {
11
- return authedFunction({
12
- method: 'POST',
13
- url: getUrl('utility', 'setSetting'),
14
- data: {
15
- site,
16
- key,
17
- value
18
- }
19
- });
20
- }
21
- };
22
- //# sourceMappingURL=settingActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["authedFunction","getUrl","settingActions","getSetting","site","key","method","url","setSetting","value","data"],"sources":["settingActions.js"],"sourcesContent":["import { authedFunction } from '../session';\nimport { getUrl } from '../helper';\n\nexport const settingActions = {\n getSetting: (site, key) => {\n return authedFunction({\n method: 'GET',\n url: getUrl('utility', `getSetting/${site}_${key}`),\n });\n },\n setSetting: (site, key, value) => {\n return authedFunction({\n method: 'POST',\n url: getUrl('utility', 'setSetting'),\n data: { site, key, value },\n });\n },\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,YAAY;AAC3C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,MAAMC,cAAc,GAAG;EAC5BC,UAAU,EAAEA,CAACC,IAAI,EAAEC,GAAG,KAAK;IACzB,OAAOL,cAAc,CAAC;MACpBM,MAAM,EAAE,KAAK;MACbC,GAAG,EAAEN,MAAM,CAAC,SAAS,EAAG,cAAaG,IAAK,IAAGC,GAAI,EAAC;IACpD,CAAC,CAAC;EACJ,CAAC;EACDG,UAAU,EAAEA,CAACJ,IAAI,EAAEC,GAAG,EAAEI,KAAK,KAAK;IAChC,OAAOT,cAAc,CAAC;MACpBM,MAAM,EAAE,MAAM;MACdC,GAAG,EAAEN,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC;MACpCS,IAAI,EAAE;QAAEN,IAAI;QAAEC,GAAG;QAAEI;MAAM;IAC3B,CAAC,CAAC;EACJ;AACF,CAAC"}
@@ -1,18 +0,0 @@
1
- import { authedFunction } from '../session';
2
- import { getUrl } from '../helper';
3
-
4
- export const settingActions = {
5
- getSetting: (site, key) => {
6
- return authedFunction({
7
- method: 'GET',
8
- url: getUrl('utility', `getSetting/${site}_${key}`),
9
- });
10
- },
11
- setSetting: (site, key, value) => {
12
- return authedFunction({
13
- method: 'POST',
14
- url: getUrl('utility', 'setSetting'),
15
- data: { site, key, value },
16
- });
17
- },
18
- };