@plusscommunities/pluss-core-app 1.4.9 → 1.5.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 (183) 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 +20 -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 +214 -0
  8. package/dist/module/actions/UserActions.js.map +1 -0
  9. package/dist/module/actions/index.js +5 -0
  10. package/dist/module/actions/index.js.map +1 -0
  11. package/dist/module/actions/types.js +14 -0
  12. package/dist/module/actions/types.js.map +1 -0
  13. package/dist/module/apis/analyticsActions.js +20 -0
  14. package/dist/module/apis/analyticsActions.js.map +1 -0
  15. package/dist/module/apis/contactActions.js +27 -0
  16. package/dist/module/apis/contactActions.js.map +1 -0
  17. package/dist/module/apis/eventActions.js +163 -0
  18. package/dist/module/apis/eventActions.js.map +1 -0
  19. package/dist/module/apis/fileActions.js +96 -0
  20. package/dist/module/apis/fileActions.js.map +1 -0
  21. package/dist/module/apis/followerActions.js +38 -0
  22. package/dist/module/apis/followerActions.js.map +1 -0
  23. package/dist/module/apis/index.js +11 -0
  24. package/dist/module/apis/index.js.map +1 -0
  25. package/dist/module/apis/notificationActions.js +60 -0
  26. package/dist/module/apis/notificationActions.js.map +1 -0
  27. package/dist/module/apis/profileActions.js +14 -0
  28. package/dist/module/apis/profileActions.js.map +1 -0
  29. package/dist/module/apis/reactionActions.js +78 -0
  30. package/dist/module/apis/reactionActions.js.map +1 -0
  31. package/dist/module/apis/typeActions.js +15 -0
  32. package/dist/module/apis/typeActions.js.map +1 -0
  33. package/dist/module/apis/userActions.js +104 -0
  34. package/dist/module/apis/userActions.js.map +1 -0
  35. package/{assets → dist/module/assets}/icons/reactions/heart.png +0 -0
  36. package/{assets → dist/module/assets}/icons/reactions/party.png +0 -0
  37. package/{assets → dist/module/assets}/icons/reactions/sad.png +0 -0
  38. package/{assets → dist/module/assets}/icons/reactions/smile.png +0 -0
  39. package/dist/module/colours.js +149 -0
  40. package/dist/module/colours.js.map +1 -0
  41. package/dist/module/components/AddButton.js +45 -0
  42. package/dist/module/components/AddButton.js.map +1 -0
  43. package/dist/module/components/Attachment.js +59 -0
  44. package/dist/module/components/Attachment.js.map +1 -0
  45. package/dist/module/components/AudienceSelectorLauncher.js +70 -0
  46. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
  47. package/dist/module/components/AudienceSelectorPage.js +376 -0
  48. package/dist/module/components/AudienceSelectorPage.js.map +1 -0
  49. package/dist/module/components/BackButton.js +62 -0
  50. package/dist/module/components/BackButton.js.map +1 -0
  51. package/dist/module/components/CategoryTabs.js +171 -0
  52. package/dist/module/components/CategoryTabs.js.map +1 -0
  53. package/dist/module/components/CommentReply.js +363 -0
  54. package/dist/module/components/CommentReply.js.map +1 -0
  55. package/dist/module/components/CommentSection.js +785 -0
  56. package/dist/module/components/CommentSection.js.map +1 -0
  57. package/dist/module/components/ConfirmPopup.js +85 -0
  58. package/dist/module/components/ConfirmPopup.js.map +1 -0
  59. package/dist/module/components/ConfirmationPopup.js +77 -0
  60. package/dist/module/components/ConfirmationPopup.js.map +1 -0
  61. package/dist/module/components/DropDownItem.js +82 -0
  62. package/dist/module/components/DropDownItem.js.map +1 -0
  63. package/dist/module/components/DropDownMenu.js +46 -0
  64. package/dist/module/components/DropDownMenu.js.map +1 -0
  65. package/dist/module/components/EmptyStateMain.js +50 -0
  66. package/dist/module/components/EmptyStateMain.js.map +1 -0
  67. package/dist/module/components/EmptyStateWidget.js +52 -0
  68. package/dist/module/components/EmptyStateWidget.js.map +1 -0
  69. package/dist/module/components/FontScaleButton.js +37 -0
  70. package/dist/module/components/FontScaleButton.js.map +1 -0
  71. package/dist/module/components/FontScalePopup.js +77 -0
  72. package/dist/module/components/FontScalePopup.js.map +1 -0
  73. package/dist/module/components/FormCard.js +28 -0
  74. package/dist/module/components/FormCard.js.map +1 -0
  75. package/dist/module/components/FormCardSection.js +240 -0
  76. package/dist/module/components/FormCardSection.js.map +1 -0
  77. package/dist/module/components/FormCardSectionOptionLauncher.js +77 -0
  78. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
  79. package/dist/module/components/FormattedText.js +145 -0
  80. package/dist/module/components/FormattedText.js.map +1 -0
  81. package/dist/module/components/GenericInput.js +161 -0
  82. package/dist/module/components/GenericInput.js.map +1 -0
  83. package/dist/module/components/GenericInputSection.js +174 -0
  84. package/dist/module/components/GenericInputSection.js.map +1 -0
  85. package/dist/module/components/Header.js +491 -0
  86. package/dist/module/components/Header.js.map +1 -0
  87. package/dist/module/components/ImagePopup.js +257 -0
  88. package/dist/module/components/ImagePopup.js.map +1 -0
  89. package/dist/module/components/ImageUploadProgress.js +72 -0
  90. package/dist/module/components/ImageUploadProgress.js.map +1 -0
  91. package/dist/module/components/ImageUploader.js +850 -0
  92. package/dist/module/components/ImageUploader.js.map +1 -0
  93. package/dist/module/components/InlineButton.js +72 -0
  94. package/dist/module/components/InlineButton.js.map +1 -0
  95. package/dist/module/components/Input.js +164 -0
  96. package/dist/module/components/Input.js.map +1 -0
  97. package/dist/module/components/LoadingCircles.js +224 -0
  98. package/dist/module/components/LoadingCircles.js.map +1 -0
  99. package/dist/module/components/LoadingIndicator.js +95 -0
  100. package/dist/module/components/LoadingIndicator.js.map +1 -0
  101. package/dist/module/components/LoadingStateWidget.js +51 -0
  102. package/dist/module/components/LoadingStateWidget.js.map +1 -0
  103. package/dist/module/components/MediaPlayer.js +440 -0
  104. package/dist/module/components/MediaPlayer.js.map +1 -0
  105. package/dist/module/components/MiddlePopup.js +46 -0
  106. package/dist/module/components/MiddlePopup.js.map +1 -0
  107. package/dist/module/components/PDFPopup.js +188 -0
  108. package/dist/module/components/PDFPopup.js.map +1 -0
  109. package/dist/module/components/PlussChat.js +997 -0
  110. package/dist/module/components/PlussChat.js.map +1 -0
  111. package/dist/module/components/PlussChatMessage.js +204 -0
  112. package/dist/module/components/PlussChatMessage.js.map +1 -0
  113. package/dist/module/components/PlussChatTime.js +66 -0
  114. package/dist/module/components/PlussChatTime.js.map +1 -0
  115. package/dist/module/components/Popup.js +138 -0
  116. package/dist/module/components/Popup.js.map +1 -0
  117. package/dist/module/components/PopupMenu.js +128 -0
  118. package/dist/module/components/PopupMenu.js.map +1 -0
  119. package/dist/module/components/PositionedImage.js +333 -0
  120. package/dist/module/components/PositionedImage.js.map +1 -0
  121. package/dist/module/components/ProfilePic.js +119 -0
  122. package/dist/module/components/ProfilePic.js.map +1 -0
  123. package/dist/module/components/RadioButton.js +84 -0
  124. package/dist/module/components/RadioButton.js.map +1 -0
  125. package/dist/module/components/Reaction.js +129 -0
  126. package/dist/module/components/Reaction.js.map +1 -0
  127. package/dist/module/components/Reactions.js +84 -0
  128. package/dist/module/components/Reactions.js.map +1 -0
  129. package/dist/module/components/SharingTools.js +162 -0
  130. package/dist/module/components/SharingTools.js.map +1 -0
  131. package/dist/module/components/Spinner.js +25 -0
  132. package/dist/module/components/Spinner.js.map +1 -0
  133. package/dist/module/components/StickyFooter.js +37 -0
  134. package/dist/module/components/StickyFooter.js.map +1 -0
  135. package/dist/module/components/TextStyle.js +34 -0
  136. package/dist/module/components/TextStyle.js.map +1 -0
  137. package/dist/module/components/Toggle.js +70 -0
  138. package/dist/module/components/Toggle.js.map +1 -0
  139. package/dist/module/components/TouchableSearchBar.js +73 -0
  140. package/dist/module/components/TouchableSearchBar.js.map +1 -0
  141. package/dist/module/components/UserListPopup.js +146 -0
  142. package/dist/module/components/UserListPopup.js.map +1 -0
  143. package/dist/module/components/UserListing.js +291 -0
  144. package/dist/module/components/UserListing.js.map +1 -0
  145. package/dist/module/components/VideoPopup.js +123 -0
  146. package/dist/module/components/VideoPopup.js.map +1 -0
  147. package/dist/module/components/WarningPopup.js +87 -0
  148. package/dist/module/components/WarningPopup.js.map +1 -0
  149. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +325 -0
  150. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
  151. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +123 -0
  152. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
  153. package/dist/module/components/index.js +53 -0
  154. package/dist/module/components/index.js.map +1 -0
  155. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +416 -0
  156. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
  157. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +405 -0
  158. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
  159. package/dist/module/config.js +27 -0
  160. package/dist/module/config.js.map +1 -0
  161. package/dist/module/constants.js +16 -0
  162. package/dist/module/constants.js.map +1 -0
  163. package/dist/module/fonts/index.js +2 -0
  164. package/dist/module/fonts/index.js.map +1 -0
  165. package/dist/module/fonts/pluss60-icons.js +5 -0
  166. package/dist/module/fonts/pluss60-icons.js.map +1 -0
  167. package/dist/module/fonts/pluss60-icons.json +1097 -0
  168. package/dist/module/helper.js +436 -0
  169. package/dist/module/helper.js.map +1 -0
  170. package/dist/module/index.js +13 -0
  171. package/dist/module/index.js.map +1 -0
  172. package/dist/module/session.js +54 -0
  173. package/dist/module/session.js.map +1 -0
  174. package/dist/module/styles.js +67 -0
  175. package/dist/module/styles.js.map +1 -0
  176. package/package.json +22 -5
  177. package/src/assets/icons/reactions/heart.png +0 -0
  178. package/src/assets/icons/reactions/party.png +0 -0
  179. package/src/assets/icons/reactions/sad.png +0 -0
  180. package/src/assets/icons/reactions/smile.png +0 -0
  181. package/src/components/CommentReply.js +0 -2
  182. package/src/constants.js +4 -4
  183. package/src/helper.js +4 -4
