@plusscommunities/pluss-core-app 8.0.0 → 8.0.1-auth.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/module/actions/FollowerActions.js +4 -4
  2. package/dist/module/actions/FollowerActions.js.map +1 -1
  3. package/dist/module/actions/MediaActions.js +1 -1
  4. package/dist/module/actions/MediaActions.js.map +1 -1
  5. package/dist/module/actions/ResidentActions.js +1 -1
  6. package/dist/module/actions/ResidentActions.js.map +1 -1
  7. package/dist/module/actions/UserActions.js +1 -1
  8. package/dist/module/actions/UserActions.js.map +1 -1
  9. package/dist/module/actions/UserSettingsActions.js +1 -1
  10. package/dist/module/actions/UserSettingsActions.js.map +1 -1
  11. package/dist/module/actions/index.js +5 -5
  12. package/dist/module/actions/index.js.map +1 -1
  13. package/dist/module/actions/types.js +16 -16
  14. package/dist/module/actions/types.js.map +1 -1
  15. package/dist/module/apis/analyticsActions.js +5 -5
  16. package/dist/module/apis/analyticsActions.js.map +1 -1
  17. package/dist/module/apis/contactActions.js +6 -6
  18. package/dist/module/apis/contactActions.js.map +1 -1
  19. package/dist/module/apis/eventActions.js +28 -28
  20. package/dist/module/apis/eventActions.js.map +1 -1
  21. package/dist/module/apis/fileActions.js +15 -15
  22. package/dist/module/apis/fileActions.js.map +1 -1
  23. package/dist/module/apis/followerActions.js +8 -8
  24. package/dist/module/apis/followerActions.js.map +1 -1
  25. package/dist/module/apis/index.js +12 -12
  26. package/dist/module/apis/index.js.map +1 -1
  27. package/dist/module/apis/notificationActions.js +17 -17
  28. package/dist/module/apis/notificationActions.js.map +1 -1
  29. package/dist/module/apis/profileActions.js +4 -4
  30. package/dist/module/apis/profileActions.js.map +1 -1
  31. package/dist/module/apis/reactionActions.js +15 -15
  32. package/dist/module/apis/reactionActions.js.map +1 -1
  33. package/dist/module/apis/settingActions.js +6 -6
  34. package/dist/module/apis/settingActions.js.map +1 -1
  35. package/dist/module/apis/stringActions.js +8 -8
  36. package/dist/module/apis/stringActions.js.map +1 -1
  37. package/dist/module/apis/typeActions.js +4 -4
  38. package/dist/module/apis/typeActions.js.map +1 -1
  39. package/dist/module/apis/userActions.js +8 -8
  40. package/dist/module/apis/userActions.js.map +1 -1
  41. package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  42. package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  43. package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  44. package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  45. package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  46. package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  47. package/dist/module/colours.js +26 -29
  48. package/dist/module/colours.js.map +1 -1
  49. package/dist/module/components/AddButton.js +8 -8
  50. package/dist/module/components/AddButton.js.map +1 -1
  51. package/dist/module/components/AddToCalendarButton.js +30 -29
  52. package/dist/module/components/AddToCalendarButton.js.map +1 -1
  53. package/dist/module/components/Attachment.js +10 -9
  54. package/dist/module/components/Attachment.js.map +1 -1
  55. package/dist/module/components/AudienceSelectorLauncher.js +11 -11
  56. package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
  57. package/dist/module/components/AudienceSelectorPage.js +45 -44
  58. package/dist/module/components/AudienceSelectorPage.js.map +1 -1
  59. package/dist/module/components/AutoOffsetImage.js +13 -13
  60. package/dist/module/components/AutoOffsetImage.js.map +1 -1
  61. package/dist/module/components/BackButton.js +10 -10
  62. package/dist/module/components/BackButton.js.map +1 -1
  63. package/dist/module/components/CalendarPopup.js +21 -21
  64. package/dist/module/components/CalendarPopup.js.map +1 -1
  65. package/dist/module/components/CategoryTabs.js +30 -29
  66. package/dist/module/components/CategoryTabs.js.map +1 -1
  67. package/dist/module/components/CommentReply.js +43 -37
  68. package/dist/module/components/CommentReply.js.map +1 -1
  69. package/dist/module/components/CommentSection.js +74 -74
  70. package/dist/module/components/CommentSection.js.map +1 -1
  71. package/dist/module/components/ConfirmPopup.js +21 -20
  72. package/dist/module/components/ConfirmPopup.js.map +1 -1
  73. package/dist/module/components/ConfirmationPopup.js +11 -11
  74. package/dist/module/components/ConfirmationPopup.js.map +1 -1
  75. package/dist/module/components/DocumentUploader.js +50 -50
  76. package/dist/module/components/DocumentUploader.js.map +1 -1
  77. package/dist/module/components/DropDownItem.js +14 -13
  78. package/dist/module/components/DropDownItem.js.map +1 -1
  79. package/dist/module/components/DropDownMenu.js +5 -5
  80. package/dist/module/components/DropDownMenu.js.map +1 -1
  81. package/dist/module/components/EmptyStateMain.js +10 -9
  82. package/dist/module/components/EmptyStateMain.js.map +1 -1
  83. package/dist/module/components/EmptyStateWidget.js +7 -6
  84. package/dist/module/components/EmptyStateWidget.js.map +1 -1
  85. package/dist/module/components/FontScaleButton.js +5 -4
  86. package/dist/module/components/FontScaleButton.js.map +1 -1
  87. package/dist/module/components/FontScalePopup.js +11 -10
  88. package/dist/module/components/FontScalePopup.js.map +1 -1
  89. package/dist/module/components/Forbidden.js +13 -13
  90. package/dist/module/components/Forbidden.js.map +1 -1
  91. package/dist/module/components/FormCard.js +4 -4
  92. package/dist/module/components/FormCard.js.map +1 -1
  93. package/dist/module/components/FormCardSection.js +20 -18
  94. package/dist/module/components/FormCardSection.js.map +1 -1
  95. package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
  96. package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
  97. package/dist/module/components/FormattedText.js +18 -16
  98. package/dist/module/components/FormattedText.js.map +1 -1
  99. package/dist/module/components/GenericInput.js +24 -21
  100. package/dist/module/components/GenericInput.js.map +1 -1
  101. package/dist/module/components/GenericInputSection.js +27 -26
  102. package/dist/module/components/GenericInputSection.js.map +1 -1
  103. package/dist/module/components/Header.js +70 -69
  104. package/dist/module/components/Header.js.map +1 -1
  105. package/dist/module/components/Icon.js +109 -0
  106. package/dist/module/components/Icon.js.map +1 -0
  107. package/dist/module/components/ImagePopup.js +211 -73
  108. package/dist/module/components/ImagePopup.js.map +1 -1
  109. package/dist/module/components/ImageUploadProgress.js +10 -9
  110. package/dist/module/components/ImageUploadProgress.js.map +1 -1
  111. package/dist/module/components/ImageUploader.js +116 -96
  112. package/dist/module/components/ImageUploader.js.map +1 -1
  113. package/dist/module/components/InlineButton.js +9 -8
  114. package/dist/module/components/InlineButton.js.map +1 -1
  115. package/dist/module/components/Input.js +28 -26
  116. package/dist/module/components/Input.js.map +1 -1
  117. package/dist/module/components/LoadingCircles.js +20 -20
  118. package/dist/module/components/LoadingCircles.js.map +1 -1
  119. package/dist/module/components/LoadingIndicator.js +11 -11
  120. package/dist/module/components/LoadingIndicator.js.map +1 -1
  121. package/dist/module/components/LoadingStateWidget.js +5 -5
  122. package/dist/module/components/LoadingStateWidget.js.map +1 -1
  123. package/dist/module/components/MediaPlayer.js +31 -31
  124. package/dist/module/components/MediaPlayer.js.map +1 -1
  125. package/dist/module/components/MiddlePopup.js +17 -11
  126. package/dist/module/components/MiddlePopup.js.map +1 -1
  127. package/dist/module/components/PDFPopup.js +52 -39
  128. package/dist/module/components/PDFPopup.js.map +1 -1
  129. package/dist/module/components/PlussChat.js +168 -149
  130. package/dist/module/components/PlussChat.js.map +1 -1
  131. package/dist/module/components/PlussChatMessage.js +42 -42
  132. package/dist/module/components/PlussChatMessage.js.map +1 -1
  133. package/dist/module/components/PlussChatTime.js +18 -17
  134. package/dist/module/components/PlussChatTime.js.map +1 -1
  135. package/dist/module/components/Popup.js +20 -19
  136. package/dist/module/components/Popup.js.map +1 -1
  137. package/dist/module/components/PopupMenu.js +15 -14
  138. package/dist/module/components/PopupMenu.js.map +1 -1
  139. package/dist/module/components/PositionedImage.js +20 -20
  140. package/dist/module/components/PositionedImage.js.map +1 -1
  141. package/dist/module/components/ProfilePic.js +10 -10
  142. package/dist/module/components/ProfilePic.js.map +1 -1
  143. package/dist/module/components/RadioButton.js +10 -9
  144. package/dist/module/components/RadioButton.js.map +1 -1
  145. package/dist/module/components/Reaction.js +18 -17
  146. package/dist/module/components/Reaction.js.map +1 -1
  147. package/dist/module/components/Reactions.js +7 -7
  148. package/dist/module/components/Reactions.js.map +1 -1
  149. package/dist/module/components/SharingTools.js +78 -43
  150. package/dist/module/components/SharingTools.js.map +1 -1
  151. package/dist/module/components/Spinner.js +5 -5
  152. package/dist/module/components/Spinner.js.map +1 -1
  153. package/dist/module/components/StickyFooter.js +6 -6
  154. package/dist/module/components/StickyFooter.js.map +1 -1
  155. package/dist/module/components/Text.js +57 -0
  156. package/dist/module/components/Text.js.map +1 -0
  157. package/dist/module/components/TickIcon.js +6 -6
  158. package/dist/module/components/TickIcon.js.map +1 -1
  159. package/dist/module/components/Toggle.js +10 -9
  160. package/dist/module/components/Toggle.js.map +1 -1
  161. package/dist/module/components/TouchableSearchBar.js +18 -17
  162. package/dist/module/components/TouchableSearchBar.js.map +1 -1
  163. package/dist/module/components/UserListPopup.js +20 -19
  164. package/dist/module/components/UserListPopup.js.map +1 -1
  165. package/dist/module/components/UserListing.js +41 -40
  166. package/dist/module/components/UserListing.js.map +1 -1
  167. package/dist/module/components/VideoPopup.js +20 -20
  168. package/dist/module/components/VideoPopup.js.map +1 -1
  169. package/dist/module/components/WarningPopup.js +21 -20
  170. package/dist/module/components/WarningPopup.js.map +1 -1
  171. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
  172. package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
  173. package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
  174. package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
  175. package/dist/module/components/index.js +59 -58
  176. package/dist/module/components/index.js.map +1 -1
  177. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
  178. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
  179. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
  180. package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
  181. package/dist/module/config.js +15 -10
  182. package/dist/module/config.js.map +1 -1
  183. package/dist/module/constants.js +3 -4
  184. package/dist/module/constants.js.map +1 -1
  185. package/dist/module/helper.js +83 -82
  186. package/dist/module/helper.js.map +1 -1
  187. package/dist/module/index.js +12 -12
  188. package/dist/module/index.js.map +1 -1
  189. package/dist/module/js/images/detectFaces.js +11 -10
  190. package/dist/module/js/images/detectFaces.js.map +1 -1
  191. package/dist/module/js/images/findLandmarkRange.js +8 -8
  192. package/dist/module/js/images/findLandmarkRange.js.map +1 -1
  193. package/dist/module/js/images/getScaledOffset.js.map +1 -1
  194. package/dist/module/js/site/getSiteLevelFromState.js +2 -2
  195. package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
  196. package/dist/module/js/site/isTVEnabled.js +2 -2
  197. package/dist/module/js/site/isTVEnabled.js.map +1 -1
  198. package/dist/module/session.js +6 -6
  199. package/dist/module/session.js.map +1 -1
  200. package/dist/module/styles.js +17 -17
  201. package/dist/module/styles.js.map +1 -1
  202. package/dist/module/withNavigationFocus.js +30 -0
  203. package/dist/module/withNavigationFocus.js.map +1 -0
  204. package/package.json +71 -68
  205. package/src/actions/FollowerActions.js +36 -32
  206. package/src/actions/MediaActions.js +25 -20
  207. package/src/actions/ResidentActions.js +26 -21
  208. package/src/actions/UserActions.js +22 -22
  209. package/src/actions/UserSettingsActions.js +11 -11
  210. package/src/actions/index.js +5 -5
  211. package/src/actions/types.js +16 -16
  212. package/src/apis/analyticsActions.js +17 -17
  213. package/src/apis/contactActions.js +20 -20
  214. package/src/apis/eventActions.js +153 -144
  215. package/src/apis/fileActions.js +96 -86
  216. package/src/apis/followerActions.js +29 -29
  217. package/src/apis/index.js +12 -12
  218. package/src/apis/notificationActions.js +44 -44
  219. package/src/apis/profileActions.js +8 -8
  220. package/src/apis/reactionActions.js +81 -73
  221. package/src/apis/settingActions.js +15 -15
  222. package/src/apis/stringActions.js +29 -25
  223. package/src/apis/typeActions.js +10 -10
  224. package/src/apis/userActions.js +93 -93
  225. package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
  226. package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
  227. package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
  228. package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
  229. package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
  230. package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
  231. package/src/colours.js +116 -96
  232. package/src/components/AddButton.js +32 -27
  233. package/src/components/AddToCalendarButton.js +236 -202
  234. package/src/components/Attachment.js +59 -36
  235. package/src/components/AudienceSelectorLauncher.js +52 -48
  236. package/src/components/AudienceSelectorPage.js +353 -311
  237. package/src/components/AutoOffsetImage.js +237 -196
  238. package/src/components/BackButton.js +57 -41
  239. package/src/components/CalendarPopup.js +127 -97
  240. package/src/components/CategoryTabs.js +208 -163
  241. package/src/components/CommentReply.js +370 -309
  242. package/src/components/CommentSection.js +974 -781
  243. package/src/components/ConfirmPopup.js +141 -110
  244. package/src/components/ConfirmationPopup.js +80 -69
  245. package/src/components/DocumentUploader.js +245 -215
  246. package/src/components/DropDownItem.js +70 -60
  247. package/src/components/DropDownMenu.js +31 -27
  248. package/src/components/EmptyStateMain.js +51 -44
  249. package/src/components/EmptyStateWidget.js +47 -38
  250. package/src/components/FontScaleButton.js +29 -25
  251. package/src/components/FontScalePopup.js +67 -56
  252. package/src/components/Forbidden.js +48 -46
  253. package/src/components/FormCard.js +21 -17
  254. package/src/components/FormCardSection.js +284 -233
  255. package/src/components/FormCardSectionOptionLauncher.js +72 -46
  256. package/src/components/FormattedText.js +128 -111
  257. package/src/components/GenericInput.js +168 -136
  258. package/src/components/GenericInputSection.js +209 -161
  259. package/src/components/Header.js +620 -474
  260. package/src/components/Icon.js +119 -0
  261. package/src/components/ImagePopup.js +425 -221
  262. package/src/components/ImageUploadProgress.js +49 -41
  263. package/src/components/ImageUploader.js +968 -797
  264. package/src/components/InlineButton.js +79 -69
  265. package/src/components/Input.js +190 -156
  266. package/src/components/LoadingCircles.js +233 -233
  267. package/src/components/LoadingIndicator.js +87 -76
  268. package/src/components/LoadingStateWidget.js +47 -37
  269. package/src/components/MediaPlayer.js +416 -387
  270. package/src/components/MiddlePopup.js +62 -33
  271. package/src/components/PDFPopup.js +212 -159
  272. package/src/components/PlussChat.js +1224 -1025
  273. package/src/components/PlussChatMessage.js +329 -298
  274. package/src/components/PlussChatTime.js +57 -53
  275. package/src/components/Popup.js +138 -116
  276. package/src/components/PopupMenu.js +140 -110
  277. package/src/components/PositionedImage.js +281 -237
  278. package/src/components/ProfilePic.js +122 -113
  279. package/src/components/RadioButton.js +76 -52
  280. package/src/components/Reaction.js +134 -96
  281. package/src/components/Reactions.js +65 -63
  282. package/src/components/SharingTools.js +185 -134
  283. package/src/components/Spinner.js +13 -13
  284. package/src/components/StickyFooter.js +36 -26
  285. package/src/components/Text.js +62 -0
  286. package/src/components/TickIcon.js +20 -20
  287. package/src/components/Toggle.js +74 -73
  288. package/src/components/TouchableSearchBar.js +68 -50
  289. package/src/components/UserListPopup.js +161 -124
  290. package/src/components/UserListing.js +273 -238
  291. package/src/components/VideoPopup.js +110 -96
  292. package/src/components/WarningPopup.js +92 -71
  293. package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
  294. package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
  295. package/src/components/index.js +59 -58
  296. package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
  297. package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
  298. package/src/config.js +26 -21
  299. package/src/constants.js +8 -10
  300. package/src/helper.js +469 -438
  301. package/src/index.js +24 -12
  302. package/src/js/images/detectFaces.js +28 -21
  303. package/src/js/images/findLandmarkRange.js +97 -90
  304. package/src/js/images/getScaledOffset.js +80 -75
  305. package/src/js/site/getSiteLevelFromState.js +26 -26
  306. package/src/js/site/isTVEnabled.js +10 -10
  307. package/src/session.js +32 -32
  308. package/src/styles.js +61 -61
  309. package/src/withNavigationFocus.js +28 -0
  310. package/dist/module/components/TextStyle.js +0 -45
  311. package/dist/module/components/TextStyle.js.map +0 -1
  312. package/dist/module/fonts/index.js +0 -2
  313. package/dist/module/fonts/index.js.map +0 -1
  314. package/dist/module/fonts/pluss60-icons.js +0 -5
  315. package/dist/module/fonts/pluss60-icons.js.map +0 -1
  316. package/dist/module/fonts/pluss60-icons.json +0 -1097
  317. package/src/components/TextStyle.js +0 -48
  318. package/src/fonts/index.js +0 -1
  319. package/src/fonts/pluss60-icons.js +0 -7
  320. package/src/fonts/pluss60-icons.json +0 -1097
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","View","Animated","PanResponder","Image","StyleSheet","Icon","BOXGREY","TEXT_LIGHT","PositionedImage","constructor","props","_defineProperty","getSize","source","uri","imageWidth","imageHeight","newWidth","width","newHeight","height","setState","isVertical","showGuide","onPositionEnd","onDimensionAvailable","offset","state","actual","x","y","imagePosition","setValue","setTimeout","timing","animatedOpacity","toValue","duration","useNativeDriver","start","lastPos","ValueXY","addListener","value","imagePanResponder","create","onStartShouldSetPanResponder","startPos","onPositionStart","panning","onPanResponderMove","event","gesture","newPos","dy","dx","onPanResponderTerminationRequest","onPanResponderRelease","endPos","endY","limitY","endX","limitX","spring","onPanResponderTerminate","Value","componentDidMount","calculateDimensions","componentDidUpdate","prevProps","renderGrid","createElement","style","styles","gridContainer","gridHorizontal","gridVertical","renderGuide","guideContainer","opacity","guideIconContainer","flexDirection","name","type","iconStyle","guideIcon","guideIconDisabled","render","container","_extends","getLayout","panHandlers","overflow","backgroundColor","position","top","right","bottom","left","alignItems","justifyContent","color","fontSize","margin","borderBottomWidth","borderBottomColor","borderLeftWidth","borderLeftColor"],"sources":["PositionedImage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Animated, PanResponder, Image, StyleSheet } from 'react-native';\nimport { Icon } from '@rneui/themed';\nimport { BOXGREY, TEXT_LIGHT } from '../colours';\n\nclass PositionedImage extends Component {\n constructor(props) {\n super(props);\n\n this.lastPos = { x: 0, y: 0 };\n this.imagePosition = new Animated.ValueXY(this.lastPos);\n this.imagePosition.addListener(value => {\n this.lastPos = value;\n });\n const imagePanResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => {\n this.startPos = this.lastPos;\n if (this.props.onPositionEnd) {\n if (this.props.onPositionStart) this.props.onPositionStart();\n this.setState({ panning: true });\n return true;\n }\n return false;\n },\n onPanResponderMove: (event, gesture) => {\n const newPos = this.state.isVertical ? { x: 0, y: this.startPos.y + gesture.dy } : { x: this.startPos.x + gesture.dx, y: 0 };\n this.imagePosition.setValue(newPos);\n },\n onPanResponderTerminationRequest: (event, gesture) => true,\n onPanResponderRelease: (event, gesture) => {\n let endPos = { x: 0, y: 0 };\n if (this.state.isVertical) {\n const endY = this.startPos.y + gesture.dy;\n const limitY = this.props.height - this.state.imageHeight;\n if (endY > 0) {\n // console.log('top reached', endY);\n endPos = { x: 0, y: 0 };\n } else if (endY < limitY) {\n // console.log('bottom reached', endY, limitY);\n endPos = { x: 0, y: limitY };\n } else {\n endPos = { x: 0, y: endY };\n }\n } else {\n const endX = this.startPos.x + gesture.dx;\n const limitX = this.props.width - this.state.imageWidth;\n if (endX > 0) {\n // console.log('left reached', endX);\n endPos = { x: 0, y: 0 };\n } else if (endX < limitX) {\n // console.log('right reached', endX, limitX);\n endPos = { x: limitX, y: 0 };\n } else {\n endPos = { x: endX, y: 0 };\n }\n }\n Animated.spring(this.imagePosition, { toValue: endPos, useNativeDriver: false }).start();\n\n if (this.props.onPositionEnd)\n this.props.onPositionEnd({\n x: endPos.x / this.state.imageWidth,\n y: endPos.y / this.state.imageHeight,\n });\n\n this.setState({ panning: false });\n },\n onPanResponderTerminate: (event, gesture) => {\n this.setState({ panning: false });\n },\n });\n\n this.state = {\n imageWidth: 0,\n imageHeight: 0,\n imagePanResponder,\n isVertical: true,\n showGuide: false,\n animatedOpacity: new Animated.Value(1),\n panning: false,\n };\n }\n\n componentDidMount() {\n this.calculateDimensions();\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.source.uri !== this.props.source.uri) {\n // console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);\n this.calculateDimensions();\n }\n }\n\n calculateDimensions = () => {\n Image.getSize(this.props.source.uri, (imageWidth, imageHeight) => {\n // Default vertical positioning\n const newWidth = this.props.width;\n const newHeight = imageHeight * (this.props.width / imageWidth);\n\n if (newHeight < this.props.height) {\n // If vertical positioning isn't possible, enable horizontal positioning\n this.setState(\n {\n imageWidth: imageWidth * (this.props.height / imageHeight),\n imageHeight: this.props.height,\n isVertical: false,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n } else {\n this.setState(\n {\n imageWidth: newWidth,\n imageHeight: newHeight,\n isVertical: true,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n }\n });\n };\n\n onDimensionAvailable = () => {\n const { offset } = this.props;\n const { imageWidth, imageHeight, isVertical } = this.state;\n\n if (offset) {\n // Apply percentage offset\n const actual = {\n x: offset.x * imageWidth,\n y: offset.y * imageHeight,\n };\n this.imagePosition.setValue(actual);\n } else {\n // Centered by default\n this.imagePosition.setValue({\n x: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,\n y: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0,\n });\n }\n\n if (this.props.onPositionEnd) {\n setTimeout(() => {\n Animated.timing(this.state.animatedOpacity, {\n toValue: 0,\n duration: 900,\n useNativeDriver: false,\n }).start(() => {\n this.setState({ showGuide: false });\n });\n }, 1000);\n }\n };\n\n renderGrid() {\n if (!this.state.panning) return null;\n return (\n <View style={styles.gridContainer}>\n <View style={styles.gridHorizontal} />\n <View style={styles.gridVertical} />\n </View>\n );\n }\n\n renderGuide() {\n if (!this.state.showGuide) return null;\n const { animatedOpacity, isVertical } = this.state;\n return (\n <Animated.View style={[styles.guideContainer, { opacity: animatedOpacity }]}>\n <View style={[styles.guideIconContainer, { flexDirection: 'column' }]}>\n <Icon name=\"arrow-up\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-down\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n </View>\n <View style={[styles.guideIconContainer, { flexDirection: 'row' }]}>\n <Icon name=\"arrow-left\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-right\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n </View>\n </Animated.View>\n );\n }\n\n render() {\n const { imageWidth, imageHeight, imagePanResponder } = this.state;\n\n return (\n <View style={[styles.container, { width: this.props.width, height: this.props.height }, this.props.style]}>\n <Animated.Image\n source={this.props.source}\n style={[{ width: imageWidth, height: imageHeight }, this.imagePosition.getLayout()]}\n {...imagePanResponder.panHandlers}\n />\n {this.renderGrid()}\n {this.renderGuide()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n backgroundColor: BOXGREY,\n },\n guideContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#0006',\n },\n guideIconContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n },\n guideIcon: {\n color: '#fff',\n fontSize: 50,\n margin: 15,\n },\n guideIconDisabled: {\n color: TEXT_LIGHT,\n },\n gridContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n gridHorizontal: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n height: '50%',\n borderBottomWidth: 1,\n borderBottomColor: BOXGREY,\n },\n gridVertical: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n width: '50%',\n borderLeftWidth: 1,\n borderLe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}
1
+ {"version":3,"names":["React","Component","View","Animated","PanResponder","Image","StyleSheet","Icon","BOXGREY","TEXT_LIGHT","PositionedImage","constructor","props","_defineProperty","getSize","source","uri","imageWidth","imageHeight","newWidth","width","newHeight","height","setState","isVertical","showGuide","onPositionEnd","onDimensionAvailable","offset","state","actual","x","y","imagePosition","setValue","setTimeout","timing","animatedOpacity","toValue","duration","useNativeDriver","start","lastPos","ValueXY","addListener","value","imagePanResponder","create","onStartShouldSetPanResponder","startPos","onPositionStart","panning","onPanResponderMove","event","gesture","newPos","dy","dx","onPanResponderTerminationRequest","onPanResponderRelease","endPos","endY","limitY","endX","limitX","spring","onPanResponderTerminate","Value","componentDidMount","calculateDimensions","componentDidUpdate","prevProps","renderGrid","createElement","style","styles","gridContainer","gridHorizontal","gridVertical","renderGuide","guideContainer","opacity","guideIconContainer","flexDirection","name","type","iconStyle","guideIcon","guideIconDisabled","render","container","_extends","getLayout","panHandlers","overflow","backgroundColor","position","top","right","bottom","left","alignItems","justifyContent","color","fontSize","margin","borderBottomWidth","borderBottomColor","borderLeftWidth","borderLeftColor"],"sources":["PositionedImage.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Animated, PanResponder, Image, StyleSheet } from \"react-native\";\nimport { Icon } from \"@rneui/themed\";\nimport { BOXGREY, TEXT_LIGHT } from \"../colours\";\n\nclass PositionedImage extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.lastPos = { x: 0, y: 0 };\n\t\tthis.imagePosition = new Animated.ValueXY(this.lastPos);\n\t\tthis.imagePosition.addListener((value) => {\n\t\t\tthis.lastPos = value;\n\t\t});\n\t\tconst imagePanResponder = PanResponder.create({\n\t\t\tonStartShouldSetPanResponder: () => {\n\t\t\t\tthis.startPos = this.lastPos;\n\t\t\t\tif (this.props.onPositionEnd) {\n\t\t\t\t\tif (this.props.onPositionStart) this.props.onPositionStart();\n\t\t\t\t\tthis.setState({ panning: true });\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tonPanResponderMove: (event, gesture) => {\n\t\t\t\tconst newPos = this.state.isVertical\n\t\t\t\t\t? { x: 0, y: this.startPos.y + gesture.dy }\n\t\t\t\t\t: { x: this.startPos.x + gesture.dx, y: 0 };\n\t\t\t\tthis.imagePosition.setValue(newPos);\n\t\t\t},\n\t\t\tonPanResponderTerminationRequest: (event, gesture) => true,\n\t\t\tonPanResponderRelease: (event, gesture) => {\n\t\t\t\tlet endPos = { x: 0, y: 0 };\n\t\t\t\tif (this.state.isVertical) {\n\t\t\t\t\tconst endY = this.startPos.y + gesture.dy;\n\t\t\t\t\tconst limitY = this.props.height - this.state.imageHeight;\n\t\t\t\t\tif (endY > 0) {\n\t\t\t\t\t\t// console.log('top reached', endY);\n\t\t\t\t\t\tendPos = { x: 0, y: 0 };\n\t\t\t\t\t} else if (endY < limitY) {\n\t\t\t\t\t\t// console.log('bottom reached', endY, limitY);\n\t\t\t\t\t\tendPos = { x: 0, y: limitY };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendPos = { x: 0, y: endY };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst endX = this.startPos.x + gesture.dx;\n\t\t\t\t\tconst limitX = this.props.width - this.state.imageWidth;\n\t\t\t\t\tif (endX > 0) {\n\t\t\t\t\t\t// console.log('left reached', endX);\n\t\t\t\t\t\tendPos = { x: 0, y: 0 };\n\t\t\t\t\t} else if (endX < limitX) {\n\t\t\t\t\t\t// console.log('right reached', endX, limitX);\n\t\t\t\t\t\tendPos = { x: limitX, y: 0 };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendPos = { x: endX, y: 0 };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAnimated.spring(this.imagePosition, {\n\t\t\t\t\ttoValue: endPos,\n\t\t\t\t\tuseNativeDriver: false,\n\t\t\t\t}).start();\n\n\t\t\t\tif (this.props.onPositionEnd)\n\t\t\t\t\tthis.props.onPositionEnd({\n\t\t\t\t\t\tx: endPos.x / this.state.imageWidth,\n\t\t\t\t\t\ty: endPos.y / this.state.imageHeight,\n\t\t\t\t\t});\n\n\t\t\t\tthis.setState({ panning: false });\n\t\t\t},\n\t\t\tonPanResponderTerminate: (event, gesture) => {\n\t\t\t\tthis.setState({ panning: false });\n\t\t\t},\n\t\t});\n\n\t\tthis.state = {\n\t\t\timageWidth: 0,\n\t\t\timageHeight: 0,\n\t\t\timagePanResponder,\n\t\t\tisVertical: true,\n\t\t\tshowGuide: false,\n\t\t\tanimatedOpacity: new Animated.Value(1),\n\t\t\tpanning: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.calculateDimensions();\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (prevProps.source.uri !== this.props.source.uri) {\n\t\t\t// console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);\n\t\t\tthis.calculateDimensions();\n\t\t}\n\t}\n\n\tcalculateDimensions = () => {\n\t\tImage.getSize(this.props.source.uri, (imageWidth, imageHeight) => {\n\t\t\t// Default vertical positioning\n\t\t\tconst newWidth = this.props.width;\n\t\t\tconst newHeight = imageHeight * (this.props.width / imageWidth);\n\n\t\t\tif (newHeight < this.props.height) {\n\t\t\t\t// If vertical positioning isn't possible, enable horizontal positioning\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\timageWidth: imageWidth * (this.props.height / imageHeight),\n\t\t\t\t\t\timageHeight: this.props.height,\n\t\t\t\t\t\tisVertical: false,\n\t\t\t\t\t\tshowGuide: this.props.onPositionEnd ? true : false,\n\t\t\t\t\t},\n\t\t\t\t\tthis.onDimensionAvailable,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\timageWidth: newWidth,\n\t\t\t\t\t\timageHeight: newHeight,\n\t\t\t\t\t\tisVertical: true,\n\t\t\t\t\t\tshowGuide: this.props.onPositionEnd ? true : false,\n\t\t\t\t\t},\n\t\t\t\t\tthis.onDimensionAvailable,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t};\n\n\tonDimensionAvailable = () => {\n\t\tconst { offset } = this.props;\n\t\tconst { imageWidth, imageHeight, isVertical } = this.state;\n\n\t\tif (offset) {\n\t\t\t// Apply percentage offset\n\t\t\tconst actual = {\n\t\t\t\tx: offset.x * imageWidth,\n\t\t\t\ty: offset.y * imageHeight,\n\t\t\t};\n\t\t\tthis.imagePosition.setValue(actual);\n\t\t} else {\n\t\t\t// Centered by default\n\t\t\tthis.imagePosition.setValue({\n\t\t\t\tx: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,\n\t\t\t\ty: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0,\n\t\t\t});\n\t\t}\n\n\t\tif (this.props.onPositionEnd) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tAnimated.timing(this.state.animatedOpacity, {\n\t\t\t\t\ttoValue: 0,\n\t\t\t\t\tduration: 900,\n\t\t\t\t\tuseNativeDriver: false,\n\t\t\t\t}).start(() => {\n\t\t\t\t\tthis.setState({ showGuide: false });\n\t\t\t\t});\n\t\t\t}, 1000);\n\t\t}\n\t};\n\n\trenderGrid() {\n\t\tif (!this.state.panning) return null;\n\t\treturn (\n\t\t\t<View style={styles.gridContainer}>\n\t\t\t\t<View style={styles.gridHorizontal} />\n\t\t\t\t<View style={styles.gridVertical} />\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderGuide() {\n\t\tif (!this.state.showGuide) return null;\n\t\tconst { animatedOpacity, isVertical } = this.state;\n\t\treturn (\n\t\t\t<Animated.View\n\t\t\t\tstyle={[styles.guideContainer, { opacity: animatedOpacity }]}\n\t\t\t>\n\t\t\t\t<View style={[styles.guideIconContainer, { flexDirection: \"column\" }]}>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-up\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\t!isVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-down\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\t!isVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<View style={[styles.guideIconContainer, { flexDirection: \"row\" }]}>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-left\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\tisVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"arrow-right\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.guideIcon,\n\t\t\t\t\t\t\tisVertical && styles.guideIconDisabled,\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</Animated.View>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { imageWidth, imageHeight, imagePanResponder } = this.state;\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.container,\n\t\t\t\t\t{ width: this.props.width, height: this.props.height },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<Animated.Image\n\t\t\t\t\tsource={this.props.source}\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\t{ width: imageWidth, height: imageHeight },\n\t\t\t\t\t\tthis.imagePosition.getLayout(),\n\t\t\t\t\t]}\n\t\t\t\t\t{...imagePanResponder.panHandlers}\n\t\t\t\t/>\n\t\t\t\t{this.renderGrid()}\n\t\t\t\t{this.renderGuide()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\toverflow: \"hidden\",\n\t\tbackgroundColor: BOXGREY,\n\t},\n\tguideContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tbackgroundColor: \"#0006\",\n\t},\n\tguideIconContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tguideIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 50,\n\t\tmargin: 15,\n\t},\n\tguideIconDisabled: {\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tgridContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\tleft: 0,\n\t},\n\tgridHorizontal: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tleft: 0,\n\t\theight: \"50%\",\n\t\tborderBottomWidth: 1,\n\t\tborderBottomColor: BOXGREY,\n\t},\n\tgridVertical: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tright: 0,\n\t\tbottom: 0,\n\t\twidth: \"50%\",\n\t\tborderLeftWidth: 1,\n\t\tborderLeftColor: BOXGREY,\n\t},\n});\n\nexport default PositionedImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,UAAU,QAAQ,cAAc;AAC9E,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,EAAEC,UAAU,QAAQ,YA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e,EAAE;EAClB,CAAC;EACDb,kBAAkB,EAAE;IACnBc,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACjB,CAAC;EACDf,SAAS,EAAE;IACVgB,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE;EACT,CAAC;EACDjB,iBAAiB,EAAE;IAClBe,KAAK,EAAE9F;EACR,CAAC;EACDmE,aAAa,EAAE;IACdoB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE;EACP,CAAC;EACDvB,cAAc,EAAE;IACfmB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRE,IAAI,EAAE,CAAC;IACP9E,MAAM,EAAE,KAAK;IACboF,iBAAiB,EAAE,CAAC;IACpBC,iBAAiB,EAAEnG;EACpB,CAAC;EACDsE,YAAY,EAAE;IACbkB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT/E,KAAK,EAAE,KAAK;IACZwF,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAErG;EAClB;AACD,CAAC,CAAC;AAEF,eAAeE,eAAe","ignoreList":[]}
@@ -1,9 +1,9 @@
1
- import React, { Component } from 'react';
2
- import { View, ImageBackground } from 'react-native';
3
- import { connect } from 'react-redux';
4
- import Config from '../config';
5
- import { Spinner } from './Spinner';
6
- import { LINEGREY, getMainBrandingColourFromState } from '../colours';
1
+ import React, { Component } from "react";
2
+ import { View, ImageBackground } from "react-native";
3
+ import { connect } from "react-redux";
4
+ import Config from "../config";
5
+ import { Spinner } from "./Spinner";
6
+ import { LINEGREY, getMainBrandingColourFromState } from "../colours";
7
7
  class ProfilePic extends Component {
8
8
  constructor(props) {
9
9
  super(props);
@@ -40,15 +40,15 @@ class ProfilePic extends Component {
40
40
  if (this.state.imageUploading) {
41
41
  return /*#__PURE__*/React.createElement(Spinner, {
42
42
  style: {
43
- backgroundColor: 'white',
43
+ backgroundColor: "white",
44
44
  borderRadius: this.state.imageBorderRadius
45
45
  }
46
46
  });
47
47
  }
48
48
  let image = Config.env.defaultProfileImage;
49
49
  let isDefault = true;
50
- if (this.state.image !== null && typeof this.state.image === 'string') {
51
- if (this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' && this.state.image !== 'https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg' && this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' && this.state.image !== 'https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg') {
50
+ if (this.state.image !== null && typeof this.state.image === "string") {
51
+ if (this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg") {
52
52
  image = {
53
53
  uri: this.state.image
54
54
  };
@@ -92,7 +92,7 @@ const styles = {
92
92
  },
93
93
  bordered: {
94
94
  borderWidth: 1,
95
- borderColor: '#fff'
95
+ borderColor: "#fff"
96
96
  }
97
97
  };
98
98
  const mapStateToProps = state => {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","View","ImageBackground","connect","Config","Spinner","LINEGREY","getMainBrandingColourFromState","ProfilePic","constructor","props","state","image","imageBorderRadius","imageUploading","backgroundFill","UNSAFE_componentWillMount","setState","env","defaultProfileImage","imageDiameterStyle","height","Diameter","width","ImageUploading","tinyChatDefault","UNSAFE_componentWillReceiveProps","nextProps","profPic","renderImage","createElement","style","backgroundColor","borderRadius","isDefault","uri","key","source","styles","profilePicImage","colourBrandingMain","imageStyle","children","render","profilePicOuter","bordered","id","zIndex","flex","borderWidth","borderColor","mapStateToProps","profilePic"],"sources":["ProfilePic.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, ImageBackground } from 'react-native';\nimport { connect } from 'react-redux';\nimport Config from '../config';\nimport { Spinner } from './Spinner';\nimport { LINEGREY, getMainBrandingColourFromState } from '../colours';\n\nclass ProfilePic extends Component {\n constructor(props) {\n super(props);\n this.state = {\n image: null,\n imageBorderRadius: 18,\n imageUploading: false,\n backgroundFill: false,\n };\n }\n\n UNSAFE_componentWillMount() {\n this.setState({\n image: this.props.ProfilePic != null ? this.props.ProfilePic : Config.env.defaultProfileImage,\n imageDiameterStyle: {\n height: this.props.Diameter != null ? this.props.Diameter : 35,\n width: this.props.Diameter != null ? this.props.Diameter : 35,\n },\n imageBorderRadius: this.props.Diameter != null ? this.props.Diameter / 2 : 18,\n imageUploading: this.props.ImageUploading,\n backgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault,\n });\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n let profPic = null;\n if (nextProps.ProfilePic) {\n profPic = nextProps.ProfilePic;\n }\n\n this.setState({\n image: profPic,\n imageUploading: nextProps.ImageUploading,\n });\n }\n\n renderImage() {\n if (this.state.imageUploading) {\n return (\n <Spinner\n style={{\n backgroundColor: 'white',\n borderRadius: this.state.imageBorderRadius,\n }}\n />\n );\n }\n let image = Config.env.defaultProfileImage;\n let isDefault = true;\n if (this.state.image !== null && typeof this.state.image === 'string') {\n if (\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' &&\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg' &&\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' &&\n this.state.image !==\n 'https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg'\n ) {\n image = { uri: this.state.image };\n isDefault = false;\n }\n }\n return (\n <ImageBackground\n key=\"default\"\n source={image}\n style={[\n styles.profilePicImage,\n { borderRadius: this.state.imageBorderRadius },\n (isDefault || this.state.backgroundFill) && { backgroundColor: this.props.colourBrandingMain },\n ]}\n imageStyle={{ borderRadius: this.state.imageBorderRadius }}\n >\n {this.props.children}\n </ImageBackground>\n );\n }\n\n render() {\n return (\n <View\n style={[\n styles.profilePicOuter,\n this.state.imageDiameterStyle,\n this.props.bordered && styles.bordered,\n { borderRadius: this.state.imageBorderRadius },\n this.props.style,\n ]}\n key={this.props.id}\n >\n {this.renderImage()}\n </View>\n );\n }\n}\n\nconst styles = {\n profilePicOuter: {\n height: 35,\n width: 35,\n zIndex: 1,\n backgroundColor: LINEGREY,\n // overflow: 'hidden'\n },\n profilePicImage: {\n flex: 1,\n height: null,\n width: null,\n },\n bordered: {\n borderWidth: 1,\n borderColor: '#fff',\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst profilePic = connect(mapStateToProps, {})(ProfilePic);\nexport { profilePic as ProfilePic };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,eAAe,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM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E;QAAER,YAAY,EAAE,IAAI,CAACtB,KAAK,CAACE;MAAkB;IAAE,GAE1D,IAAI,CAACH,KAAK,CAACgC,QACG,CAAC;EAEtB;EAEAC,MAAMA,CAAA,EAAG;IACP,oBACE5C,KAAA,CAAA+B,aAAA,CAAC7B,IAAI;MACH8B,KAAK,EAAE,CACLO,MAAM,CAACM,eAAe,EACtB,IAAI,CAACjC,KAAK,CAACS,kBAAkB,EAC7B,IAAI,CAACV,KAAK,CAACmC,QAAQ,IAAIP,MAAM,CAACO,QAAQ,EACtC;QAAEZ,YAAY,EAAE,IAAI,CAACtB,KAAK,CAACE;MAAkB,CAAC,EAC9C,IAAI,CAACH,KAAK,CAACqB,KAAK,CAChB;MACFK,GAAG,EAAE,IAAI,CAAC1B,KAAK,CAACoC;IAAG,GAElB,IAAI,CAACjB,WAAW,CAAC,CACd,CAAC;EAEX;AACF;AAEA,MAAMS,MAAM,GAAG;EACbM,eAAe,EAAE;IACfvB,MAAM,EAAE,EAAE;IACVE,KAAK,EAAE,EAAE;IACTwB,MAAM,EAAE,CAAC;IACTf,eAAe,EAAE1B;IACjB;EACF,CAAC;EACDiC,eAAe,EAAE;IACfS,IAAI,EAAE,CAAC;IACP3B,MAAM,EAAE,IAAI;IACZE,KAAK,EAAE;EACT,CAAC;EACDsB,QAAQ,EAAE;IACRI,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACf;AACF,CAAC;AAED,MAAMC,eAAe,GAAGxC,KAAK,IAAI;EAC/B,OAAO;IACL6B,kBAAkB,EAAEjC,8BAA8B,CAACI,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMyC,UAAU,GAAGjD,OAAO,CAACgD,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC3C,UAAU,CAAC;AAC3D,SAAS4C,UAAU,IAAI5C,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["React","Component","View","ImageBackground","connect","Config","Spinner","LINEGREY","getMainBrandingColourFromState","ProfilePic","constructor","props","state","image","imageBorderRadius","imageUploading","backgroundFill","UNSAFE_componentWillMount","setState","env","defaultProfileImage","imageDiameterStyle","height","Diameter","width","ImageUploading","tinyChatDefault","UNSAFE_componentWillReceiveProps","nextProps","profPic","renderImage","createElement","style","backgroundColor","borderRadius","isDefault","uri","key","source","styles","profilePicImage","colourBrandingMain","imageStyle","children","render","profilePicOuter","bordered","id","zIndex","flex","borderWidth","borderColor","mapStateToProps","profilePic"],"sources":["ProfilePic.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, ImageBackground } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport Config from \"../config\";\nimport { Spinner } from \"./Spinner\";\nimport { LINEGREY, getMainBrandingColourFromState } from \"../colours\";\n\nclass ProfilePic extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\timage: null,\n\t\t\timageBorderRadius: 18,\n\t\t\timageUploading: false,\n\t\t\tbackgroundFill: false,\n\t\t};\n\t}\n\n\tUNSAFE_componentWillMount() {\n\t\tthis.setState({\n\t\t\timage:\n\t\t\t\tthis.props.ProfilePic != null\n\t\t\t\t\t? this.props.ProfilePic\n\t\t\t\t\t: Config.env.defaultProfileImage,\n\t\t\timageDiameterStyle: {\n\t\t\t\theight: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t\twidth: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t},\n\t\t\timageBorderRadius:\n\t\t\t\tthis.props.Diameter != null ? this.props.Diameter / 2 : 18,\n\t\t\timageUploading: this.props.ImageUploading,\n\t\t\tbackgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault,\n\t\t});\n\t}\n\n\tUNSAFE_componentWillReceiveProps(nextProps) {\n\t\tlet profPic = null;\n\t\tif (nextProps.ProfilePic) {\n\t\t\tprofPic = nextProps.ProfilePic;\n\t\t}\n\n\t\tthis.setState({\n\t\t\timage: profPic,\n\t\t\timageUploading: nextProps.ImageUploading,\n\t\t});\n\t}\n\n\trenderImage() {\n\t\tif (this.state.imageUploading) {\n\t\t\treturn (\n\t\t\t\t<Spinner\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: \"white\",\n\t\t\t\t\t\tborderRadius: this.state.imageBorderRadius,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tlet image = Config.env.defaultProfileImage;\n\t\tlet isDefault = true;\n\t\tif (this.state.image !== null && typeof this.state.image === \"string\") {\n\t\t\tif (\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg\"\n\t\t\t) {\n\t\t\t\timage = { uri: this.state.image };\n\t\t\t\tisDefault = false;\n\t\t\t}\n\t\t}\n\t\treturn (\n\t\t\t<ImageBackground\n\t\t\t\tkey=\"default\"\n\t\t\t\tsource={image}\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicImage,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\t(isDefault || this.state.backgroundFill) && {\n\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t\timageStyle={{ borderRadius: this.state.imageBorderRadius }}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</ImageBackground>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicOuter,\n\t\t\t\t\tthis.state.imageDiameterStyle,\n\t\t\t\t\tthis.props.bordered && styles.bordered,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t\tkey={this.props.id}\n\t\t\t>\n\t\t\t\t{this.renderImage()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tprofilePicOuter: {\n\t\theight: 35,\n\t\twidth: 35,\n\t\tzIndex: 1,\n\t\tbackgroundColor: LINEGREY,\n\t\t// overflow: 'hidden'\n\t},\n\tprofilePicImage: {\n\t\tflex: 1,\n\t\theight: null,\n\t\twidth: null,\n\t},\n\tbordered: {\n\t\tborderWidth: 1,\n\t\tborderColor: \"#fff\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst profilePic = connect(mapStateToProps, {})(ProfilePic);\nexport { profilePic as ProfilePic };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,eAAe,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,EAAEC,8BAA8B,QAAQ,YAAY;AAErE,MAAMC,UAAU,SAASR,SAAS,CAAC;EAClCS,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MACZC,KAAK,EAAE,IAAI;MACXC,iBAAiB,EAAE,EAAE;MACrBC,cAAc,EAAE,KAAK;MACrBC,cAAc,EAAE;IACjB,CAAC;EACF;EAEAC,yBAAyBA,CAAA,EAAG;IAC3B,IAAI,CAACC,QAAQ,CAAC;MACbL,KAAK,EACJ,IAAI,CAACF,KAAK,CAACF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ACf;MACFK,GAAG,EAAE,IAAI,CAAC1B,KAAK,CAACoC;IAAG,GAElB,IAAI,CAACjB,WAAW,CAAC,CACb,CAAC;EAET;AACD;AAEA,MAAMS,MAAM,GAAG;EACdM,eAAe,EAAE;IAChBvB,MAAM,EAAE,EAAE;IACVE,KAAK,EAAE,EAAE;IACTwB,MAAM,EAAE,CAAC;IACTf,eAAe,EAAE1B;IACjB;EACD,CAAC;EACDiC,eAAe,EAAE;IAChBS,IAAI,EAAE,CAAC;IACP3B,MAAM,EAAE,IAAI;IACZE,KAAK,EAAE;EACR,CAAC;EACDsB,QAAQ,EAAE;IACTI,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACd;AACD,CAAC;AAED,MAAMC,eAAe,GAAIxC,KAAK,IAAK;EAClC,OAAO;IACN6B,kBAAkB,EAAEjC,8BAA8B,CAACI,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMyC,UAAU,GAAGjD,OAAO,CAACgD,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC3C,UAAU,CAAC;AAC3D,SAAS4C,UAAU,IAAI5C,UAAU","ignoreList":[]}
@@ -1,7 +1,8 @@
1
- import React, { PureComponent } from 'react';
2
- import { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, Text } from 'react-native';
3
- import { connect } from 'react-redux';
4
- import { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from '../colours';
1
+ import React, { PureComponent } from "react";
2
+ import { Text } from "@plusscommunities/pluss-core-app/components";
3
+ import { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet } from "react-native";
4
+ import { connect } from "react-redux";
5
+ import { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from "../colours";
5
6
  class RadioButton extends PureComponent {
6
7
  render() {
7
8
  const {
@@ -53,16 +54,16 @@ const styles = StyleSheet.create({
53
54
  container: {
54
55
  borderColor: LINEGREY,
55
56
  borderWidth: 1,
56
- backgroundColor: '#fff',
57
- alignItems: 'center',
58
- justifyContent: 'center'
57
+ backgroundColor: "#fff",
58
+ alignItems: "center",
59
+ justifyContent: "center"
59
60
  },
60
61
  radioOption: {
61
- flexDirection: 'row',
62
+ flexDirection: "row",
62
63
  marginRight: 26
63
64
  },
64
65
  radioOptionText: {
65
- fontFamily: 'sf-medium',
66
+ fontFamily: "sf-medium",
66
67
  fontSize: 14,
67
68
  color: TEXT_DARKEST
68
69
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","PureComponent","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","Text","connect","getMainBrandingColourFromState","LINEGREY","TEXT_DARKEST","RadioButton","render","size","isActive","value","onPress","colourBrandingMain","style","label","props","iconSize","innerSize","content","createElement","styles","container","width","height","borderRadius","backgroundColor","key","radioOption","hitSlop","top","left","bottom","right","radioOptionText","create","borderColor","borderWidth","alignItems","justifyContent","flexDirection","marginRight","fontFamily","fontSize","color","mapStateToProps","state","radioButton"],"sources":["RadioButton.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from '../colours';\n\nclass RadioButton extends PureComponent {\n render() {\n const { size, isActive, value, onPress, colourBrandingMain, style, label } = this.props;\n const iconSize = size || 20;\n const innerSize = iconSize - 8;\n\n const content = (\n <TouchableWithoutFeedback onPress={() => onPress(value)}>\n <View style={[styles.container, { width: iconSize, height: iconSize, borderRadius: iconSize / 2 }, style]}>\n {isActive && (\n <View style={{ width: innerSize, height: innerSize, borderRadius: innerSize / 2, backgroundColor: colourBrandingMain }} />\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n\n if (label) {\n return (\n <TouchableOpacity\n onPress={() => onPress(value)}\n key={label}\n style={styles.radioOption}\n hitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n >\n {content}\n <Text style={styles.radioOptionText}>{label}</Text>\n </TouchableOpacity>\n );\n }\n\n return content;\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n borderColor: LINEGREY,\n borderWidth: 1,\n backgroundColor: '#fff',\n alignItems: 'center',\n justifyContent: 'center',\n },\n radioOption: {\n flexDirection: 'row',\n marginRight: 26,\n },\n radioOptionText: {\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: TEXT_DARKEST,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst radioButton = connect(mapStateToProps, {})(RadioButton);\nexport { radioButton as RadioButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACjG,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,8BAA8B,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,YAAY;AAEnF,MAAMC,WAAW,SAASV,aAAa,CAAC;EACtCW,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAAK;MAAEC,OAAO;MAAEC,kBAAkB;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAG,IAAI,CAACC,KAAK;IACvF,MAAMC,QAAQ,GAAGR,IAAI,IAAI,EAAE;IAC3B,MAAMS,SAAS,GAAGD,QAAQ,GAAG,CAAC;IAE9B,MAAME,OAAO,gBACXvB,KAAA,CAAAwB,aAAA,CAACpB,wBAAwB;MAACY,OAAO,EAAEA,CAAA,KAAMA,OAAO,CAACD,KAAK;IAAE,gBACtDf,KAAA,CAAAwB,aAAA,CAACtB,IAAI;MAACgB,KAAK,EAAE,CAACO,MAAM,CAACC,SAAS,EAAE;QAAEC,KAAK,EAAEN,QAAQ;QAAEO,MAAM,EAAEP,QAAQ;QAAEQ,YAAY,EAAER,QAAQ,GAAG;MAAE,CAAC,EAAEH,KAAK;IAAE,GACvGJ,QAAQ,iBACPd,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O,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtC,WAAW,CAAC;AAC7D,SAASwC,WAAW,IAAIxC,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["React","PureComponent","Text","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","connect","getMainBrandingColourFromState","LINEGREY","TEXT_DARKEST","RadioButton","render","size","isActive","value","onPress","colourBrandingMain","style","label","props","iconSize","innerSize","content","createElement","styles","container","width","height","borderRadius","backgroundColor","key","radioOption","hitSlop","top","left","bottom","right","radioOptionText","create","borderColor","borderWidth","alignItems","justifyContent","flexDirection","marginRight","fontFamily","fontSize","color","mapStateToProps","state","radioButton"],"sources":["RadioButton.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tView,\n\tTouchableOpacity,\n\tTouchableWithoutFeedback,\n\tStyleSheet,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport {\n\tgetMainBrandingColourFromState,\n\tLINEGREY,\n\tTEXT_DARKEST,\n} from \"../colours\";\n\nclass RadioButton extends PureComponent {\n\trender() {\n\t\tconst { size, isActive, value, onPress, colourBrandingMain, style, label } =\n\t\t\tthis.props;\n\t\tconst iconSize = size || 20;\n\t\tconst innerSize = iconSize - 8;\n\n\t\tconst content = (\n\t\t\t<TouchableWithoutFeedback onPress={() => onPress(value)}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\t{ width: iconSize, height: iconSize, borderRadius: iconSize / 2 },\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{isActive && (\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: innerSize,\n\t\t\t\t\t\t\t\theight: innerSize,\n\t\t\t\t\t\t\t\tborderRadius: innerSize / 2,\n\t\t\t\t\t\t\t\tbackgroundColor: colourBrandingMain,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\n\t\tif (label) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tonPress={() => onPress(value)}\n\t\t\t\t\tkey={label}\n\t\t\t\t\tstyle={styles.radioOption}\n\t\t\t\t\thitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n\t\t\t\t>\n\t\t\t\t\t{content}\n\t\t\t\t\t<Text style={styles.radioOptionText}>{label}</Text>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\n\t\treturn content;\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tborderColor: LINEGREY,\n\t\tborderWidth: 1,\n\t\tbackgroundColor: \"#fff\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tradioOption: {\n\t\tflexDirection: \"row\",\n\t\tmarginRight: 26,\n\t},\n\tradioOptionText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst radioButton = connect(mapStateToProps, {})(RadioButton);\nexport { radioButton as RadioButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,IAAI,EACJC,gBAAgB,EAChBC,wBAAwB,EACxBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,SACCC,8BAA8B,EAC9BC,QAAQ,EACRC,YAAY,QACN,YAAY;AAEnB,MAAMC,WAAW,SAASV,aAAa,CAAC;EACvCW,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAA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M,GAAGnB,UAAU,CAACiC,MAAM,CAAC;EAChCb,SAAS,EAAE;IACVc,WAAW,EAAE/B,QAAQ;IACrBgC,WAAW,EAAE,CAAC;IACdX,eAAe,EAAE,MAAM;IACvBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACjB,CAAC;EACDX,WAAW,EAAE;IACZY,aAAa,EAAE,KAAK;IACpBC,WAAW,EAAE;EACd,CAAC;EACDP,eAAe,EAAE;IAChBQ,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEtC;EACR;AACD,CAAC,CAAC;AAEF,MAAMuC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjC,kBAAkB,EAAET,8BAA8B,CAAC0C,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,WAAW,GAAG5C,OAAO,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtC,WAAW,CAAC;AAC7D,SAASwC,WAAW,IAAIxC,WAAW","ignoreList":[]}
@@ -1,13 +1,14 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import React, { Component } from 'react';
5
- import { View, Text, Image, TouchableOpacity } from 'react-native';
6
- import { connect } from 'react-redux';
7
- import _ from 'lodash';
8
- import { getReactions, getShadowStyle } from '../helper';
9
- import { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from '../colours';
10
- import { reactionActions } from '../apis';
4
+ import React, { Component } from "react";
5
+ import { View, Image, TouchableOpacity } from "react-native";
6
+ import { Text } from "./Text";
7
+ import { connect } from "react-redux";
8
+ import _ from "lodash";
9
+ import { getReactions, getShadowStyle } from "../helper";
10
+ import { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from "../colours";
11
+ import { reactionActions } from "../apis";
11
12
  class Reaction extends Component {
12
13
  constructor(...args) {
13
14
  super(...args);
@@ -23,12 +24,12 @@ class Reaction extends Component {
23
24
  }
24
25
  getStyleType() {
25
26
  if (this.props.reactions[this.props.userId]) {
26
- return 'ThisHL';
27
+ return "ThisHL";
27
28
  }
28
29
  if (this.props.anyHighlighted) {
29
- return 'OtherHL';
30
+ return "OtherHL";
30
31
  }
31
- return 'Default';
32
+ return "Default";
32
33
  }
33
34
  getTopReaction() {
34
35
  return _.maxBy(Object.keys(this.props.reactions), key => {
@@ -58,14 +59,14 @@ class Reaction extends Component {
58
59
  return /*#__PURE__*/React.createElement(TouchableOpacity, {
59
60
  style: styles.touchable,
60
61
  onPress: this.onPressReaction,
61
- disabled: this.props.user.type === 'KIOSK'
62
+ disabled: this.props.user.type === "KIOSK"
62
63
  }, /*#__PURE__*/React.createElement(View, {
63
64
  style: [styles.container, styles[`container${this.getStyleType()}`], this.props.style]
64
65
  }, /*#__PURE__*/React.createElement(Image, {
65
66
  style: [styles.image, this.props.imageStyle],
66
67
  source: this.props.reaction.icon
67
68
  }), /*#__PURE__*/React.createElement(Text, {
68
- style: [styles.count, this.getStyleType() === 'ThisHL' && {
69
+ style: [styles.count, this.getStyleType() === "ThisHL" && {
69
70
  color: this.props.colourBrandingMain
70
71
  }, this.props.countStyle]
71
72
  }, Object.keys(this.props.reactions).length)));
@@ -82,8 +83,8 @@ const styles = {
82
83
  height: 30,
83
84
  borderRadius: 15,
84
85
  backgroundColor: BG_GREY,
85
- flexDirection: 'row-reverse',
86
- alignItems: 'center',
86
+ flexDirection: "row-reverse",
87
+ alignItems: "center",
87
88
  paddingHorizontal: 8
88
89
  },
89
90
  containerThisHL: {
@@ -95,13 +96,13 @@ const styles = {
95
96
  image: {
96
97
  width: 20,
97
98
  height: 20,
98
- resizeMode: 'contain'
99
+ resizeMode: "contain"
99
100
  },
100
101
  count: {
101
- fontFamily: 'sf-medium',
102
+ fontFamily: "sf-medium",
102
103
  color: TEXT_DARK,
103
104
  flex: 1,
104
- textAlign: 'center',
105
+ textAlign: "center",
105
106
  fontSize: 16
106
107
  }
107
108
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","View","Text","Image","TouchableOpacity","connect","_","getReactions","getShadowStyle","BG_GREY","TEXT_DARK","getMainBrandingColourFromState","reactionActions","Reaction","constructor","args","_defineProperty","props","reactions","userId","add","entityId","entityType","reaction","key","site","onLike","remove","onUnlike","getStyleType","anyHighlighted","getTopReaction","maxBy","Object","keys","length","getIcon","topReaction","find","r","icon","render","topReactionOnly","createElement","style","styles","container","containerThisHL","image","imageStyle","source","count","countStyle","touchable","onPress","onPressReaction","disabled","user","type","color","colourBrandingMain","marginHorizontal","width","height","borderRadius","backgroundColor","flexDirection","alignItems","paddingHorizontal","containerOtherHL","opacity","resizeMode","fontFamily","flex","textAlign","fontSize","mapStateToProps","state"],"sources":["Reaction.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, Image, TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { getReactions, getShadowStyle } from '../helper';\nimport { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from '../colours';\nimport { reactionActions } from '../apis';\n\nclass Reaction extends Component {\n onPressReaction = () => {\n if (!this.props.reactions[this.props.userId]) {\n reactionActions.add(this.props.entityId, this.props.entityType, this.props.reaction.key, this.props.site);\n this.props.onLike();\n } else {\n reactionActions.remove(this.props.entityId, this.props.entityType, this.props.reaction.key);\n this.props.onUnlike();\n }\n };\n\n getStyleType() {\n if (this.props.reactions[this.props.userId]) {\n return 'ThisHL';\n }\n if (this.props.anyHighlighted) {\n return 'OtherHL';\n }\n return 'Default';\n }\n\n getTopReaction() {\n return _.maxBy(Object.keys(this.props.reactions), key => {\n return Object.keys(this.props.reactions[key]).length;\n });\n }\n\n getIcon(topReaction) {\n return _.find(getReactions(), r => {\n return r.key === topReaction;\n }).icon;\n }\n\n render() {\n if (this.props.topReactionOnly) {\n const topReaction = this.getTopReaction();\n if (!topReaction) {\n return null;\n }\n return (\n <View style={[styles.container, styles.containerThisHL, this.props.style]}>\n <Image style={[styles.image, this.props.imageStyle]} source={this.getIcon(topReaction)} />\n <Text style={[styles.count, this.props.countStyle]}>{Object.keys(this.props.reactions[topReaction]).length}</Text>\n </View>\n );\n }\n return (\n <TouchableOpacity style={styles.touchable} onPress={this.onPressReaction} disabled={this.props.user.type === 'KIOSK'}>\n <View style={[styles.container, styles[`container${this.getStyleType()}`], this.props.style]}>\n <Image style={[styles.image, this.props.imageStyle]} source={this.props.reaction.icon} />\n <Text style={[styles.count, this.getStyleType() === 'ThisHL' && { color: this.props.colourBrandingMain }, this.props.countStyle]}>\n {Object.keys(this.props.reactions).length}\n </Text>\n </View>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n touchable: {\n marginHorizontal: 4,\n width: 60,\n height: 30,\n },\n container: {\n width: 60,\n height: 30,\n borderRadius: 15,\n backgroundColor: BG_GREY,\n flexDirection: 'row-reverse',\n alignItems: 'center',\n paddingHorizontal: 8,\n },\n containerThisHL: {\n ...getShadowStyle(),\n },\n containerOtherHL: {\n opacity: 0.5,\n },\n image: {\n width: 20,\n height: 20,\n resizeMode: 'contain',\n },\n count: {\n fontFamily: 'sf-medium',\n color: TEXT_DARK,\n flex: 1,\n textAlign: 'center',\n fontSize: 16,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n user: state.user,\n };\n};\n\nconst reaction = connect(mapStateToProps, {})(Reaction);\nexport { reaction as Reaction };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,K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AAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE;EACrB,CAAC;EACDrB,eAAe,EAAE;IACf,GAAGvC,cAAc,CAAC;EACpB,CAAC;EACD6D,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDtB,KAAK,EAAE;IACLc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,UAAU,EAAE;EACd,CAAC;EACDpB,KAAK,EAAE;IACLqB,UAAU,EAAE,WAAW;IACvBb,KAAK,EAAEjD,SAAS;IAChB+D,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLjB,kBAAkB,EAAEjD,8BAA8B,CAACkE,KAAK,CAAC;IACzDpB,IAAI,EAAEoB,KAAK,CAACpB;EACd,CAAC;AACH,CAAC;AAED,MAAMlC,QAAQ,GAAGlB,OAAO,CAACuE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC/D,QAAQ,CAAC;AACvD,SAASU,QAAQ,IAAIV,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["React","Component","View","Image","TouchableOpacity","Text","connect","_","getReactions","getShadowStyle","BG_GREY","TEXT_DARK","getMainBrandingColourFromState","reactionActions","Reaction","constructor","args","_defineProperty","props","reactions","userId","add","entityId","entityType","reaction","key","site","onLike","remove","onUnlike","getStyleType","anyHighlighted","getTopReaction","maxBy","Object","keys","length","getIcon","topReaction","find","r","icon","render","topReactionOnly","createElement","style","styles","container","containerThisHL","image","imageStyle","source","count","countStyle","touchable","onPress","onPressReaction","disabled","user","type","color","colourBrandingMain","marginHorizontal","width","height","borderRadius","backgroundColor","flexDirection","alignItems","paddingHorizontal","containerOtherHL","opacity","resizeMode","fontFamily","flex","textAlign","fontSize","mapStateToProps","state"],"sources":["Reaction.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Image, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport { getReactions, getShadowStyle } from \"../helper\";\nimport { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\nimport { reactionActions } from \"../apis\";\n\nclass Reaction extends Component {\n\tonPressReaction = () => {\n\t\tif (!this.props.reactions[this.props.userId]) {\n\t\t\treactionActions.add(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t\tthis.props.site,\n\t\t\t);\n\t\t\tthis.props.onLike();\n\t\t} else {\n\t\t\treactionActions.remove(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t);\n\t\t\tthis.props.onUnlike();\n\t\t}\n\t};\n\n\tgetStyleType() {\n\t\tif (this.props.reactions[this.props.userId]) {\n\t\t\treturn \"ThisHL\";\n\t\t}\n\t\tif (this.props.anyHighlighted) {\n\t\t\treturn \"OtherHL\";\n\t\t}\n\t\treturn \"Default\";\n\t}\n\n\tgetTopReaction() {\n\t\treturn _.maxBy(Object.keys(this.props.reactions), (key) => {\n\t\t\treturn Object.keys(this.props.reactions[key]).length;\n\t\t});\n\t}\n\n\tgetIcon(topReaction) {\n\t\treturn _.find(getReactions(), (r) => {\n\t\t\treturn r.key === topReaction;\n\t\t}).icon;\n\t}\n\n\trender() {\n\t\tif (this.props.topReactionOnly) {\n\t\t\tconst topReaction = this.getTopReaction();\n\t\t\tif (!topReaction) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<View\n\t\t\t\t\tstyle={[styles.container, styles.containerThisHL, this.props.style]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.getIcon(topReaction)}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text style={[styles.count, this.props.countStyle]}>\n\t\t\t\t\t\t{Object.keys(this.props.reactions[topReaction]).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.touchable}\n\t\t\t\tonPress={this.onPressReaction}\n\t\t\t\tdisabled={this.props.user.type === \"KIOSK\"}\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\tstyles[`container${this.getStyleType()}`],\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.props.reaction.icon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.count,\n\t\t\t\t\t\t\tthis.getStyleType() === \"ThisHL\" && {\n\t\t\t\t\t\t\t\tcolor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.countStyle,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{Object.keys(this.props.reactions).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\ttouchable: {\n\t\tmarginHorizontal: 4,\n\t\twidth: 60,\n\t\theight: 30,\n\t},\n\tcontainer: {\n\t\twidth: 60,\n\t\theight: 30,\n\t\tborderRadius: 15,\n\t\tbackgroundColor: BG_GREY,\n\t\tflexDirection: \"row-reverse\",\n\t\talignItems: \"center\",\n\t\tpaddingHorizontal: 8,\n\t},\n\tcontainerThisHL: {\n\t\t...getShadowStyle(),\n\t},\n\tcontainerOtherHL: {\n\t\topacity: 0.5,\n\t},\n\timage: {\n\t\twidth: 20,\n\t\theight: 20,\n\t\tresizeMode: \"contain\",\n\t},\n\tcount: {\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: TEXT_DARK,\n\t\tflex: 1,\n\t\ttextAlign: \"center\",\n\t\tfontSize: 16,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tuser: state.user,\n\t};\n};\n\nconst reaction = connect(mapStateToProps, {})(Reaction);\nexport { reaction as Reaction };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,KAAK,EAAEC,gBAAgB,QAAQ,cAAc;AAC5D,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,OAAO,EAAEC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AAC/E,SAASC,eAAe,QAAQ,SAAS;AAEzC,MAAMC,QAAQ,SAASb,SAAS,CAAC;EAAAc,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACd,MAAM;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,SAAS,CAAC,IAAI,CAACD,KAAK,CAACE,MAAM,CAAC,EAAE;QAC7CP,eAAe,CAACQ,GAAG,CAClB,IAAI,CAACH,KAAK,CAACI,QAAQ,EACnB,IAAI,CAACJ,KAAK,CAACK,UAAU,EACrB,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACC,GAAG,EACvB,IAAI,CAACP,KAAK,CAACQ,IACZ,CAAC;QACD,IAAI,CAACR,KAAK,CAACS,MAAM,CAAC,CAAC;MACpB,CAAC,MAAM;QACNd,eAAe,CAACe,MAAM,CACrB,IAAI,CAACV,KAAK,CAACI,QAAQ,EACnB,IAAI,CAACJ,KAAK,CAACK,UAAU,EACrB,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACC,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,MAAM,CAACC,IAAI,CAAC,IAAI,CAACjB,KAAK,CAACC,SAAS,CAAC,CAACiB,MAC9B,CACD,CACW,CAAC;EAErB;AACD;AAEA,MAAMU,MAAM,GAAG;EACdQ,SAAS,EAAE;IACVQ,gBAAgB,EAAE,CAAC;IACnBC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACT,CAAC;EACDjB,SAAS,EAAE;IACVgB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAExD,OAAO;IACxByD,aAAa,EAAE,aAAa;IAC5BC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACDrB,eAAe,EAAE;IAChB,GAAGvC,cAAc,CAAC;EACnB,CAAC;EACD6D,gBAAgB,EAAE;IACjBC,OAAO,EAAE;EACV,CAAC;EACDtB,KAAK,EAAE;IACNc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,UAAU,EAAE;EACb,CAAC;EACDpB,KAAK,EAAE;IACNqB,UAAU,EAAE,WAAW;IACvBb,KAAK,EAAEjD,SAAS;IAChB+D,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjB,kBAAkB,EAAEjD,8BAA8B,CAACkE,KAAK,CAAC;IACzDpB,IAAI,EAAEoB,KAAK,CAACpB;EACb,CAAC;AACF,CAAC;AAED,MAAMlC,QAAQ,GAAGlB,OAAO,CAACuE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC/D,QAAQ,CAAC;AACvD,SAASU,QAAQ,IAAIV,QAAQ","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import React, { Component } from 'react';
5
- import { View } from 'react-native';
6
- import { getReactions, getUserPreview } from '../helper';
7
- import { Reaction } from './Reaction';
4
+ import React, { Component } from "react";
5
+ import { View } from "react-native";
6
+ import { getReactions, getUserPreview } from "../helper";
7
+ import { Reaction } from "./Reaction";
8
8
  class Reactions extends Component {
9
9
  constructor(...args) {
10
10
  super(...args);
@@ -62,9 +62,9 @@ class Reactions extends Component {
62
62
  }
63
63
  const styles = {
64
64
  container: {
65
- flexDirection: 'row',
66
- justifyContent: 'center',
67
- width: '100%'
65
+ flexDirection: "row",
66
+ justifyContent: "center",
67
+ width: "100%"
68
68
  }
69
69
  };
70
70
  export { Reactions };
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","View","getReactions","getUserPreview","Reaction","Reactions","constructor","args","_defineProperty","reactions","getReaction","key","props","entity","onLike","user","uid","onUpdateReactions","onUnlike","render","createElement","style","styles","container","state","map","r","i","reaction","entityType","entityId","anyHighlighted","userId","bind","site","flexDirection","justifyContent","width"],"sources":["Reactions.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View } from 'react-native';\nimport { getReactions, getUserPreview } from '../helper';\nimport { Reaction } from './Reaction';\n\nclass Reactions extends Component {\n state = {\n reactions: getReactions(),\n };\n\n getReaction(key) {\n if (!this.props.entity) {\n return {};\n }\n if (!this.props.entity.Reactions) {\n this.props.entity.Reactions = {};\n }\n return this.props.entity.Reactions[key] || {};\n }\n\n onLike(key) {\n if (!this.props.entity.Reactions) {\n this.props.entity.Reactions = {};\n }\n if (!this.props.entity.Reactions[key]) {\n this.props.entity.Reactions[key] = {};\n }\n this.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(this.props.user);\n this.props.onUpdateReactions();\n }\n\n onUnlike(key) {\n if (!this.props.entity.Reactions) {\n return;\n }\n if (!this.props.entity.Reactions[key]) {\n return;\n }\n delete this.props.entity.Reactions[key][this.props.user.uid];\n this.props.onUpdateReactions();\n }\n\n render() {\n return (\n <View style={[styles.container, this.props.style]}>\n {this.state.reactions.map((r, i) => {\n return (\n <Reaction\n key={i}\n reaction={r}\n entityType={this.props.entityType}\n entityId={this.props.entityId}\n reactions={this.getReaction(r.key)}\n anyHighlighted={this.props.anyHighlighted}\n userId={this.props.user.uid}\n onLike={this.onLike.bind(this, r.key)}\n onUnlike={this.onUnlike.bind(this, r.key)}\n site={this.props.site}\n />\n );\n })}\n </View>\n );\n }\n}\n\nconst styles = {\n container: {\n flexDirection: 'row',\n justifyContent: 'center',\n width: '100%',\n },\n};\n\nexport { Reactions };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,SAAS,SAASL,SAAS,CAAC;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBACxB;MACNC,SAAS,EAAEP,YAAY,CAAC;IAC1B,CAAC;EAAA;EAEDQ,WAAWA,CAACC,GAAG,EAAE;IACf,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,EAAE;MACtB,OAAO,CAAC,CAAC;IACX;IACA,IAAI,CAAC,IAAI,CAACD,KAAK,CAACC,MAAM,CAACR,SAAS,EAAE;MAChC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,GAAG,CAAC,CAAC;IAClC;IACA,OAAO,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,IAAI,CAAC,CAAC;EA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,CAAAqB,aAAA,CAAChB,QAAQ;QACPO,GAAG,EAAEgB,CAAE;QACPC,QAAQ,EAAEF,CAAE;QACZG,UAAU,EAAE,IAAI,CAACjB,KAAK,CAACiB,UAAW;QAClCC,QAAQ,EAAE,IAAI,CAAClB,KAAK,CAACkB,QAAS;QAC9BrB,SAAS,EAAE,IAAI,CAACC,WAAW,CAACgB,CAAC,CAACf,GAAG,CAAE;QACnCoB,cAAc,EAAE,IAAI,CAACnB,KAAK,CAACmB,cAAe;QAC1CC,MAAM,EAAE,IAAI,CAACpB,KAAK,CAACG,IAAI,CAACC,GAAI;QAC5BF,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmB,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QACtCO,QAAQ,EAAE,IAAI,CAACA,QAAQ,CAACe,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QAC1CuB,IAAI,EAAE,IAAI,CAACtB,KAAK,CAACsB;MAAK,CACvB,CAAC;IAEN,CAAC,CACG,CAAC;EAEX;AACF;AAEA,MAAMZ,MAAM,GAAG;EACbC,SAAS,EAAE;IACTY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT;AACF,CAAC;AAED,SAAShC,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["React","Component","View","getReactions","getUserPreview","Reaction","Reactions","constructor","args","_defineProperty","reactions","getReaction","key","props","entity","onLike","user","uid","onUpdateReactions","onUnlike","render","createElement","style","styles","container","state","map","r","i","reaction","entityType","entityId","anyHighlighted","userId","bind","site","flexDirection","justifyContent","width"],"sources":["Reactions.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View } from \"react-native\";\nimport { getReactions, getUserPreview } from \"../helper\";\nimport { Reaction } from \"./Reaction\";\n\nclass Reactions extends Component {\n\tstate = {\n\t\treactions: getReactions(),\n\t};\n\n\tgetReaction(key) {\n\t\tif (!this.props.entity) {\n\t\t\treturn {};\n\t\t}\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\treturn this.props.entity.Reactions[key] || {};\n\t}\n\n\tonLike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\tthis.props.entity.Reactions[key] = {};\n\t\t}\n\t\tthis.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(\n\t\t\tthis.props.user,\n\t\t);\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\tonUnlike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\treturn;\n\t\t}\n\t\tdelete this.props.entity.Reactions[key][this.props.user.uid];\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{this.state.reactions.map((r, i) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Reaction\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\treaction={r}\n\t\t\t\t\t\t\tentityType={this.props.entityType}\n\t\t\t\t\t\t\tentityId={this.props.entityId}\n\t\t\t\t\t\t\treactions={this.getReaction(r.key)}\n\t\t\t\t\t\t\tanyHighlighted={this.props.anyHighlighted}\n\t\t\t\t\t\t\tuserId={this.props.user.uid}\n\t\t\t\t\t\t\tonLike={this.onLike.bind(this, r.key)}\n\t\t\t\t\t\t\tonUnlike={this.onUnlike.bind(this, r.key)}\n\t\t\t\t\t\t\tsite={this.props.site}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"center\",\n\t\twidth: \"100%\",\n\t},\n};\n\nexport { Reactions };\n"],"mappings":";;;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