@@ -0,0 +1,70 @@
1
+ import React, { PureComponent } from 'react';
2
+ import { Text, View, TouchableOpacity } from 'react-native';
3
+ import { connect } from 'react-redux';
4
+ import { getMainBrandingColourFromState } from '../colours';
5
+
6
+ class Toggle extends PureComponent {
7
+ render() {
8
+ return /*#__PURE__*/React.createElement(View, {
9
+ style: [styles.container, this.props.style]
10
+ }, this.props.options.map((option, index) => {
11
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
12
+ onPress: () => {
13
+ this.props.onPress(option);
14
+ },
15
+ style: [styles.tag, {
16
+ borderColor: this.props.colourBrandingMain
17
+ }, option.val === this.props.activeVal && {
18
+ borderColor: this.props.colourBrandingMain,
19
+ backgroundColor: this.props.colourBrandingMain
20
+ }, index === 0 && styles.firstTag, index === this.props.options.length - 1 && styles.lastTag, this.props.tagStyle],
21
+ key: option.val
22
+ }, /*#__PURE__*/React.createElement(Text, {
23
+ style: [styles.text, {
24
+ color: this.props.colourBrandingMain
25
+ }, option.val === this.props.activeVal && styles.activeText, this.props.textStyle]
26
+ }, option.text));
27
+ }));
28
+ }
29
+
30
+ }
31
+
32
+ const styles = {
33
+ container: {
34
+ flexDirection: 'row'
35
+ },
36
+ text: {
37
+ fontFamily: 'sf-semibold',
38
+ fontSize: 14,
39
+ textAlign: 'center'
40
+ },
41
+ activeText: {
42
+ color: '#fff'
43
+ },
44
+ tag: {
45
+ flex: 1,
46
+ height: 34,
47
+ borderWidth: 1,
48
+ borderLeftWidth: 0,
49
+ justifyContent: 'center'
50
+ },
51
+ firstTag: {
52
+ borderLeftWidth: 1,
53
+ borderTopLeftRadius: 4,
54
+ borderBottomLeftRadius: 4
55
+ },
56
+ lastTag: {
57
+ borderTopRightRadius: 4,
58
+ borderBottomRightRadius: 4
59
+ }
60
+ };
61
+
62
+ const mapStateToProps = state => {
63
+ return {
64
+ colourBrandingMain: getMainBrandingColourFromState(state)
65
+ };
66
+ };
67
+
68
+ const toggle = connect(mapStateToProps, {})(Toggle);
69
+ export { toggle as Toggle };
70
+ //# sourceMappingURL=Toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Toggle.js"],"names":["React","PureComponent","Text","View","TouchableOpacity","connect","getMainBrandingColourFromState","Toggle","render","styles","container","props","style","options","map","option","index","onPress","tag","borderColor","colourBrandingMain","val","activeVal","backgroundColor","firstTag","length","lastTag","tagStyle","text","color","activeText","textStyle","flexDirection","fontFamily","fontSize","textAlign","flex","height","borderWidth","borderLeftWidth","justifyContent","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","mapStateToProps","state","toggle"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,gBAArB,QAA6C,cAA7C;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,SAASC,8BAAT,QAA+C,YAA/C;;AAEA,MAAMC,MAAN,SAAqBN,aAArB,CAAmC;AACjCO,EAAAA,MAAM,GAAG;AACP,wBACE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAE,CAACC,MAAM,CAACC,SAAR,EAAmB,KAAKC,KAAL,CAAWC,KAA9B;AAAb,OACG,KAAKD,KAAL,CAAWE,OAAX,CAAmBC,GAAnB,CAAuB,CAACC,MAAD,EAASC,KAAT,KAAmB;AACzC,0BACE,oBAAC,gBAAD;AACE,QAAA,OAAO,EAAE,MAAM;AACb,eAAKL,KAAL,CAAWM,OAAX,CAAmBF,MAAnB;AACD,SAHH;AAIE,QAAA,KAAK,EAAE,CACLN,MAAM,CAACS,GADF,EAEL;AAAEC,UAAAA,WAAW,EAAE,KAAKR,KAAL,CAAWS;AAA1B,SAFK,EAGLL,MAAM,CAACM,GAAP,KAAe,KAAKV,KAAL,CAAWW,SAA1B,IAAuC;AACrCH,UAAAA,WAAW,EAAE,KAAKR,KAAL,CAAWS,kBADa;AAErCG,UAAAA,eAAe,EAAE,KAAKZ,KAAL,CAAWS;AAFS,SAHlC,EAOLJ,KAAK,KAAK,CAAV,IAAeP,MAAM,CAACe,QAPjB,EAQLR,KAAK,KAAK,KAAKL,KAAL,CAAWE,OAAX,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AGC,KAAK,IAAI;AAC/B,SAAO;AACL1B,IAAAA,kBAAkB,EAAEd,8BAA8B,CAACwC,KAAD;AAD7C,GAAP;AAGD,CAJD;;AAMA,MAAMC,MAAM,GAAG1C,OAAO,CAACwC,eAAD,EAAkB,EAAlB,CAAP,CAA6BtC,MAA7B,CAAf;AACA,SAASwC,MAAM,IAAIxC,MAAnB","sourcesContent":["import React, { PureComponent } from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getMainBrandingColourFromState } from '../colours';\n\nclass Toggle extends PureComponent {\n render() {\n return (\n <View style={[styles.container, this.props.style]}>\n {this.props.options.map((option, index) => {\n return (\n <TouchableOpacity\n onPress={() => {\n this.props.onPress(option);\n }}\n style={[\n styles.tag,\n { borderColor: this.props.colourBrandingMain },\n option.val === this.props.activeVal && {\n borderColor: this.props.colourBrandingMain,\n backgroundColor: this.props.colourBrandingMain,\n },\n index === 0 && styles.firstTag,\n index === this.props.options.length - 1 && styles.lastTag,\n this.props.tagStyle,\n ]}\n key={option.val}\n >\n <Text\n style={[\n styles.text,\n { color: this.props.colourBrandingMain },\n option.val === this.props.activeVal && styles.activeText,\n this.props.textStyle,\n ]}\n >\n {option.text}\n </Text>\n </TouchableOpacity>\n );\n })}\n </View>\n );\n }\n}\n\nconst styles = {\n container: {\n flexDirection: 'row',\n },\n text: {\n fontFamily: 'sf-semibold',\n fontSize: 14,\n textAlign: 'center',\n },\n activeText: {\n color: '#fff',\n },\n tag: {\n flex: 1,\n height: 34,\n borderWidth: 1,\n borderLeftWidth: 0,\n justifyContent: 'center',\n },\n firstTag: {\n borderLeftWidth: 1,\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n },\n lastTag: {\n borderTopRightRadius: 4,\n borderBottomRightRadius: 4,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst toggle = connect(mapStateToProps, {})(Toggle);\nexport { toggle as Toggle };\n"]}
@@ -0,0 +1,73 @@
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 { View, TouchableWithoutFeedback, Text } from 'react-native';
5
+ import { connect } from 'react-redux';
6
+ import { getSiteSettingFromState } from '../helper';
7
+ import { TEXT_LIGHT, BOXGREY } from '../colours';
8
+ import { Pl60Icon } from '../fonts';
9
+ import Config, { Services } from '../config';
10
+
11
+ class TouchableSearchBar extends Component {
12
+ constructor() {
13
+ super(...arguments);
14
+
15
+ _defineProperty(this, "onPressSearch", () => {
16
+ Services.navigation.navigate('search', {
17
+ priorityType: this.props.priorityType,
18
+ searchName: this.props.searchName
19
+ });
20
+ });
21
+ }
22
+
23
+ render() {
24
+ return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
25
+ onPress: this.onPressSearch
26
+ }, /*#__PURE__*/React.createElement(View, {
27
+ style: [styles.searchInputContainer, this.props.headerType !== 'white' && {
28
+ backgroundColor: '#fff'
29
+ }, this.props.style]
30
+ }, /*#__PURE__*/React.createElement(Pl60Icon, {
31
+ name: "Ellipse",
32
+ style: styles.searchIcon
33
+ }), /*#__PURE__*/React.createElement(Text, {
34
+ style: styles.searchText
35
+ }, `Search ${this.props.searchName}`)));
36
+ }
37
+
38
+ }
39
+
40
+ const styles = {
41
+ searchInputContainer: {
42
+ flex: 1,
43
+ height: 36,
44
+ marginHorizontal: 16,
45
+ marginVertical: 17,
46
+ borderRadius: 25,
47
+ backgroundColor: BOXGREY,
48
+ alignItems: 'center',
49
+ justifyContent: 'center',
50
+ flexDirection: 'row',
51
+ paddingHorizontal: 16
52
+ },
53
+ searchIcon: {
54
+ fontSize: 14,
55
+ color: TEXT_LIGHT,
56
+ marginRight: 8
57
+ },
58
+ searchText: {
59
+ fontSize: 14,
60
+ color: TEXT_LIGHT,
61
+ fontFamily: 'sf-medium'
62
+ }
63
+ };
64
+
65
+ const mapStateToProps = state => {
66
+ return {
67
+ headerType: getSiteSettingFromState(state, 'HeaderType', getSiteSettingFromState(state, 'UseGradientHeader', Config.env.hasGradientHeader) ? 'gradient' : 'white')
68
+ };
69
+ };
70
+
71
+ const touchableSearchBar = connect(mapStateToProps, {})(TouchableSearchBar);
72
+ export { touchableSearchBar as TouchableSearchBar };
73
+ //# sourceMappingURL=TouchableSearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["TouchableSearchBar.js"],"names":["React","Component","View","TouchableWithoutFeedback","Text","connect","getSiteSettingFromState","TEXT_LIGHT","BOXGREY","Pl60Icon","Config","Services","TouchableSearchBar","navigation","navigate","priorityType","props","searchName","render","onPressSearch","styles","searchInputContainer","headerType","backgroundColor","style","searchIcon","searchText","flex","height","marginHorizontal","marginVertical","borderRadius","alignItems","justifyContent","flexDirection","paddingHorizontal","fontSize","color","marginRight","fontFamily","mapStateToProps","state","env","hasGradientHeader","touchableSearchBar"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,wBAAf,EAAyCC,IAAzC,QAAqD,cAArD;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,SAASC,uBAAT,QAAwC,WAAxC;AACA,SAASC,UAAT,EAAqBC,OAArB,QAAoC,YAApC;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,OAAOC,MAAP,IAAiBC,QAAjB,QAAiC,WAAjC;;AAEA,MAAMC,kBAAN,SAAiCX,SAAjC,CAA2C;AAAA;AAAA;;AAAA,2CACzB,MAAM;AACpBU,MAAAA,QAAQ,CAACE,UAAT,CAAoBC,QAApB,CAA6B,QAA7B,EAAuC;AAAEC,QAAAA,YAAY,EAAE,KAAKC,KAAL,CAAWD,YAA3B;AAAyCE,QAAAA,UAAU,EAAE,KAAKD,KAAL,CAAWC;AAAhE,OAAvC;AACD,KAHwC;AAAA;;AAKzCC,EAAAA,MAAM,GAAG;AACP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O;AACLnB,IAAAA,UAAU,EAAEhB,uBAAuB,CACjCmC,KADiC,EAEjC,YAFiC,EAGjCnC,uBAAuB,CAACmC,KAAD,EAAQ,mBAAR,EAA6B/B,MAAM,CAACgC,GAAP,CAAWC,iBAAxC,CAAvB,GAAoF,UAApF,GAAiG,OAHhE;AAD9B,GAAP;AAOD,CARD;;AAUA,MAAMC,kBAAkB,GAAGvC,OAAO,CAACmC,eAAD,EAAkB,EAAlB,CAAP,CAA6B5B,kBAA7B,CAA3B;AACA,SAASgC,kBAAkB,IAAIhC,kBAA/B","sourcesContent":["import React, { Component } from 'react';\nimport { View, TouchableWithoutFeedback, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getSiteSettingFromState } from '../helper';\nimport { TEXT_LIGHT, BOXGREY } from '../colours';\nimport { Pl60Icon } from '../fonts';\nimport Config, { Services } from '../config';\n\nclass TouchableSearchBar extends Component {\n onPressSearch = () => {\n Services.navigation.navigate('search', { priorityType: this.props.priorityType, searchName: this.props.searchName });\n };\n\n render() {\n return (\n <TouchableWithoutFeedback onPress={this.onPressSearch}>\n <View style={[styles.searchInputContainer, this.props.headerType !== 'white' && { backgroundColor: '#fff' }, this.props.style]}>\n <Pl60Icon name=\"Ellipse\" style={styles.searchIcon} />\n <Text style={styles.searchText}>{`Search ${this.props.searchName}`}</Text>\n </View>\n </TouchableWithoutFeedback>\n );\n }\n}\n\nconst styles = {\n searchInputContainer: {\n flex: 1,\n height: 36,\n marginHorizontal: 16,\n marginVertical: 17,\n borderRadius: 25,\n backgroundColor: BOXGREY,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'row',\n paddingHorizontal: 16,\n },\n searchIcon: {\n fontSize: 14,\n color: TEXT_LIGHT,\n marginRight: 8,\n },\n searchText: {\n fontSize: 14,\n color: TEXT_LIGHT,\n fontFamily: 'sf-medium',\n },\n};\n\nconst mapStateToProps = state => {\n return {\n headerType: getSiteSettingFromState(\n state,\n 'HeaderType',\n getSiteSettingFromState(state, 'UseGradientHeader', Config.env.hasGradientHeader) ? 'gradient' : 'white',\n ),\n };\n};\n\nconst touchableSearchBar = connect(mapStateToProps, {})(TouchableSearchBar);\nexport { touchableSearchBar as TouchableSearchBar };\n"]}
@@ -0,0 +1,146 @@
1
+ import React, { Component } from 'react';
2
+ import { Text, View, Dimensions, Modal, ScrollView, TouchableWithoutFeedback, Platform } from 'react-native';
3
+ import { connect } from 'react-redux';
4
+ import { TEXT_DARK, LINEGREY, getMainBrandingColourFromState } from '../colours';
5
+ import UserListing from './UserListing';
6
+ import { InlineButton } from './InlineButton';
7
+ const SCREEN_HEIGHT = Dimensions.get('window').height;
8
+
9
+ class UserListPopup extends Component {
10
+ getRenderKey(user, userKey) {
11
+ if (user.id) {
12
+ return `${user.id}${userKey}`;
13
+ }
14
+
15
+ if (user.userId) {
16
+ return `${user.userId}${userKey}`;
17
+ }
18
+
19
+ return userKey;
20
+ }
21
+
22
+ renderHeader() {
23
+ return /*#__PURE__*/React.createElement(View, {
24
+ style: styles.titleContainer
25
+ }, /*#__PURE__*/React.createElement(View, {
26
+ style: styles.titleContent
27
+ }, /*#__PURE__*/React.createElement(Text, {
28
+ style: styles.title
29
+ }, this.props.title)));
30
+ }
31
+
32
+ renderScrollContainer() {
33
+ return /*#__PURE__*/React.createElement(ScrollView, {
34
+ style: styles.optionsContainer,
35
+ keyboardShouldPersistTaps: "handled"
36
+ }, this.props.users.map((user, userIndex) => {
37
+ return /*#__PURE__*/React.createElement(UserListing, {
38
+ user: user,
39
+ key: this.getRenderKey(user, userIndex),
40
+ index: userIndex
41
+ });
42
+ }), /*#__PURE__*/React.createElement(View, {
43
+ style: styles.scrollFooterSpace
44
+ }));
45
+ }
46
+
47
+ renderFooter() {
48
+ return /*#__PURE__*/React.createElement(View, {
49
+ style: styles.footer
50
+ }, /*#__PURE__*/React.createElement(InlineButton, {
51
+ onPress: this.props.onClose.bind(this),
52
+ color: this.props.colourBrandingMain,
53
+ style: [styles.footerButton]
54
+ }, "Done"));
55
+ }
56
+
57
+ render() {
58
+ return /*#__PURE__*/React.createElement(Modal, {
59
+ visible: this.props.visible,
60
+ transparent: true,
61
+ animationType: "slide",
62
+ onRequestClose: this.props.onClose
63
+ }, /*#__PURE__*/React.createElement(ScrollView, {
64
+ keyboardShouldPersistTaps: "always"
65
+ }, /*#__PURE__*/React.createElement(View, {
66
+ style: styles.popup
67
+ }, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
68
+ onPress: this.props.onClose
69
+ }, /*#__PURE__*/React.createElement(View, {
70
+ style: styles.popupOverlay
71
+ })), /*#__PURE__*/React.createElement(View, {
72
+ style: [styles.popupContent, {
73
+ minHeight: SCREEN_HEIGHT - (Platform.OS === 'android' ? 175 : 150)
74
+ }, {
75
+ marginTop: 60,
76
+ minHeight: SCREEN_HEIGHT - (Platform.OS === 'android' ? 85 : 60)
77
+ }]
78
+ }, this.renderHeader(), this.renderScrollContainer(), this.renderFooter()))));
79
+ }
80
+
81
+ }
82
+
83
+ const styles = {
84
+ popup: {
85
+ flex: 1,
86
+ justifyContent: 'center'
87
+ },
88
+ popupOverlay: {
89
+ position: 'absolute',
90
+ backgroundColor: 'rgba(19, 19, 26, .25)',
91
+ top: 0,
92
+ left: 0,
93
+ right: 0,
94
+ bottom: 0
95
+ },
96
+ popupContent: {
97
+ borderRadius: 3,
98
+ marginTop: 150,
99
+ backgroundColor: '#fff',
100
+ flex: 1,
101
+ borderTopLeftRadius: 15,
102
+ borderTopRightRadius: 15
103
+ },
104
+ footer: {
105
+ padding: 8,
106
+ borderTopWidth: 1,
107
+ borderColor: LINEGREY,
108
+ backgroundColor: '#fff'
109
+ },
110
+ footerButton: {
111
+ width: '100%',
112
+ height: 40
113
+ },
114
+ titleContainer: {
115
+ alignSelf: 'stretch',
116
+ padding: 24,
117
+ paddingTop: 16,
118
+ paddingBottom: 0
119
+ },
120
+ titleContent: {
121
+ borderColor: LINEGREY,
122
+ borderBottomWidth: 1,
123
+ flexDirection: 'row',
124
+ justifyContent: 'space-between',
125
+ paddingBottom: 15
126
+ },
127
+ title: {
128
+ fontSize: 15,
129
+ fontFamily: 'sf-semibold',
130
+ color: TEXT_DARK
131
+ },
132
+ optionsContainer: {
133
+ flex: 1,
134
+ paddingVertical: 8
135
+ }
136
+ };
137
+
138
+ const mapStateToProps = state => {
139
+ return {
140
+ colourBrandingMain: getMainBrandingColourFromState(state)
141
+ };
142
+ };
143
+
144
+ const userListPopup = connect(mapStateToProps, {})(UserListPopup);
145
+ export { userListPopup as UserListPopup };
146
+ //# sourceMappingURL=UserListPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["UserListPopup.js"],"names":["React","Component","Text","View","Dimensions","Modal","ScrollView","TouchableWithoutFeedback","Platform","connect","TEXT_DARK","LINEGREY","getMainBrandingColourFromState","UserListing","InlineButton","SCREEN_HEIGHT","get","height","UserListPopup","getRenderKey","user","userKey","id","userId","renderHeader","styles","titleContainer","titleContent","title","props","renderScrollContainer","optionsContainer","users","map","userIndex","scrollFooterSpace","renderFooter","footer","onClose","bind","colourBrandingMain","footerButton","render","visible","popup","popupOverlay","popupContent","minHeight","OS","marginTop","flex","justifyContent","position","backgroundColor","top","left","right","bottom","borderRadius","borderTopLeftRadius","borderTopRightRadius","padding","borderTopWidth","borderColor","width","alignSelf","paddingTop","paddingBottom","borderBottomWidth","flexDirection","fontSize","fontFamily","color","paddingVertical","mapStateToProps","state","userListPopup"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,UAArB,EAAiCC,KAAjC,EAAwCC,UAAxC,EAAoDC,wBAApD,EAA8EC,QAA9E,QAA8F,cAA9F;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,8BAA9B,QAAoE,YAApE;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,MAAMC,aAAa,GA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A,UAAU,EAAE,aAFP;AAGLC,IAAAA,KAAK,EAAE9D;AAHF,GA5CM;AAiDbqB,EAAAA,gBAAgB,EAAE;AAChBmB,IAAAA,IAAI,EAAE,CADU;AAEhBuB,IAAAA,eAAe,EAAE;AAFD;AAjDL,CAAf;;AAuDA,MAAMC,eAAe,GAAGC,KAAK,IAAI;AAC/B,SAAO;AACLnC,IAAAA,kBAAkB,EAAE5B,8BAA8B,CAAC+D,KAAD;AAD7C,GAAP;AAGD,CAJD;;AAMA,MAAMC,aAAa,GAAGnE,OAAO,CAACiE,eAAD,EAAkB,EAAlB,CAAP,CAA6BxD,aAA7B,CAAtB;AACA,SAAS0D,aAAa,IAAI1D,aAA1B","sourcesContent":["import React, { Component } from 'react';\nimport { Text, View, Dimensions, Modal, ScrollView, TouchableWithoutFeedback, Platform } from 'react-native';\nimport { connect } from 'react-redux';\nimport { TEXT_DARK, LINEGREY, getMainBrandingColourFromState } from '../colours';\nimport UserListing from './UserListing';\nimport { InlineButton } from './InlineButton';\n\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\n\nclass UserListPopup extends Component {\n getRenderKey(user, userKey) {\n if (user.id) {\n return `${user.id}${userKey}`;\n }\n if (user.userId) {\n return `${user.userId}${userKey}`;\n }\n return userKey;\n }\n\n renderHeader() {\n return (\n <View style={styles.titleContainer}>\n <View style={styles.titleContent}>\n <Text style={styles.title}>{this.props.title}</Text>\n </View>\n </View>\n );\n }\n\n renderScrollContainer() {\n return (\n <ScrollView style={styles.optionsContainer} keyboardShouldPersistTaps=\"handled\">\n {this.props.users.map((user, userIndex) => {\n return <UserListing user={user} key={this.getRenderKey(user, userIndex)} index={userIndex} />;\n })}\n <View style={styles.scrollFooterSpace} />\n </ScrollView>\n );\n }\n\n renderFooter() {\n return (\n <View style={styles.footer}>\n <InlineButton onPress={this.props.onClose.bind(this)} color={this.props.colourBrandingMain} style={[styles.footerButton]}>\n Done\n </InlineButton>\n </View>\n );\n }\n\n render() {\n return (\n <Modal visible={this.props.visible} transparent animationType=\"slide\" onRequestClose={this.props.onClose}>\n <ScrollView keyboardShouldPersistTaps=\"always\">\n <View style={styles.popup}>\n <TouchableWithoutFeedback onPress={this.props.onClose}>\n <View style={styles.popupOverlay} />\n </TouchableWithoutFeedback>\n <View\n style={[\n styles.popupContent,\n { minHeight: SCREEN_HEIGHT - (Platform.OS === 'android' ? 175 : 150) },\n { marginTop: 60, minHeight: SCREEN_HEIGHT - (Platform.OS === 'android' ? 85 : 60) },\n ]}\n >\n {this.renderHeader()}\n {this.renderScrollContainer()}\n {this.renderFooter()}\n </View>\n </View>\n </ScrollView>\n </Modal>\n );\n }\n}\n\nconst styles = {\n popup: {\n flex: 1,\n justifyContent: 'center',\n },\n popupOverlay: {\n position: 'absolute',\n backgroundColor: 'rgba(19, 19, 26, .25)',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n },\n popupContent: {\n borderRadius: 3,\n marginTop: 150,\n backgroundColor: '#fff',\n flex: 1,\n borderTopLeftRadius: 15,\n borderTopRightRadius: 15,\n },\n footer: {\n padding: 8,\n borderTopWidth: 1,\n borderColor: LINEGREY,\n backgroundColor: '#fff',\n },\n footerButton: {\n width: '100%',\n height: 40,\n },\n titleContainer: {\n alignSelf: 'stretch',\n padding: 24,\n paddingTop: 16,\n paddingBottom: 0,\n },\n titleContent: {\n borderColor: LINEGREY,\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingBottom: 15,\n },\n title: {\n fontSize: 15,\n fontFamily: 'sf-semibold',\n color: TEXT_DARK,\n },\n optionsContainer: {\n flex: 1,\n paddingVertical: 8,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst userListPopup = connect(mapStateToProps, {})(UserListPopup);\nexport { userListPopup as UserListPopup };\n"]}
@@ -0,0 +1,291 @@
1
+ import React, { Component } from 'react';
2
+ import _ from 'lodash';
3
+ import { TouchableOpacity, Text, View } from 'react-native';
4
+ import { connect } from 'react-redux';
5
+ import moment from 'moment';
6
+ import { COLOUR_GREEN, TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState, getLightBrandingColourFromState } from '../colours';
7
+ import { Services } from '../config';
8
+ import { ProfilePic } from './ProfilePic';
9
+ import { InlineButton } from './InlineButton';
10
+ import { Spinner } from './Spinner';
11
+ import { followerActions } from '../apis';
12
+ import { addFollower } from '../actions';
13
+
14
+ class UserListing extends Component {
15
+ constructor(props) {
16
+ super(props);
17
+ this.state = {
18
+ pending: false
19
+ };
20
+ }
21
+
22
+ onPress() {
23
+ const {
24
+ hidden
25
+ } = this.props.me;
26
+ if (hidden && _.includes(hidden, 'people')) return;
27
+
28
+ if (this.props.onPress) {
29
+ this.props.onPress();
30
+ return;
31
+ }
32
+
33
+ const user = { ...this.props.user
34
+ };
35
+
36
+ if (_.isUndefined(user.key)) {
37
+ user.key = user.userId;
38
+ }
39
+
40
+ if (_.isUndefined(user.id)) {
41
+ user.id = user.userId;
42
+ }
43
+
44
+ Services.navigation.navigate('profile', {
45
+ user
46
+ });
47
+ }
48
+
49
+ onFollowUser() {
50
+ const userToSave = {
51
+ profilePic: this.props.user.profilePic,
52
+ displayName: this.props.user.displayName,
53
+ id: this.props.user.id
54
+ };
55
+ this.setState({
56
+ pending: true
57
+ });
58
+ followerActions.addFollower(userToSave, this.props.myId).then(() => {
59
+ this.props.addFollower(userToSave);
60
+ }).catch(() => {
61
+ this.setState({
62
+ pending: false
63
+ });
64
+ });
65
+ }
66
+
67
+ getTimeText(input) {
68
+ const gug = moment.unix(input);
69
+
70
+ if (gug.isBefore(moment().local().startOf('d'))) {
71
+ return gug.format('D MMM');
72
+ }
73
+
74
+ return gug.format('h:mma');
75
+ }
76
+
77
+ getProfilePic() {
78
+ if (this.props.user.profilePic == null) return null;
79
+ let profilePic = this.props.user.profilePic;
80
+
81
+ if (!_.isUndefined(this.props.user.profilePicThumb) && !_.isEmpty(this.props.user.profilePicThumb)) {
82
+ profilePic = this.props.user.profilePicThumb;
83
+ } else if (this.props.user.profilePic.indexOf('.amazonaws.com/1400/') > -1) {
84
+ profilePic = profilePic.replace('/1400/', '/300/');
85
+ }
86
+
87
+ return profilePic;
88
+ }
89
+
90
+ getLastMessage(chat) {
91
+ if (typeof chat.lastMessage === 'string') {
92
+ return chat.lastMessage;
93
+ } // TODO recognise user name of last message
94
+
95
+
96
+ return chat.lastMessage.text;
97
+ }
98
+
99
+ renderFollowButton() {
100
+ if (this.props.user.privateChat) {
101
+ return /*#__PURE__*/React.createElement(View, {
102
+ style: {
103
+ justifyContent: 'flex-start'
104
+ }
105
+ }, /*#__PURE__*/React.createElement(Text, {
106
+ style: [styles.chatTimeStamp, this.props.user.unread > 0 && {
107
+ color: TEXT_DARK,
108
+ fontFamily: 'sf-bold'
109
+ }]
110
+ }, this.getTimeText(this.props.user.Changed)), /*#__PURE__*/React.createElement(View, {
111
+ style: [{
112
+ flexDirection: 'row-reverse',
113
+ marginTop: 2
114
+ }, this.props.user.unread === 0 && {
115
+ opacity: 0
116
+ }]
117
+ }, /*#__PURE__*/React.createElement(View, {
118
+ style: styles.counter
119
+ }, /*#__PURE__*/React.createElement(Text, {
120
+ style: styles.counterText
121
+ }, this.props.user.unread))));
122
+ }
123
+
124
+ if (!this.props.showFriendsButton) {
125
+ return null;
126
+ } // self
127
+
128
+
129
+ if (this.props.myId === this.props.user.id) {
130
+ return null;
131
+ } // already following
132
+
133
+
134
+ if (this.props.isFollowing) {
135
+ return /*#__PURE__*/React.createElement(InlineButton, {
136
+ color: this.props.colourBrandingLight,
137
+ style: styles.friendsButton,
138
+ textStyle: {
139
+ color: this.props.colourBrandingMain
140
+ },
141
+ disabled: true
142
+ }, "Friends");
143
+ } // in process of following
144
+
145
+
146
+ if (this.state.pending) {
147
+ return /*#__PURE__*/React.createElement(InlineButton, {
148
+ style: [styles.friendsButton, {
149
+ borderColor: this.props.colourBrandingMain,
150
+ borderWidth: 1
151
+ }],
152
+ disabled: true,
153
+ noText: true
154
+ }, /*#__PURE__*/React.createElement(Spinner, {
155
+ size: "small",
156
+ color: this.props.colourBrandingMain
157
+ }));
158
+ } // not following yet
159
+
160
+
161
+ return /*#__PURE__*/React.createElement(InlineButton, {
162
+ onPress: this.onFollowUser.bind(this),
163
+ color: "#fff",
164
+ style: [styles.friendsButton, {
165
+ borderColor: this.props.colourBrandingMain,
166
+ borderWidth: 1
167
+ }],
168
+ textStyle: {
169
+ color: this.props.colourBrandingMain
170
+ }
171
+ }, "Add friend");
172
+ }
173
+
174
+ renderStatusText() {
175
+ if (!this.props.statusText) {
176
+ return null;
177
+ }
178
+
179
+ return /*#__PURE__*/React.createElement(Text, {
180
+ style: styles.statusText
181
+ }, this.props.statusText);
182
+ }
183
+
184
+ render() {
185
+ return /*#__PURE__*/React.createElement(View, {
186
+ style: this.props.containerStyle
187
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
188
+ activeOpacity: 0.9,
189
+ onPress: this.onPress.bind(this),
190
+ disabled: this.props.onPressDisabled
191
+ }, /*#__PURE__*/React.createElement(View, {
192
+ style: [styles.listItem, this.props.listItemStyle]
193
+ }, this.renderStatusText(), /*#__PURE__*/React.createElement(ProfilePic, {
194
+ ProfilePic: this.getProfilePic(),
195
+ Diameter: 42
196
+ }), /*#__PURE__*/React.createElement(View, {
197
+ style: [styles.fill, styles.flexRowReverse, styles.alignCenter]
198
+ }, this.props.rightContent, this.renderFollowButton(), /*#__PURE__*/React.createElement(View, {
199
+ style: styles.fill
200
+ }, /*#__PURE__*/React.createElement(View, {
201
+ style: styles.listItemTextContainer
202
+ }, /*#__PURE__*/React.createElement(Text, {
203
+ style: styles.contactName,
204
+ numberOfLines: 1
205
+ }, this.props.user.displayName), this.props.user.privateChat && /*#__PURE__*/React.createElement(Text, {
206
+ style: styles.chatLastMessage,
207
+ numberOfLines: 1
208
+ }, this.getLastMessage(this.props.user)), this.props.subText))))));
209
+ }
210
+
211
+ }
212
+
213
+ const styles = {
214
+ listItem: {
215
+ paddingVertical: 8,
216
+ paddingHorizontal: 16,
217
+ justifyContent: 'flex-start',
218
+ flexDirection: 'row',
219
+ position: 'relative'
220
+ },
221
+ listItemTextContainer: {
222
+ flex: 1,
223
+ flexDirection: 'column',
224
+ justifyContent: 'space-around',
225
+ paddingLeft: 16
226
+ },
227
+ contactName: {
228
+ fontSize: 15,
229
+ fontFamily: 'sf-semibold',
230
+ backgroundColor: 'rgba(255,255,255,0)',
231
+ color: TEXT_DARK
232
+ },
233
+ statusText: {
234
+ position: 'absolute',
235
+ top: 0,
236
+ left: 82,
237
+ fontFamily: 'sf-semibold',
238
+ fontSize: 12,
239
+ color: TEXT_LIGHT
240
+ },
241
+ fill: {
242
+ flex: 1
243
+ },
244
+ alignCenter: {
245
+ alignItems: 'center'
246
+ },
247
+ flexRowReverse: {
248
+ flexDirection: 'row-reverse'
249
+ },
250
+ friendsButton: {
251
+ width: 100
252
+ },
253
+ counter: {
254
+ borderRadius: 10,
255
+ height: 20,
256
+ justifyContent: 'center',
257
+ minWidth: 20,
258
+ paddingHorizontal: 4,
259
+ backgroundColor: COLOUR_GREEN
260
+ },
261
+ counterText: {
262
+ color: '#fff',
263
+ fontSize: 12,
264
+ fontFamily: 'sf-semibold',
265
+ textAlign: 'center'
266
+ },
267
+ chatTimeStamp: {
268
+ fontSize: 10,
269
+ fontFamily: 'sf-semibold',
270
+ color: TEXT_LIGHT
271
+ },
272
+ chatLastMessage: {
273
+ fontSize: 13,
274
+ fontFamily: 'sf-medium',
275
+ color: TEXT_LIGHT,
276
+ marginRight: 5
277
+ }
278
+ };
279
+
280
+ const mapStateToProps = state => {
281
+ return {
282
+ me: state.user,
283
+ colourBrandingMain: getMainBrandingColourFromState(state),
284
+ colourBrandingLight: getLightBrandingColourFromState(state)
285
+ };
286
+ };
287
+
288
+ export default connect(mapStateToProps, {
289
+ addFollower
290
+ })(UserListing);
291
+ //# sourceMappingURL=UserListing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["UserListing.js"],"names":["React","Component","_","TouchableOpacity","Text","View","connect","moment","COLOUR_GREEN","TEXT_DARK","TEXT_LIGHT","getMainBrandingColourFromState","getLightBrandingColourFromState","Services","ProfilePic","InlineButton","Spinner","followerActions","addFollower","UserListing","constructor","props","state","pending","onPress","hidden","me","includes","user","isUndefined","key","userId","id","navigation","navigate","onFollowUser","userToSave","profilePic","displayName","setState","myId","then","catch","getTimeText","input","gug","unix","isBefore","local","startOf","format","getProfilePic","profilePicThumb","isEmpty","indexOf","replace","getLastMessage","chat","lastMessage","text","renderFollowButton","privateChat","justifyContent","styles","chatTimeStamp","unread","color","fontFamily","Changed","flexDirection","marginTop","opacity","counter","counterText","showFriendsButton","isFollowing","colourBrandingLight","friendsButton","colourBrandingMain","borderColor","borderWidth","bind","renderStatusText","statusText","render","containerStyle","onPressDisabled","listItem","listItemStyle","fill","flexRowReverse","alignCenter","rightContent","listItemTextContainer","contactName","chatLastMessage","subText","paddingVertical","paddingHorizontal","position","flex","paddingLeft","fontSize","backgroundColor","top","left","alignItems","width","borderRadius","height","minWidth","textAlign","marginRight","mapStateToProps"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,SAASC,gBAAT,EAA2BC,IAA3B,EAAiCC,IAAjC,QAA6C,cAA7C;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,OAAOC,MAAP,MAAmB,QAAnB;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,UAAlC,EAA8CC,8BAA9C,EAA8EC,+BAA9E,QAAqH,YAArH;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,eAAT,QAAgC,SAAhC;AACA,SAASC,WAAT,QAA4B,YAA5B;;AAEA,MAAMC,WAAN,SAA0BlB,SAA1B,CAAoC;AAClCmB,EAAAA,WAA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odash';\nimport { TouchableOpacity, Text, View } from 'react-native';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\nimport { COLOUR_GREEN, TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState, getLightBrandingColourFromState } from '../colours';\nimport { Services } from '../config';\nimport { ProfilePic } from './ProfilePic';\nimport { InlineButton } from './InlineButton';\nimport { Spinner } from './Spinner';\nimport { followerActions } from '../apis';\nimport { addFollower } from '../actions';\n\nclass UserListing extends Component {\n constructor(props) {\n super(props);\n this.state = { pending: false };\n }\n\n onPress() {\n const { hidden } = this.props.me;\n if (hidden && _.includes(hidden, 'people')) return;\n\n if (this.props.onPress) {\n this.props.onPress();\n return;\n }\n const user = { ...this.props.user };\n if (_.isUndefined(user.key)) {\n user.key = user.userId;\n }\n if (_.isUndefined(user.id)) {\n user.id = user.userId;\n }\n Services.navigation.navigate('profile', { user });\n }\n\n onFollowUser() {\n const userToSave = {\n profilePic: this.props.user.profilePic,\n displayName: this.props.user.displayName,\n id: this.props.user.id,\n };\n this.setState({ pending: true });\n followerActions\n .addFollower(userToSave, this.props.myId)\n .then(() => {\n this.props.addFollower(userToSave);\n })\n .catch(() => {\n this.setState({ pending: false });\n });\n }\n\n getTimeText(input) {\n const gug = moment.unix(input);\n if (\n gug.isBefore(\n moment()\n .local()\n .startOf('d'),\n )\n ) {\n return gug.format('D MMM');\n }\n return gug.format('h:mma');\n }\n\n getProfilePic() {\n if (this.props.user.profilePic == null) return null;\n let profilePic = this.props.user.profilePic;\n if (!_.isUndefined(this.props.user.profilePicThumb) && !_.isEmpty(this.props.user.profilePicThumb)) {\n profilePic = this.props.user.profilePicThumb;\n } else if (this.props.user.profilePic.indexOf('.amazonaws.com/1400/') > -1) {\n profilePic = profilePic.replace('/1400/', '/300/');\n }\n return profilePic;\n }\n\n getLastMessage(chat) {\n if (typeof chat.lastMessage === 'string') {\n return chat.lastMessage;\n }\n // TODO recognise user name of last message\n return chat.lastMessage.text;\n }\n\n renderFollowButton() {\n if (this.props.user.privateChat) {\n return (\n <View style={{ justifyContent: 'flex-start' }}>\n <Text style={[styles.chatTimeStamp, this.props.user.unread > 0 && { color: TEXT_DARK, fontFamily: 'sf-bold' }]}>\n {this.getTimeText(this.props.user.Changed)}\n </Text>\n <View style={[{ flexDirection: 'row-reverse', marginTop: 2 }, this.props.user.unread === 0 && { opacity: 0 }]}>\n <View style={styles.counter}>\n <Text style={styles.counterText}>{this.props.user.unread}</Text>\n </View>\n </View>\n </View>\n );\n }\n\n if (!this.props.showFriendsButton) {\n return null;\n }\n\n // self\n if (this.props.myId === this.props.user.id) {\n return null;\n }\n\n // already following\n if (this.props.isFollowing) {\n return (\n <InlineButton\n color={this.props.colourBrandingLight}\n style={styles.friendsButton}\n textStyle={{ color: this.props.colourBrandingMain }}\n disabled\n >\n Friends\n </InlineButton>\n );\n }\n\n // in process of following\n if (this.state.pending) {\n return (\n <InlineButton style={[styles.friendsButton, { borderColor: this.props.colourBrandingMain, borderWidth: 1 }]} disabled noText>\n <Spinner size=\"small\" color={this.props.colourBrandingMain} />\n </InlineButton>\n );\n }\n\n // not following yet\n return (\n <InlineButton\n onPress={this.onFollowUser.bind(this)}\n color=\"#fff\"\n style={[styles.friendsButton, { borderColor: this.props.colourBrandingMain, borderWidth: 1 }]}\n textStyle={{ color: this.props.colourBrandingMain }}\n >\n Add friend\n </InlineButton>\n );\n }\n\n renderStatusText() {\n if (!this.props.statusText) {\n return null;\n }\n return <Text style={styles.statusText}>{this.props.statusText}</Text>;\n }\n\n render() {\n return (\n <View style={this.props.containerStyle}>\n <TouchableOpacity activeOpacity={0.9} onPress={this.onPress.bind(this)} disabled={this.props.onPressDisabled}>\n <View style={[styles.listItem, this.props.listItemStyle]}>\n {this.renderStatusText()}\n <ProfilePic ProfilePic={this.getProfilePic()} Diameter={42} />\n <View style={[styles.fill, styles.flexRowReverse, styles.alignCenter]}>\n {this.props.rightContent}\n {this.renderFollowButton()}\n <View style={styles.fill}>\n <View style={styles.listItemTextContainer}>\n <Text style={styles.contactName} numberOfLines={1}>\n {this.props.user.displayName}\n </Text>\n {this.props.user.privateChat && (\n <Text style={styles.chatLastMessage} numberOfLines={1}>\n {this.getLastMessage(this.props.user)}\n </Text>\n )}\n {this.props.subText}\n </View>\n </View>\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n }\n}\n\nconst styles = {\n listItem: {\n paddingVertical: 8,\n paddingHorizontal: 16,\n justifyContent: 'flex-start',\n flexDirection: 'row',\n position: 'relative',\n },\n listItemTextContainer: {\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'space-around',\n paddingLeft: 16,\n },\n contactName: {\n fontSize: 15,\n fontFamily: 'sf-semibold',\n backgroundColor: 'rgba(255,255,255,0)',\n color: TEXT_DARK,\n },\n statusText: {\n position: 'absolute',\n top: 0,\n left: 82,\n fontFamily: 'sf-semibold',\n fontSize: 12,\n color: TEXT_LIGHT,\n },\n fill: {\n flex: 1,\n },\n alignCenter: {\n alignItems: 'center',\n },\n flexRowReverse: {\n flexDirection: 'row-reverse',\n },\n friendsButton: {\n width: 100,\n },\n counter: {\n borderRadius: 10,\n height: 20,\n justifyContent: 'center',\n minWidth: 20,\n paddingHorizontal: 4,\n backgroundColor: COLOUR_GREEN,\n },\n counterText: {\n color: '#fff',\n fontSize: 12,\n fontFamily: 'sf-semibold',\n textAlign: 'center',\n },\n chatTimeStamp: {\n fontSize: 10,\n fontFamily: 'sf-semibold',\n color: TEXT_LIGHT,\n },\n chatLastMessage: {\n fontSize: 13,\n fontFamily: 'sf-medium',\n color: TEXT_LIGHT,\n marginRight: 5,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n me: state.user,\n colourBrandingMain: getMainBrandingColourFromState(state),\n colourBrandingLight: getLightBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, { addFollower })(UserListing);\n"]}