@plusscommunities/pluss-core-app 6.1.7 → 6.1.8-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 +21 -28
  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 +36 -34
  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 +253 -0
  76. package/dist/module/components/DocumentUploader.js.map +1 -0
  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 +237 -77
  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 +22 -13
  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 +32 -32
  124. package/dist/module/components/MediaPlayer.js.map +1 -1
  125. package/dist/module/components/MiddlePopup.js +9 -9
  126. package/dist/module/components/MiddlePopup.js.map +1 -1
  127. package/dist/module/components/PDFPopup.js +36 -36
  128. package/dist/module/components/PDFPopup.js.map +1 -1
  129. package/dist/module/components/PlussChat.js +234 -146
  130. package/dist/module/components/PlussChat.js.map +1 -1
  131. package/dist/module/components/PlussChatMessage.js +75 -38
  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 +29 -28
  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 -57
  176. package/dist/module/components/index.js.map +1 -1
  177. package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +90 -58
  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 +6 -1
  182. package/dist/module/config.js.map +1 -1
  183. package/dist/module/constants.js +3 -3
  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 +6 -6
  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 +2 -2
  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 +4 -1
  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 +19 -27
  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 +363 -309
  242. package/src/components/CommentSection.js +974 -782
  243. package/src/components/ConfirmPopup.js +141 -110
  244. package/src/components/ConfirmationPopup.js +80 -69
  245. package/src/components/DocumentUploader.js +255 -0
  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 -206
  262. package/src/components/ImageUploadProgress.js +49 -41
  263. package/src/components/ImageUploader.js +23 -13
  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 +50 -32
  271. package/src/components/PDFPopup.js +198 -159
  272. package/src/components/PlussChat.js +1271 -986
  273. package/src/components/PlussChatMessage.js +330 -262
  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 +136 -122
  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 -57
  296. package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +442 -358
  297. package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
  298. package/src/config.js +5 -0
  299. package/src/constants.js +8 -8
  300. package/src/helper.js +469 -438
  301. package/src/index.js +24 -12
  302. package/src/js/images/detectFaces.js +27 -20
  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 +2 -2
  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 -6
  320. package/src/fonts/pluss60-icons.json +0 -1097
@@ -1,50 +1,50 @@
1
1
  // const COLOUR_1 = '#011d5c';
2
2
  // const COLOUR_2 = '#3179cb';
3
3
  // const COLOUR_3 = '#1bb7ee';
4
- const TEXT_DARKEST = '#3e4245';
4
+ const TEXT_DARKEST = "#3e4245";
5
5
  const TEXT_DARK = TEXT_DARKEST;
6
- const TEXT_BLUEGREY = '#6c7a90';
6
+ const TEXT_BLUEGREY = "#6c7a90";
7
7
  // const TEXT_DARK_ALPHA50 = 'rgba(60, 60, 80, .5)';
8
8
  // const TEXT_DARK_ALPHA20 = 'rgba(60, 60, 80, .2)';
9
- // const TEXT_DARK_ALPHA10 = 'rgba(60, 60, 80, .1)';
10
- const TEXT_MID = '#5a5a6e';
11
- // const TEXT_MID_ALPHA50 = 'rgba(90, 90, 110, .5)';
12
- const TEXT_LIGHT = '#717b81';
13
- const TEXT_LIGHTER = 'rgba(113, 123, 129, 0.8)';
14
- const TEXT_SUPER_LIGHT = '#d1d1d1';
15
- const BG_GREY = '#e9e9ef';
16
- const LINEGREY = '#d5dde4';
17
- const BOXGREY = '#ebeff2';
18
- const PINKISH_GREY = '#c4c4c4';
9
+ const TEXT_DARK_ALPHA10 = "rgba(60, 60, 80, .1)";
10
+ const TEXT_MID = "#5a5a6e";
11
+ const TEXT_MID_ALPHA50 = "rgba(90, 90, 110, .5)";
12
+ const TEXT_LIGHT = "#717b81";
13
+ const TEXT_LIGHTER = "rgba(113, 123, 129, 0.8)";
14
+ const TEXT_SUPER_LIGHT = "#d1d1d1";
15
+ const BG_GREY = "#e9e9ef";
16
+ const LINEGREY = "#d5dde4";
17
+ const BOXGREY = "#ebeff2";
18
+ const PINKISH_GREY = "#c4c4c4";
19
19
  // const PALE_GREY = '#f6f7f9';
20
- const INACTIVE_BUTTON = '#d5d9e1';
21
- const INACTIVE_TEXT = 'rgba(113, 123, 130, 0.8)';
22
- const COLOUR_TEAL = '#82d6e5';
20
+ const INACTIVE_BUTTON = "#d5d9e1";
21
+ const INACTIVE_TEXT = "rgba(113, 123, 130, 0.8)";
22
+ const COLOUR_TEAL = "#82d6e5";
23
23
  // const COLOUR_TEAL_ALPHA50 = 'rgba(4, 196, 169, 0.2)';
24
24
  // const COLOUR_BLUE = '#0083ee';
25
25
  // const COLOUR_BLUE_LIVE = 'rgb(0, 173, 238)';
26
26
  // const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
27
27
  // const COLOUR_DARKBLUE = '#191e78';
28
28
  // const COLOUR_PURPLE = '#8e44ad';
29
- const COLOUR_RED = '#C52F40';
30
- const COLOUR_GRAPEFRUIT = '#FF6363';
31
- const COLOUR_GREEN = '#00cc76';
32
- const COLOUR_GREEN_LIGHT = '#58dba4';
33
- const COLOUR_TANGERINE = '#ff8c75';
29
+ const COLOUR_RED = "#C52F40";
30
+ const COLOUR_GRAPEFRUIT = "#FF6363";
31
+ const COLOUR_GREEN = "#00cc76";
32
+ const COLOUR_GREEN_LIGHT = "#58dba4";
33
+ const COLOUR_TANGERINE = "#ff8c75";
34
34
  // const COLOUR_CITRON = '#bdbd27';
35
35
  // const DARK_OVERLAY = 'rgba(19,19,26,.6)';
36
36
  // const FACEBOOK_BLUE = '#3B5998';
37
37
  // const COLOUR_NAV_GREY = '#f6f6f6';
38
- const COLOUR_TRANSPARENT = 'rgba(0,0,0,0)';
38
+ const COLOUR_TRANSPARENT = "rgba(0,0,0,0)";
39
39
  // const COLOUR_SIDEBAR = '#303030';
40
- const COLOUR_BRANDING_MAIN = '#FF6363';
40
+ const COLOUR_BRANDING_MAIN = "#FF6363";
41
41
  // const COLOUR_BRANDING_OFF = '#FCE1E1';
42
- const COLOUR_BRANDING_LIGHT = '#FCE1E1';
42
+ const COLOUR_BRANDING_LIGHT = "#FCE1E1";
43
43
  // const COLOUR_BRANDING_SECONDARY = COLOUR_BRANDING_MAIN;
44
- const COLOUR_BRANDING_DARK = '#D13636';
44
+ const COLOUR_BRANDING_DARK = "#D13636";
45
45
  // const COLOUR_DAY = '#89c4f4';
46
46
  // const COLOUR_NIGHT = '#003159';
47
- const COLOUR_TAN = '#fff3d1';
47
+ const COLOUR_TAN = "#fff3d1";
48
48
 
49
49
  // const hexToRGB = hex => {
50
50
  // // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
@@ -129,10 +129,7 @@ export {
129
129
  TEXT_DARKEST, TEXT_BLUEGREY, TEXT_DARK,
130
130
  // TEXT_DARK_ALPHA50,
131
131
  // TEXT_DARK_ALPHA20,
132
- // TEXT_DARK_ALPHA10,
133
- TEXT_MID,
134
- // TEXT_MID_ALPHA50,
135
- TEXT_LIGHT, TEXT_LIGHTER, TEXT_SUPER_LIGHT, BG_GREY, LINEGREY, PINKISH_GREY, BOXGREY,
132
+ TEXT_DARK_ALPHA10, TEXT_MID, TEXT_MID_ALPHA50, TEXT_LIGHT, TEXT_LIGHTER, TEXT_SUPER_LIGHT, BG_GREY, LINEGREY, PINKISH_GREY, BOXGREY,
136
133
  // PALE_GREY,
137
134
  INACTIVE_BUTTON, INACTIVE_TEXT, COLOUR_TEAL,
138
135
  // COLOUR_TEAL_ALPHA50,
@@ -1 +1 @@
1
- {"version":3,"names":["TEXT_DARKEST","TEXT_DARK","TEXT_BLUEGREY","TEXT_MID","TEXT_LIGHT","TEXT_LIGHTER","TEXT_SUPER_LIGHT","BG_GREY","LINEGREY","BOXGREY","PINKISH_GREY","INACTIVE_BUTTON","INACTIVE_TEXT","COLOUR_TEAL","COLOUR_RED","COLOUR_GRAPEFRUIT","COLOUR_GREEN","COLOUR_GREEN_LIGHT","COLOUR_TANGERINE","COLOUR_TRANSPARENT","COLOUR_BRANDING_MAIN","COLOUR_BRANDING_LIGHT","COLOUR_BRANDING_DARK","COLOUR_TAN","hexToRGBAstring","hex","opacity","shorthandRegex","replace","m","r","g","b","result","exec","parseInt","getMainBrandingColourFromState","state","user","siteBranding","MainBrandingColour","getDarkBrandingColourFromState","DarkBrandingColour","getLightBrandingColourFromState","LightBrandingColour"],"sources":["colours.js"],"sourcesContent":["// const COLOUR_1 = '#011d5c';\n// const COLOUR_2 = '#3179cb';\n// const COLOUR_3 = '#1bb7ee';\nconst TEXT_DARKEST = '#3e4245';\nconst TEXT_DARK = TEXT_DARKEST;\nconst TEXT_BLUEGREY = '#6c7a90';\n// const TEXT_DARK_ALPHA50 = 'rgba(60, 60, 80, .5)';\n// const TEXT_DARK_ALPHA20 = 'rgba(60, 60, 80, .2)';\n// const TEXT_DARK_ALPHA10 = 'rgba(60, 60, 80, .1)';\nconst TEXT_MID = '#5a5a6e';\n// const TEXT_MID_ALPHA50 = 'rgba(90, 90, 110, .5)';\nconst TEXT_LIGHT = '#717b81';\nconst TEXT_LIGHTER = 'rgba(113, 123, 129, 0.8)';\nconst TEXT_SUPER_LIGHT = '#d1d1d1';\nconst BG_GREY = '#e9e9ef';\nconst LINEGREY = '#d5dde4';\nconst BOXGREY = '#ebeff2';\nconst PINKISH_GREY = '#c4c4c4';\n// const PALE_GREY = '#f6f7f9';\nconst INACTIVE_BUTTON = '#d5d9e1';\nconst INACTIVE_TEXT = 'rgba(113, 123, 130, 0.8)';\nconst COLOUR_TEAL = '#82d6e5';\n// const COLOUR_TEAL_ALPHA50 = 'rgba(4, 196, 169, 0.2)';\n// const COLOUR_BLUE = '#0083ee';\n// const COLOUR_BLUE_LIVE = 'rgb(0, 173, 238)';\n// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';\n// const COLOUR_DARKBLUE = '#191e78';\n// const COLOUR_PURPLE = '#8e44ad';\nconst COLOUR_RED = '#C52F40';\nconst COLOUR_GRAPEFRUIT = '#FF6363';\nconst COLOUR_GREEN = '#00cc76';\nconst COLOUR_GREEN_LIGHT = '#58dba4';\nconst COLOUR_TANGERINE = '#ff8c75';\n// const COLOUR_CITRON = '#bdbd27';\n// const DARK_OVERLAY = 'rgba(19,19,26,.6)';\n// const FACEBOOK_BLUE = '#3B5998';\n// const COLOUR_NAV_GREY = '#f6f6f6';\nconst COLOUR_TRANSPARENT = 'rgba(0,0,0,0)';\n// const COLOUR_SIDEBAR = '#303030';\nconst COLOUR_BRANDING_MAIN = '#FF6363';\n// const COLOUR_BRANDING_OFF = '#FCE1E1';\nconst COLOUR_BRANDING_LIGHT = '#FCE1E1';\n// const COLOUR_BRANDING_SECONDARY = COLOUR_BRANDING_MAIN;\nconst COLOUR_BRANDING_DARK = '#D13636';\n// const COLOUR_DAY = '#89c4f4';\n// const COLOUR_NIGHT = '#003159';\nconst COLOUR_TAN = '#fff3d1';\n\n// const hexToRGB = hex => {\n// // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n// const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n// hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n// return r + r + g + g + b + b;\n// });\n\n// const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n// return result\n// ? {\n// r: parseInt(result[1], 16),\n// g: parseInt(result[2], 16),\n// b: parseInt(result[3], 16),\n// }\n// : null;\n// };\n\nconst hexToRGBAstring = (hex, opacity) => {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n return r + r + g + g + b + b;\n });\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${opacity})` : null;\n};\n\n// const pctBtwnColours = (c1, c2, percentage) => {\n// const rgbC1 = hexToRGB(c1);\n// const rgbC2 = hexToRGB(c2);\n// const r = rgbC2.r + (rgbC1.r - rgbC2.r) * percentage;\n// const g = rgbC2.g + (rgbC1.g - rgbC2.g) * percentage;\n// const b = rgbC2.b + (rgbC1.b - rgbC2.b) * percentage;\n// return `rgb(${r}, ${g}, ${b})`;\n// };\n\n// const getTabIconColour = (mainColour, footerType, selected) => {\n// if (footerType !== 'white') {\n// return '#fff';\n// }\n// if (selected) {\n// return mainColour;\n// }\n// return TEXT_BLUEGREY;\n// };\n\n// const getHeaderBrandingColourFromState = state => {\n// return (state && state.user && state.user.siteBranding && state.user.siteBranding.HeaderBrandingColour) || null;\n// };\n\nconst getMainBrandingColourFromState = state => {\n return (state && state.user && state.user.siteBranding && state.user.siteBranding.MainBrandingColour) || COLOUR_BRANDING_MAIN;\n};\n\nconst getDarkBrandingColourFromState = state => {\n return (state && state.user && state.user.siteBranding && state.user.siteBranding.DarkBrandingColour) || COLOUR_BRANDING_DARK;\n};\n\nconst getLightBrandingColourFromState = state => {\n return (state && state.user && state.user.siteBranding && state.user.siteBranding.LightBrandingColour) || COLOUR_BRANDING_LIGHT;\n};\n\n// const getSecondaryBrandingColourFromState = state => {\n// return (state && state.user && state.user.siteBranding && state.user.siteBranding.SecondaryBrandingColour) || COLOUR_BRANDING_SECONDARY;\n// };\n\n// const getMainBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.MainBrandingColour) || COLOUR_BRANDING_MAIN;\n// };\n\n// const getDarkBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.DarkBrandingColour) || COLOUR_BRANDING_DARK;\n// };\n\n// const getLightBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.LightBrandingColour) || COLOUR_BRANDING_LIGHT;\n// };\n\nexport {\n // COLOUR_1,\n // COLOUR_2,\n // COLOUR_3,\n TEXT_DARKEST,\n TEXT_BLUEGREY,\n TEXT_DARK,\n // TEXT_DARK_ALPHA50,\n // TEXT_DARK_ALPHA20,\n // TEXT_DARK_ALPHA10,\n TEXT_MID,\n // TEXT_MID_ALPHA50,\n TEXT_LIGHT,\n TEXT_LIGHTER,\n TEXT_SUPER_LIGHT,\n BG_GREY,\n LINEGREY,\n PINKISH_GREY,\n BOXGREY,\n // PALE_GREY,\n INACTIVE_BUTTON,\n INACTIVE_TEXT,\n COLOUR_TEAL,\n // COLOUR_TEAL_ALPHA50,\n // COLOUR_BLUE,\n // COLOUR_BLUE_LIVE,\n // COLOUR_BLUE_ALPHA10,\n // COLOUR_DARKBLUE,\n // COLOUR_PURPLE,\n COLOUR_RED,\n COLOUR_TANGERINE,\n // COLOUR_CITRON,\n // DARK_OVERLAY,\n // hexToRGB,\n hexToRGBAstring,\n // pctBtwnColours,\n // FACEBOOK_BLUE,\n // COLOUR_NAV_GREY,\n COLOUR_TRANSPARENT,\n // COLOUR_SIDEBAR,\n COLOUR_BRANDING_MAIN,\n // COLOUR_BRANDING_OFF,\n COLOUR_BRANDING_LIGHT,\n COLOUR_BRANDING_DARK,\n COLOUR_GREEN,\n COLOUR_GREEN_LIGHT,\n COLOUR_GRAPEFRUIT,\n // COLOUR_DAY,\n // COLOUR_NIGHT,\n COLOUR_TAN,\n // getHeaderBrandingColourFromState,\n getMainBrandingColourFromState,\n getDarkBrandingColourFromState,\n getLightBrandingColourFromState,\n // getSecondaryBrandingColourFromState,\n // getMainBrandingColourFromSite,\n // getDarkBrandingColourFromSite,\n // getLightBrandingColourFromSite,\n // getTabIconColour,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,SAAS;AAC9B,MAAMC,SAAS,GAAGD,YAAY;AAC9B,MAAME,aAAa,GAAG,SAAS;AAC/B;AACA;AACA;AACA,MAAMC,QAAQ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a,EACbC,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACAC,UAAU,EACVI,gBAAgB;AAChB;AACA;AACA;AACAM,eAAe;AACf;AACA;AACA;AACAL,kBAAkB;AAClB;AACAC,oBAAoB;AACpB;AACAC,qBAAqB,EACrBC,oBAAoB,EACpBN,YAAY,EACZC,kBAAkB,EAClBF,iBAAiB;AACjB;AACA;AACAQ,UAAU;AACV;AACAa,8BAA8B,EAC9BK,8BAA8B,EAC9BE;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["TEXT_DARKEST","TEXT_DARK","TEXT_BLUEGREY","TEXT_DARK_ALPHA10","TEXT_MID","TEXT_MID_ALPHA50","TEXT_LIGHT","TEXT_LIGHTER","TEXT_SUPER_LIGHT","BG_GREY","LINEGREY","BOXGREY","PINKISH_GREY","INACTIVE_BUTTON","INACTIVE_TEXT","COLOUR_TEAL","COLOUR_RED","COLOUR_GRAPEFRUIT","COLOUR_GREEN","COLOUR_GREEN_LIGHT","COLOUR_TANGERINE","COLOUR_TRANSPARENT","COLOUR_BRANDING_MAIN","COLOUR_BRANDING_LIGHT","COLOUR_BRANDING_DARK","COLOUR_TAN","hexToRGBAstring","hex","opacity","shorthandRegex","replace","m","r","g","b","result","exec","parseInt","getMainBrandingColourFromState","state","user","siteBranding","MainBrandingColour","getDarkBrandingColourFromState","DarkBrandingColour","getLightBrandingColourFromState","LightBrandingColour"],"sources":["colours.js"],"sourcesContent":["// const COLOUR_1 = '#011d5c';\n// const COLOUR_2 = '#3179cb';\n// const COLOUR_3 = '#1bb7ee';\nconst TEXT_DARKEST = \"#3e4245\";\nconst TEXT_DARK = TEXT_DARKEST;\nconst TEXT_BLUEGREY = \"#6c7a90\";\n// const TEXT_DARK_ALPHA50 = 'rgba(60, 60, 80, .5)';\n// const TEXT_DARK_ALPHA20 = 'rgba(60, 60, 80, .2)';\nconst TEXT_DARK_ALPHA10 = \"rgba(60, 60, 80, .1)\";\nconst TEXT_MID = \"#5a5a6e\";\nconst TEXT_MID_ALPHA50 = \"rgba(90, 90, 110, .5)\";\nconst TEXT_LIGHT = \"#717b81\";\nconst TEXT_LIGHTER = \"rgba(113, 123, 129, 0.8)\";\nconst TEXT_SUPER_LIGHT = \"#d1d1d1\";\nconst BG_GREY = \"#e9e9ef\";\nconst LINEGREY = \"#d5dde4\";\nconst BOXGREY = \"#ebeff2\";\nconst PINKISH_GREY = \"#c4c4c4\";\n// const PALE_GREY = '#f6f7f9';\nconst INACTIVE_BUTTON = \"#d5d9e1\";\nconst INACTIVE_TEXT = \"rgba(113, 123, 130, 0.8)\";\nconst COLOUR_TEAL = \"#82d6e5\";\n// const COLOUR_TEAL_ALPHA50 = 'rgba(4, 196, 169, 0.2)';\n// const COLOUR_BLUE = '#0083ee';\n// const COLOUR_BLUE_LIVE = 'rgb(0, 173, 238)';\n// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';\n// const COLOUR_DARKBLUE = '#191e78';\n// const COLOUR_PURPLE = '#8e44ad';\nconst COLOUR_RED = \"#C52F40\";\nconst COLOUR_GRAPEFRUIT = \"#FF6363\";\nconst COLOUR_GREEN = \"#00cc76\";\nconst COLOUR_GREEN_LIGHT = \"#58dba4\";\nconst COLOUR_TANGERINE = \"#ff8c75\";\n// const COLOUR_CITRON = '#bdbd27';\n// const DARK_OVERLAY = 'rgba(19,19,26,.6)';\n// const FACEBOOK_BLUE = '#3B5998';\n// const COLOUR_NAV_GREY = '#f6f6f6';\nconst COLOUR_TRANSPARENT = \"rgba(0,0,0,0)\";\n// const COLOUR_SIDEBAR = '#303030';\nconst COLOUR_BRANDING_MAIN = \"#FF6363\";\n// const COLOUR_BRANDING_OFF = '#FCE1E1';\nconst COLOUR_BRANDING_LIGHT = \"#FCE1E1\";\n// const COLOUR_BRANDING_SECONDARY = COLOUR_BRANDING_MAIN;\nconst COLOUR_BRANDING_DARK = \"#D13636\";\n// const COLOUR_DAY = '#89c4f4';\n// const COLOUR_NIGHT = '#003159';\nconst COLOUR_TAN = \"#fff3d1\";\n\n// const hexToRGB = hex => {\n// // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n// const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n// hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n// return r + r + g + g + b + b;\n// });\n\n// const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n// return result\n// ? {\n// r: parseInt(result[1], 16),\n// g: parseInt(result[2], 16),\n// b: parseInt(result[3], 16),\n// }\n// : null;\n// };\n\nconst hexToRGBAstring = (hex, opacity) => {\n\t// Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n\tconst shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\thex = hex.replace(shorthandRegex, (m, r, g, b) => {\n\t\treturn r + r + g + g + b + b;\n\t});\n\n\tconst result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\treturn result\n\t\t? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${opacity})`\n\t\t: null;\n};\n\n// const pctBtwnColours = (c1, c2, percentage) => {\n// const rgbC1 = hexToRGB(c1);\n// const rgbC2 = hexToRGB(c2);\n// const r = rgbC2.r + (rgbC1.r - rgbC2.r) * percentage;\n// const g = rgbC2.g + (rgbC1.g - rgbC2.g) * percentage;\n// const b = rgbC2.b + (rgbC1.b - rgbC2.b) * percentage;\n// return `rgb(${r}, ${g}, ${b})`;\n// };\n\n// const getTabIconColour = (mainColour, footerType, selected) => {\n// if (footerType !== 'white') {\n// return '#fff';\n// }\n// if (selected) {\n// return mainColour;\n// }\n// return TEXT_BLUEGREY;\n// };\n\n// const getHeaderBrandingColourFromState = state => {\n// return (state && state.user && state.user.siteBranding && state.user.siteBranding.HeaderBrandingColour) || null;\n// };\n\nconst getMainBrandingColourFromState = (state) => {\n\treturn (\n\t\t(state &&\n\t\t\tstate.user &&\n\t\t\tstate.user.siteBranding &&\n\t\t\tstate.user.siteBranding.MainBrandingColour) ||\n\t\tCOLOUR_BRANDING_MAIN\n\t);\n};\n\nconst getDarkBrandingColourFromState = (state) => {\n\treturn (\n\t\t(state &&\n\t\t\tstate.user &&\n\t\t\tstate.user.siteBranding &&\n\t\t\tstate.user.siteBranding.DarkBrandingColour) ||\n\t\tCOLOUR_BRANDING_DARK\n\t);\n};\n\nconst getLightBrandingColourFromState = (state) => {\n\treturn (\n\t\t(state &&\n\t\t\tstate.user &&\n\t\t\tstate.user.siteBranding &&\n\t\t\tstate.user.siteBranding.LightBrandingColour) ||\n\t\tCOLOUR_BRANDING_LIGHT\n\t);\n};\n\n// const getSecondaryBrandingColourFromState = state => {\n// return (state && state.user && state.user.siteBranding && state.user.siteBranding.SecondaryBrandingColour) || COLOUR_BRANDING_SECONDARY;\n// };\n\n// const getMainBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.MainBrandingColour) || COLOUR_BRANDING_MAIN;\n// };\n\n// const getDarkBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.DarkBrandingColour) || COLOUR_BRANDING_DARK;\n// };\n\n// const getLightBrandingColourFromSite = site => {\n// return (site.Branding && site.Branding.LightBrandingColour) || COLOUR_BRANDING_LIGHT;\n// };\n\nexport {\n\t// COLOUR_1,\n\t// COLOUR_2,\n\t// COLOUR_3,\n\tTEXT_DARKEST,\n\tTEXT_BLUEGREY,\n\tTEXT_DARK,\n\t// TEXT_DARK_ALPHA50,\n\t// TEXT_DARK_ALPHA20,\n\tTEXT_DARK_ALPHA10,\n\tTEXT_MID,\n\tTEXT_MID_ALPHA50,\n\tTEXT_LIGHT,\n\tTEXT_LIGHTER,\n\tTEXT_SUPER_LIGHT,\n\tBG_GREY,\n\tLINEGREY,\n\tPINKISH_GREY,\n\tBOXGREY,\n\t// PALE_GREY,\n\tINACTIVE_BUTTON,\n\tINACTIVE_TEXT,\n\tCOLOUR_TEAL,\n\t// COLOUR_TEAL_ALPHA50,\n\t// COLOUR_BLUE,\n\t// COLOUR_BLUE_LIVE,\n\t// COLOUR_BLUE_ALPHA10,\n\t// COLOUR_DARKBLUE,\n\t// COLOUR_PURPLE,\n\tCOLOUR_RED,\n\tCOLOUR_TANGERINE,\n\t// COLOUR_CITRON,\n\t// DARK_OVERLAY,\n\t// hexToRGB,\n\thexToRGBAstring,\n\t// pctBtwnColours,\n\t// FACEBOOK_BLUE,\n\t// COLOUR_NAV_GREY,\n\tCOLOUR_TRANSPARENT,\n\t// COLOUR_SIDEBAR,\n\tCOLOUR_BRANDING_MAIN,\n\t// COLOUR_BRANDING_OFF,\n\tCOLOUR_BRANDING_LIGHT,\n\tCOLOUR_BRANDING_DARK,\n\tCOLOUR_GREEN,\n\tCOLOUR_GREEN_LIGHT,\n\tCOLOUR_GRAPEFRUIT,\n\t// COLOUR_DAY,\n\t// COLOUR_NIGHT,\n\tCOLOUR_TAN,\n\t// getHeaderBrandingColourFromState,\n\tgetMainBrandingColourFromState,\n\tgetDarkBrandingColourFromState,\n\tgetLightBrandingColourFromState,\n\t// getSecondaryBrandingColourFromState,\n\t// getMainBrandingColourFromSite,\n\t// getDarkBrandingColourFromSite,\n\t// getLightBrandingColourFromSite,\n\t// getTabIconColour,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,SAAS;AAC9B,MAAMC,SAAS,GAAGD,YAAY;AAC9B,MAAME,aAAa,GAAG,SAAS;AAC/B;AACA;AACA,MAAMC,iBAAiB,GAAG,sBAAsB;AAChD,MAAMC,QAAQ,GAAG,SAAS;AAC1B,MAAMC,gBAAgB,GAAG,uBAAuB;AAChD,MAAMC,UAAU,GAAG,SAAS;AAC5B,MAAMC,YAAY,GAAG,0BAA0B;AAC/C,MAAMC,gBAAgB,GAAG,SAAS;AAClC,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,QAAQ,GAAG,SAAS;AAC1B,MAAM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KAAKP,OAAO,GAAG,GACtG,IAAI;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,MAAMU,8BAA8B,GAAIC,KAAK,IAAK;EACjD,OACEA,KAAK,IACLA,KAAK,CAACC,IAAI,IACVD,KAAK,CAACC,IAAI,CAACC,YAAY,IACvBF,KAAK,CAACC,IAAI,CAACC,YAAY,CAACC,kBAAkB,IAC3CpB,oBAAoB;AAEtB,CAAC;AAED,MAAMqB,8BAA8B,GAAIJ,KAAK,IAAK;EACjD,OACEA,KAAK,IACLA,KAAK,CAACC,IAAI,IACVD,KAAK,CAACC,IAAI,CAACC,YAAY,IACvBF,KAAK,CAACC,IAAI,CAACC,YAAY,CAACG,kBAAkB,IAC3CpB,oBAAoB;AAEtB,CAAC;AAED,MAAMqB,+BAA+B,GAAIN,KAAK,IAAK;EAClD,OACEA,KAAK,IACLA,KAAK,CAACC,IAAI,IACVD,KAAK,CAACC,IAAI,CAACC,YAAY,IACvBF,KAAK,CAACC,IAAI,CAACC,YAAY,CAACK,mBAAmB,IAC5CvB,qBAAqB;AAEvB,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACC;AACA;AACA;AACAvB,YAAY,EACZE,aAAa,EACbD,SAAS;AACT;AACA;AACAE,iBAAiB,EACjBC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,gBAAgB,EAChBC,OAAO,EACPC,QAAQ,EACRE,YAAY,EACZD,OAAO;AACP;AACAE,eAAe,EACfC,aAAa,EACbC,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACAC,UAAU,EACVI,gBAAgB;AAChB;AACA;AACA;AACAM,eAAe;AACf;AACA;AACA;AACAL,kBAAkB;AAClB;AACAC,oBAAoB;AACpB;AACAC,qBAAqB,EACrBC,oBAAoB,EACpBN,YAAY,EACZC,kBAAkB,EAClBF,iBAAiB;AACjB;AACA;AACAQ,UAAU;AACV;AACAa,8BAA8B,EAC9BK,8BAA8B,EAC9BE;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -1,9 +1,9 @@
1
- import React, { PureComponent } from 'react';
2
- import { TouchableOpacity } from 'react-native';
3
- import { connect } from 'react-redux';
4
- import Styles from '../styles';
5
- import { Pl60Icon } from '../fonts';
6
- import { getMainBrandingColourFromState } from '../colours';
1
+ import React, { PureComponent } from "react";
2
+ import { TouchableOpacity } from "react-native";
3
+ import { connect } from "react-redux";
4
+ import Styles from "../styles";
5
+ import { FontAwesome } from "./Icon";
6
+ import { getMainBrandingColourFromState } from "../colours";
7
7
 
8
8
  /*
9
9
  Props-
@@ -27,8 +27,8 @@ class AddButton extends PureComponent {
27
27
  backgroundColor: this.props.color
28
28
  }, this.props.style],
29
29
  onPress: this.props.onPress
30
- }, /*#__PURE__*/React.createElement(Pl60Icon, {
31
- name: "pluss",
30
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
31
+ name: "plus",
32
32
  style: Styles.addButtonIcon
33
33
  }));
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","PureComponent","TouchableOpacity","connect","Styles","Pl60Icon","getMainBrandingColourFromState","AddButton","render","size","props","diameter","radius","createElement","style","addButton","height","width","borderRadius","backgroundColor","colourBrandingMain","color","onPress","name","addButtonIcon","mapStateToProps","state"],"sources":["AddButton.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport Styles from '../styles';\nimport { Pl60Icon } from '../fonts';\nimport { getMainBrandingColourFromState } from '../colours';\n\n/* \nProps- \n onPress - onPress action\n diameter - size of button\n iconSize - size of inner plus\n color - default will be aveoMain\n*/\n\nclass AddButton extends PureComponent {\n render() {\n const size = this.props.diameter || 48;\n const radius = size / 2;\n return (\n <TouchableOpacity\n style={[\n Styles.addButton,\n { height: size, width: size, borderRadius: radius, backgroundColor: this.props.colourBrandingMain },\n this.props.color && { backgroundColor: this.props.color },\n this.props.style,\n ]}\n onPress={this.props.onPress}\n >\n <Pl60Icon name=\"pluss\" style={Styles.addButtonIcon} />\n </TouchableOpacity>\n );\n }\n}\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst addButton = connect(mapStateToProps, {})(AddButton);\nexport { addButton as AddButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,8BAA8B,QAAQ,YAAY;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,SAAS,SAASN,aAAa,CAAC;EACpCO,MAAMA,CAAA,EAAG;IACP,MAAMC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,IAAI,EAAE;IACtC,MAAMC,MAAM,GAAGH,IAAI,GAAG,CAAC;IACvB,oBACET,KAAA,CAAAa,aAAA,CAACX,gBAAgB;MACfY,KAAK,EAAE,CACLV,MAAM,CAACW,SAAS,EAChB;QAAEC,MAAM,EAAEP,IAAI;QAAEQ,KAAK,EAAER,IAAI;QAAES,YAAY,EAAEN,MAAM;QAAEO,eAAe,EAAE,IAAI,CAACT,KAAK,CAACU;MAAmB,CAAC,EACnG,IAAI,CAACV,KAAK,CAACW,KAAK,IAAI;QAAEF,eAAe,EAAE,IAAI,CAACT,KAAK,CAACW;MAAM,CAAC,EACzD,IAAI,CAACX,KAAK,CAACI,KAAK,CAChB;MACFQ,OAAO,EAAE,IAAI,CAACZ,KAAK,CAACY;IAAQ,gBAE5BtB,KAAA,CAAAa,aAAA,CAACR,QAAQ;MAACkB,IAAI,EAAC,OAAO;MAACT,KAAK,EAAEV,MAAM,CAACoB;IAAc,CAAE,CACrC,CAAC;EAEvB;AACF;AAEA,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLN,kBAAkB,EAAEd,8BAA8B,CAACoB,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMX,SAAS,GAAGZ,OAAO,CAACsB,eAAe,EAAE,CAAC,CAAC,CAAC,CAAClB,SAAS,CAAC;AACzD,SAASQ,SAAS,IAAIR,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["React","PureComponent","TouchableOpacity","connect","Styles","FontAwesome","getMainBrandingColourFromState","AddButton","render","size","props","diameter","radius","createElement","style","addButton","height","width","borderRadius","backgroundColor","colourBrandingMain","color","onPress","name","addButtonIcon","mapStateToProps","state"],"sources":["AddButton.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { TouchableOpacity } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport Styles from \"../styles\";\nimport { FontAwesome } from \"./Icon\";\nimport { getMainBrandingColourFromState } from \"../colours\";\n\n/* \nProps- \n onPress - onPress action\n diameter - size of button\n iconSize - size of inner plus\n color - default will be aveoMain\n*/\n\nclass AddButton extends PureComponent {\n\trender() {\n\t\tconst size = this.props.diameter || 48;\n\t\tconst radius = size / 2;\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={[\n\t\t\t\t\tStyles.addButton,\n\t\t\t\t\t{\n\t\t\t\t\t\theight: size,\n\t\t\t\t\t\twidth: size,\n\t\t\t\t\t\tborderRadius: radius,\n\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t},\n\t\t\t\t\tthis.props.color && { backgroundColor: this.props.color },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t\tonPress={this.props.onPress}\n\t\t\t>\n\t\t\t\t<FontAwesome name=\"plus\" style={Styles.addButtonIcon} />\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst addButton = connect(mapStateToProps, {})(AddButton);\nexport { addButton as AddButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,8BAA8B,QAAQ,YAAY;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,SAAS,SAASN,aAAa,CAAC;EACrCO,MAAMA,CAAA,EAAG;IACR,MAAMC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,IAAI,EAAE;IACtC,MAAMC,MAAM,GAAGH,IAAI,GAAG,CAAC;IACvB,oBACCT,KAAA,CAAAa,aAAA,CAACX,gBAAgB;MAChBY,KAAK,EAAE,CACNV,MAAM,CAACW,SAAS,EAChB;QACCC,MAAM,EAAEP,IAAI;QACZQ,KAAK,EAAER,IAAI;QACXS,YAAY,EAAEN,MAAM;QACpBO,eAAe,EAAE,IAAI,CAACT,KAAK,CAACU;MAC7B,CAAC,EACD,IAAI,CAACV,KAAK,CAACW,KAAK,IAAI;QAAEF,eAAe,EAAE,IAAI,CAACT,KAAK,CAACW;MAAM,CAAC,EACzD,IAAI,CAACX,KAAK,CAACI,KAAK,CACf;MACFQ,OAAO,EAAE,IAAI,CAACZ,KAAK,CAACY;IAAQ,gBAE5BtB,KAAA,CAAAa,aAAA,CAACR,WAAW;MAACkB,IAAI,EAAC,MAAM;MAACT,KAAK,EAAEV,MAAM,CAACoB;IAAc,CAAE,CACtC,CAAC;EAErB;AACD;AAEA,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNN,kBAAkB,EAAEd,8BAA8B,CAACoB,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMX,SAAS,GAAGZ,OAAO,CAACsB,eAAe,EAAE,CAAC,CAAC,CAAC,CAAClB,SAAS,CAAC;AACzD,SAASQ,SAAS,IAAIR,SAAS","ignoreList":[]}
@@ -2,17 +2,18 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  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; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
4
  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); }
5
- import React, { Component } from 'react';
6
- import { Platform, Linking, StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';
7
- import { connect } from 'react-redux';
8
- import _ from 'lodash';
9
- import * as Calendar from 'expo-calendar';
10
- import { TEXT_DARK, getMainBrandingColourFromState } from '../colours';
11
- import { InlineButton } from './InlineButton';
12
- import { Popup } from './Popup';
13
- import { MiddlePopup } from './MiddlePopup';
14
- const DEFAULT_TITLE = 'Add to Calendar';
15
- const ERROR_EVENT_ADD = 'There was a problem adding a calendar event.';
5
+ import React, { Component } from "react";
6
+ import { Text } from "@plusscommunities/pluss-core-app/components";
7
+ import { Platform, Linking, StyleSheet, View, TouchableOpacity, ScrollView } from "react-native";
8
+ import { connect } from "react-redux";
9
+ import _ from "lodash";
10
+ import * as Calendar from "expo-calendar";
11
+ import { TEXT_DARK, getMainBrandingColourFromState } from "../colours";
12
+ import { InlineButton } from "./InlineButton";
13
+ import { Popup } from "./Popup";
14
+ import { MiddlePopup } from "./MiddlePopup";
15
+ const DEFAULT_TITLE = "Add to Calendar";
16
+ const ERROR_EVENT_ADD = "There was a problem adding a calendar event.";
16
17
 
17
18
  // Required: eventToAdd
18
19
  // Documentation: https://docs.expo.dev/versions/latest/sdk/calendar/#event
@@ -20,7 +21,7 @@ class AddToCalendarButton extends Component {
20
21
  constructor(props) {
21
22
  super(props);
22
23
  _defineProperty(this, "showWarningPopup", () => {
23
- if (Platform.OS !== 'ios') return;
24
+ if (Platform.OS !== "ios") return;
24
25
  this.setState({
25
26
  showPermissionWarning: true
26
27
  });
@@ -31,7 +32,7 @@ class AddToCalendarButton extends Component {
31
32
  });
32
33
  });
33
34
  _defineProperty(this, "goToPermissionSettings", () => {
34
- Linking.openURL('app-settings:');
35
+ Linking.openURL("app-settings:");
35
36
  this.setState({
36
37
  showPermissionWarning: false
37
38
  });
@@ -39,14 +40,14 @@ class AddToCalendarButton extends Component {
39
40
  _defineProperty(this, "onAdd", async () => {
40
41
  if (!this.props.eventToAdd) {
41
42
  this.setState({
42
- message: 'There is no event to add'
43
+ message: "There is no event to add"
43
44
  });
44
45
  return;
45
46
  }
46
47
  const {
47
48
  status
48
49
  } = await Calendar.requestCalendarPermissionsAsync();
49
- if (status !== 'granted') {
50
+ if (status !== "granted") {
50
51
  this.showWarningPopup();
51
52
  } else {
52
53
  let calendars = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);
@@ -61,7 +62,7 @@ class AddToCalendarButton extends Component {
61
62
  type: c.type
62
63
  };
63
64
  });
64
- calendars = _.orderBy(calendars, ['source', 'title']);
65
+ calendars = _.orderBy(calendars, ["source", "title"]);
65
66
  // console.log('sorted calendars', calendars);
66
67
  }
67
68
  this.setState({
@@ -86,7 +87,7 @@ class AddToCalendarButton extends Component {
86
87
  message: eventId ? `${eventToAdd.title} was added to ${calendar.title} successfully.` : ERROR_EVENT_ADD
87
88
  });
88
89
  } catch (error) {
89
- console.log('onSelectCalendar', error);
90
+ console.log("onSelectCalendar", error);
90
91
  this.setState({
91
92
  calendars: null,
92
93
  message: ERROR_EVENT_ADD
@@ -109,11 +110,11 @@ class AddToCalendarButton extends Component {
109
110
  title: "Permissions missing",
110
111
  text: "You must grant access to the Calendars. Tap Go to settings to change your permission settings.",
111
112
  options: [{
112
- text: 'Go to settings',
113
+ text: "Go to settings",
113
114
  action: this.goToPermissionSettings,
114
115
  bold: true
115
116
  }, {
116
- text: 'Ignore',
117
+ text: "Ignore",
117
118
  action: this.closeWarningPopup
118
119
  }]
119
120
  });
@@ -143,9 +144,9 @@ class AddToCalendarButton extends Component {
143
144
  }]
144
145
  }, /*#__PURE__*/React.createElement(Text, {
145
146
  style: styles.calendarText
146
- }, `${cal.source}${cal.source === cal.title ? '' : `\n${cal.title}`}`)));
147
+ }, `${cal.source}${cal.source === cal.title ? "" : `\n${cal.title}`}`)));
147
148
  })), /*#__PURE__*/React.createElement(TouchableOpacity, {
148
- key: 'cancel',
149
+ key: "cancel",
149
150
  onPress: this.onCloseCalendars
150
151
  }, /*#__PURE__*/React.createElement(View, {
151
152
  style: [styles.calendarContainer, {
@@ -161,7 +162,7 @@ class AddToCalendarButton extends Component {
161
162
  title: "Add to Calendar",
162
163
  text: message,
163
164
  options: [{
164
- text: 'Ok',
165
+ text: "Ok",
165
166
  action: this.onCloseMessage
166
167
  }]
167
168
  });
@@ -188,18 +189,18 @@ const styles = StyleSheet.create({
188
189
  borderRadius: 12
189
190
  },
190
191
  calendarPopupTitle: {
191
- fontFamily: 'sf-bold',
192
+ fontFamily: "sf-bold",
192
193
  color: TEXT_DARK,
193
194
  fontSize: 18,
194
195
  marginBottom: 16
195
196
  },
196
197
  calendarPopupContainer: {
197
198
  flex: 1,
198
- justifyContent: 'space-between'
199
+ justifyContent: "space-between"
199
200
  },
200
201
  calendarContainer: {
201
- flexDirection: 'row',
202
- alignItems: 'center',
202
+ flexDirection: "row",
203
+ alignItems: "center",
203
204
  width: 200,
204
205
  height: 40,
205
206
  paddingHorizontal: 8,
@@ -207,9 +208,9 @@ const styles = StyleSheet.create({
207
208
  marginBottom: 10
208
209
  },
209
210
  calendarText: {
210
- color: '#fff',
211
- textAlign: 'center',
212
- fontFamily: 'sf-semibold',
211
+ color: "#fff",
212
+ textAlign: "center",
213
+ fontFamily: "sf-semibold",
213
214
  fontSize: 13,
214
215
  flex: 1
215
216
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","Platform","Linking","StyleSheet","Text","View","TouchableOpacity","ScrollView","connect","_","Calendar","TEXT_DARK","getMainBrandingColourFromState","InlineButton","Popup","MiddlePopup","DEFAULT_TITLE","ERROR_EVENT_ADD","AddToCalendarButton","constructor","props","_defineProperty","OS","setState","showPermissionWarning","openURL","eventToAdd","message","status","requestCalendarPermissionsAsync","showWarningPopup","calendars","getCalendarsAsync","EntityTypes","EVENT","length","filter","c","allowsModifications","map","id","title","source","name","color","type","orderBy","calendar","eventId","createEventAsync","error","console","log","state","renderPermission","createElement","text","options","action","goToPermissionSettings","bold","closeWarningPopup","renderCalendars","style","styles","calendarsPopup","height","onClose","onCloseCalendars","calendarPopupTitle","calendarPopupContainer","flex","showsVerticalScrollIndicator","cal","key","onPress","onSelectCalendar","calendarContainer","backgroundColor","calendarText","marginTop","colourBrandingMain","renderMessage","onCloseMessage","render","_extends","onAdd","children","create","width","maxHeight","padding","borderRadius","fontFamily","fontSize","marginBottom","justifyContent","flexDirection","alignItems","paddingHorizontal","textAlign","mapStateToProps","button"],"sources":["AddToCalendarButton.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { Platform, Linking, StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport * as Calendar from 'expo-calendar';\nimport { TEXT_DARK, getMainBrandingColourFromState } from '../colours';\nimport { InlineButton } from './InlineButton';\nimport { Popup } from './Popup';\nimport { MiddlePopup } from './MiddlePopup';\n\nconst DEFAULT_TITLE = 'Add to Calendar';\nconst ERROR_EVENT_ADD = 'There was a problem adding a calendar event.';\n\n// Required: eventToAdd\n// Documentation: https://docs.expo.dev/versions/latest/sdk/calendar/#event\nclass AddToCalendarButton extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n showPermissionWarning: false,\n calendars: null,\n message: null,\n };\n }\n\n showWarningPopup = () => {\n if (Platform.OS !== 'ios') return;\n this.setState({ showPermissionWarning: true });\n };\n\n closeWarningPopup = () => {\n this.setState({ showPermissionWarning: false });\n };\n\n goToPermissionSettings = () => {\n Linking.openURL('app-settings:');\n this.setState({ showPermissionWarning: false });\n };\n\n onAdd = async () => {\n if (!this.props.eventToAdd) {\n this.setState({ message: 'There is no event to add' });\n return;\n }\n\n const { status } = await Calendar.requestCalendarPermissionsAsync();\n if (status !== 'granted') {\n this.showWarningPopup();\n } else {\n let calendars = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);\n // console.log('all calendars', calendars);\n if (calendars && calendars.length > 0) {\n calendars = calendars\n .filter(c => c.allowsModifications)\n .map(c => {\n return {\n id: c.id,\n title: c.title,\n source: c.source.name,\n color: c.color,\n type: c.type,\n };\n });\n calendars = _.orderBy(calendars, ['source', 'title']);\n // console.log('sorted calendars', calendars);\n }\n this.setState({ calendars });\n }\n };\n\n onCloseCalendars = () => {\n this.setState({ calendars: null });\n };\n\n onSelectCalendar = async calendar => {\n try {\n const { eventToAdd } = this.props;\n if (!eventToAdd) return;\n\n const eventId = await Calendar.createEventAsync(calendar.id, eventToAdd);\n\n this.setState({\n calendars: null,\n message: eventId ? `${eventToAdd.title} was added to ${calendar.title} successfully.` : ERROR_EVENT_ADD,\n });\n } catch (error) {\n console.log('onSelectCalendar', error);\n this.setState({ calendars: null, message: ERROR_EVENT_ADD });\n }\n };\n\n onCloseMessage = () => {\n this.setState({ message: null });\n };\n\n renderPermission() {\n return (\n <Popup\n title=\"Permissions missing\"\n text=\"You must grant access to the Calendars. Tap Go to settings to change your permission settings.\"\n options={[\n {\n text: 'Go to settings',\n action: this.goToPermissionSettings,\n bold: true,\n },\n {\n text: 'Ignore',\n action: this.closeWarningPopup,\n },\n ]}\n />\n );\n }\n\n renderCalendars(calendars) {\n return (\n <MiddlePopup style={[styles.calendarsPopup, { height: calendars.length * 60 + 120 }]} onClose={this.onCloseCalendars}>\n <Text style={styles.calendarPopupTitle}>Select Calendar</Text>\n <View style={styles.calendarPopupContainer}>\n <ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}>\n {calendars.map(cal => {\n return (\n <TouchableOpacity key={cal.id} onPress={() => this.onSelectCalendar(cal)}>\n <View style={[styles.calendarContainer, { backgroundColor: cal.color }]}>\n <Text style={styles.calendarText}>{`${cal.source}${cal.source === cal.title ? '' : `\\n${cal.title}`}`}</Text>\n </View>\n </TouchableOpacity>\n );\n })}\n </ScrollView>\n <TouchableOpacity key={'cancel'} onPress={this.onCloseCalendars}>\n <View style={[styles.calendarContainer, { marginTop: 20, backgroundColor: this.props.colourBrandingMain }]}>\n <Text style={styles.calendarText}>Cancel</Text>\n </View>\n </TouchableOpacity>\n </View>\n </MiddlePopup>\n );\n }\n\n renderMessage(message) {\n return (\n <Popup\n title=\"Add to Calendar\"\n text={message}\n options={[\n {\n text: 'Ok',\n action: this.onCloseMessage,\n },\n ]}\n />\n );\n }\n\n render() {\n const { showPermissionWarning, calendars, message } = this.state;\n\n if (showPermissionWarning) return this.renderPermission();\n if (calendars && calendars.length > 0) return this.renderCalendars(calendars);\n if (message) return this.renderMessage(message);\n\n return (\n <InlineButton {...this.props} onPress={this.onAdd}>\n {this.props.children || DEFAULT_TITLE}\n </InlineButton>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n calendarsPopup: {\n width: 250,\n maxHeight: 400,\n padding: 16,\n borderRadius: 12,\n },\n calendarPopupTitle: {\n fontFamily: 'sf-bold',\n color: TEXT_DARK,\n fontSize: 18,\n marginBottom: 16,\n },\n calendarPopupContainer: {\n flex: 1,\n justifyContent: 'space-between',\n },\n calendarContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n width: 200,\n height: 40,\n paddingHorizontal: 8,\n borderRadius: 4,\n marginBottom: 10,\n },\n calendarText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n flex: 1,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst button = connect(mapStateToProps, {})(AddToCalendarButton);\nexport { button as AddToCalendarButton };\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AACtG,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,SAASC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AACtE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,aAAa,GAAG,iBAAiB;AACvC,MAAMC,eAAe,GAAG,8CAA8C;;AAEtE;AACA;AACA,MAAMC,mBAAmB,SAASlB,SAAS,CAAC;EAC1CmB,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,2BASI,MAAM;MACvB,IAAIpB,QAAQ,CAACqB,EAAE,KAAK,KAAK,EAAE;MAC3B,IAAI,CAACC,QAAQ,CAAC;QAAEC,qBAAqB,EAAE;MAAK,CAAC,CAAC;IAChD,CAAC;IAAAH,eAAA,4BAEmB,MAAM;MACxB,IAAI,CAACE,QAAQ,CAAC;QAAEC,qBAAqB,EAAE;MAAM,CAAC,CAAC;IACjD,CAAC;IAAAH,eAAA,iCAEwB,MAAM;MAC7BnB,OAAO,CAACuB,OAAO,CAAC,eAAe,CAAC;MAChC,IAAI,CAACF,QAAQ,CAAC;QAAEC,qBAAqB,EAAE;MAAM,CAAC,CAAC;IACjD,CAAC;IAAAH,eAAA,gBAEO,YAAY;MAClB,IAAI,CAAC,IAAI,CAACD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B,kBAAkB,EAAE;IAClBwB,UAAU,EAAE,SAAS;IACrBjD,KAAK,EAAEjC,SAAS;IAChBmF,QAAQ,EAAE,EAAE;IACZC,YAAY,EAAE;EAChB,CAAC;EACDzB,sBAAsB,EAAE;IACtBC,IAAI,EAAE,CAAC;IACPyB,cAAc,EAAE;EAClB,CAAC;EACDnB,iBAAiB,EAAE;IACjBoB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBT,KAAK,EAAE,GAAG;IACVvB,MAAM,EAAE,EAAE;IACViC,iBAAiB,EAAE,CAAC;IACpBP,YAAY,EAAE,CAAC;IACfG,YAAY,EAAE;EAChB,CAAC;EACDhB,YAAY,EAAE;IACZnC,KAAK,EAAE,MAAM;IACbwD,SAAS,EAAE,QAAQ;IACnBP,UAAU,EAAE,aAAa;IACzBC,QAAQ,EAAE,EAAE;IACZvB,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,MAAM8B,eAAe,GAAGhD,KAAK,IAAI;EAC/B,OAAO;IACL4B,kBAAkB,EAAErE,8BAA8B,CAACyC,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMiD,MAAM,GAAG9F,OAAO,CAAC6F,eAAe,EAAE,CAAC,CAAC,CAAC,CAACnF,mBAAmB,CAAC;AAChE,SAASoF,MAAM,IAAIpF,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["React","Component","Text","Platform","Linking","StyleSheet","View","TouchableOpacity","ScrollView","connect","_","Calendar","TEXT_DARK","getMainBrandingColourFromState","InlineButton","Popup","MiddlePopup","DEFAULT_TITLE","ERROR_EVENT_ADD","AddToCalendarButton","constructor","props","_defineProperty","OS","setState","showPermissionWarning","openURL","eventToAdd","message","status","requestCalendarPermissionsAsync","showWarningPopup","calendars","getCalendarsAsync","EntityTypes","EVENT","length","filter","c","allowsModifications","map","id","title","source","name","color","type","orderBy","calendar","eventId","createEventAsync","error","console","log","state","renderPermission","createElement","text","options","action","goToPermissionSettings","bold","closeWarningPopup","renderCalendars","style","styles","calendarsPopup","height","onClose","onCloseCalendars","calendarPopupTitle","calendarPopupContainer","flex","showsVerticalScrollIndicator","cal","key","onPress","onSelectCalendar","calendarContainer","backgroundColor","calendarText","marginTop","colourBrandingMain","renderMessage","onCloseMessage","render","_extends","onAdd","children","create","width","maxHeight","padding","borderRadius","fontFamily","fontSize","marginBottom","justifyContent","flexDirection","alignItems","paddingHorizontal","textAlign","mapStateToProps","button"],"sources":["AddToCalendarButton.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tPlatform,\n\tLinking,\n\tStyleSheet,\n\tView,\n\tTouchableOpacity,\n\tScrollView,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport * as Calendar from \"expo-calendar\";\nimport { TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\nimport { InlineButton } from \"./InlineButton\";\nimport { Popup } from \"./Popup\";\nimport { MiddlePopup } from \"./MiddlePopup\";\n\nconst DEFAULT_TITLE = \"Add to Calendar\";\nconst ERROR_EVENT_ADD = \"There was a problem adding a calendar event.\";\n\n// Required: eventToAdd\n// Documentation: https://docs.expo.dev/versions/latest/sdk/calendar/#event\nclass AddToCalendarButton extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tshowPermissionWarning: false,\n\t\t\tcalendars: null,\n\t\t\tmessage: null,\n\t\t};\n\t}\n\n\tshowWarningPopup = () => {\n\t\tif (Platform.OS !== \"ios\") return;\n\t\tthis.setState({ showPermissionWarning: true });\n\t};\n\n\tcloseWarningPopup = () => {\n\t\tthis.setState({ showPermissionWarning: false });\n\t};\n\n\tgoToPermissionSettings = () => {\n\t\tLinking.openURL(\"app-settings:\");\n\t\tthis.setState({ showPermissionWarning: false });\n\t};\n\n\tonAdd = async () => {\n\t\tif (!this.props.eventToAdd) {\n\t\t\tthis.setState({ message: \"There is no event to add\" });\n\t\t\treturn;\n\t\t}\n\n\t\tconst { status } = await Calendar.requestCalendarPermissionsAsync();\n\t\tif (status !== \"granted\") {\n\t\t\tthis.showWarningPopup();\n\t\t} else {\n\t\t\tlet calendars = await Calendar.getCalendarsAsync(\n\t\t\t\tCalendar.EntityTypes.EVENT,\n\t\t\t);\n\t\t\t// console.log('all calendars', calendars);\n\t\t\tif (calendars && calendars.length > 0) {\n\t\t\t\tcalendars = calendars\n\t\t\t\t\t.filter((c) => c.allowsModifications)\n\t\t\t\t\t.map((c) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: c.id,\n\t\t\t\t\t\t\ttitle: c.title,\n\t\t\t\t\t\t\tsource: c.source.name,\n\t\t\t\t\t\t\tcolor: c.color,\n\t\t\t\t\t\t\ttype: c.type,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\tcalendars = _.orderBy(calendars, [\"source\", \"title\"]);\n\t\t\t\t// console.log('sorted calendars', calendars);\n\t\t\t}\n\t\t\tthis.setState({ calendars });\n\t\t}\n\t};\n\n\tonCloseCalendars = () => {\n\t\tthis.setState({ calendars: null });\n\t};\n\n\tonSelectCalendar = async (calendar) => {\n\t\ttry {\n\t\t\tconst { eventToAdd } = this.props;\n\t\t\tif (!eventToAdd) return;\n\n\t\t\tconst eventId = await Calendar.createEventAsync(calendar.id, eventToAdd);\n\n\t\t\tthis.setState({\n\t\t\t\tcalendars: null,\n\t\t\t\tmessage: eventId\n\t\t\t\t\t? `${eventToAdd.title} was added to ${calendar.title} successfully.`\n\t\t\t\t\t: ERROR_EVENT_ADD,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.log(\"onSelectCalendar\", error);\n\t\t\tthis.setState({ calendars: null, message: ERROR_EVENT_ADD });\n\t\t}\n\t};\n\n\tonCloseMessage = () => {\n\t\tthis.setState({ message: null });\n\t};\n\n\trenderPermission() {\n\t\treturn (\n\t\t\t<Popup\n\t\t\t\ttitle=\"Permissions missing\"\n\t\t\t\ttext=\"You must grant access to the Calendars. Tap Go to settings to change your permission settings.\"\n\t\t\t\toptions={[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"Go to settings\",\n\t\t\t\t\t\taction: this.goToPermissionSettings,\n\t\t\t\t\t\tbold: true,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"Ignore\",\n\t\t\t\t\t\taction: this.closeWarningPopup,\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderCalendars(calendars) {\n\t\treturn (\n\t\t\t<MiddlePopup\n\t\t\t\tstyle={[styles.calendarsPopup, { height: calendars.length * 60 + 120 }]}\n\t\t\t\tonClose={this.onCloseCalendars}\n\t\t\t>\n\t\t\t\t<Text style={styles.calendarPopupTitle}>Select Calendar</Text>\n\t\t\t\t<View style={styles.calendarPopupContainer}>\n\t\t\t\t\t<ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}>\n\t\t\t\t\t\t{calendars.map((cal) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\tkey={cal.id}\n\t\t\t\t\t\t\t\t\tonPress={() => this.onSelectCalendar(cal)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\t\t\tstyles.calendarContainer,\n\t\t\t\t\t\t\t\t\t\t\t{ backgroundColor: cal.color },\n\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\tstyle={styles.calendarText}\n\t\t\t\t\t\t\t\t\t\t>{`${cal.source}${cal.source === cal.title ? \"\" : `\\n${cal.title}`}`}</Text>\n\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ScrollView>\n\t\t\t\t\t<TouchableOpacity key={\"cancel\"} onPress={this.onCloseCalendars}>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\tstyles.calendarContainer,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmarginTop: 20,\n\t\t\t\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text style={styles.calendarText}>Cancel</Text>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t</View>\n\t\t\t</MiddlePopup>\n\t\t);\n\t}\n\n\trenderMessage(message) {\n\t\treturn (\n\t\t\t<Popup\n\t\t\t\ttitle=\"Add to Calendar\"\n\t\t\t\ttext={message}\n\t\t\t\toptions={[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"Ok\",\n\t\t\t\t\t\taction: this.onCloseMessage,\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { showPermissionWarning, calendars, message } = this.state;\n\n\t\tif (showPermissionWarning) return this.renderPermission();\n\t\tif (calendars && calendars.length > 0)\n\t\t\treturn this.renderCalendars(calendars);\n\t\tif (message) return this.renderMessage(message);\n\n\t\treturn (\n\t\t\t<InlineButton {...this.props} onPress={this.onAdd}>\n\t\t\t\t{this.props.children || DEFAULT_TITLE}\n\t\t\t</InlineButton>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcalendarsPopup: {\n\t\twidth: 250,\n\t\tmaxHeight: 400,\n\t\tpadding: 16,\n\t\tborderRadius: 12,\n\t},\n\tcalendarPopupTitle: {\n\t\tfontFamily: \"sf-bold\",\n\t\tcolor: TEXT_DARK,\n\t\tfontSize: 18,\n\t\tmarginBottom: 16,\n\t},\n\tcalendarPopupContainer: {\n\t\tflex: 1,\n\t\tjustifyContent: \"space-between\",\n\t},\n\tcalendarContainer: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\twidth: 200,\n\t\theight: 40,\n\t\tpaddingHorizontal: 8,\n\t\tborderRadius: 4,\n\t\tmarginBottom: 10,\n\t},\n\tcalendarText: {\n\t\tcolor: \"#fff\",\n\t\ttextAlign: \"center\",\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 13,\n\t\tflex: 1,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst button = connect(mapStateToProps, {})(AddToCalendarButton);\nexport { button as AddToCalendarButton };\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,SAASC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AACtE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,aAAa,GAAG,iBAAiB;AACvC,MAAMC,eAAe,GAAG,8CAA8C;;AAEtE;AACA;AACA,MAAMC,mBAAmB,SAASlB,SAAS,CAAC;EAC3CmB,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,2BASK,MAAM;MACxB,IAAInB,QAAQ,CAACoB,EAAE,KAAK,KAAK,EAAE;MAC3B,IAAI,CAACC,QAAQ,CAAC;QAAEC,qBAAqB,EAAE;MAAK,CAAC,CAAC;IAC/C,C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AAwE,QAAA,KAAK,IAAI,CAACjE,KAAK;MAAEuD,OAAO,EAAE,IAAI,CAACW;IAAM,IAChD,IAAI,CAAClE,KAAK,CAACmE,QAAQ,IAAIvE,aACX,CAAC;EAEjB;AACD;AAEA,MAAMgD,MAAM,GAAG5D,UAAU,CAACoF,MAAM,CAAC;EAChCvB,cAAc,EAAE;IACfwB,KAAK,EAAE,GAAG;IACVC,SAAS,EAAE,GAAG;IACdC,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE;EACf,CAAC;EACDvB,kBAAkB,EAAE;IACnBwB,UAAU,EAAE,SAAS;IACrBjD,KAAK,EAAEjC,SAAS;IAChBmF,QAAQ,EAAE,EAAE;IACZC,YAAY,EAAE;EACf,CAAC;EACDzB,sBAAsB,EAAE;IACvBC,IAAI,EAAE,CAAC;IACPyB,cAAc,EAAE;EACjB,CAAC;EACDnB,iBAAiB,EAAE;IAClBoB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBT,KAAK,EAAE,GAAG;IACVvB,MAAM,EAAE,EAAE;IACViC,iBAAiB,EAAE,CAAC;IACpBP,YAAY,EAAE,CAAC;IACfG,YAAY,EAAE;EACf,CAAC;EACDhB,YAAY,EAAE;IACbnC,KAAK,EAAE,MAAM;IACbwD,SAAS,EAAE,QAAQ;IACnBP,UAAU,EAAE,aAAa;IACzBC,QAAQ,EAAE,EAAE;IACZvB,IAAI,EAAE;EACP;AACD,CAAC,CAAC;AAEF,MAAM8B,eAAe,GAAIhD,KAAK,IAAK;EAClC,OAAO;IACN4B,kBAAkB,EAAErE,8BAA8B,CAACyC,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMiD,MAAM,GAAG9F,OAAO,CAAC6F,eAAe,EAAE,CAAC,CAAC,CAAC,CAACnF,mBAAmB,CAAC;AAChE,SAASoF,MAAM,IAAIpF,mBAAmB","ignoreList":[]}
@@ -1,8 +1,9 @@
1
- import React, { PureComponent } from 'react';
2
- import { TouchableOpacity, View, Text } from 'react-native';
3
- import { connect } from 'react-redux';
4
- import { Icon } from 'react-native-elements';
5
- import { getLightBrandingColourFromState, getMainBrandingColourFromState } from '../colours';
1
+ import React, { PureComponent } from "react";
2
+ import { TouchableOpacity, View } from "react-native";
3
+ import { Text } from "./Text";
4
+ import { connect } from "react-redux";
5
+ import { Icon } from "@rneui/themed";
6
+ import { getLightBrandingColourFromState, getMainBrandingColourFromState } from "../colours";
6
7
  class Attachment extends PureComponent {
7
8
  render() {
8
9
  return /*#__PURE__*/React.createElement(TouchableOpacity, {
@@ -28,18 +29,18 @@ class Attachment extends PureComponent {
28
29
  const styles = {
29
30
  pdfAttachment: {
30
31
  padding: 4,
31
- flexDirection: 'row',
32
+ flexDirection: "row",
32
33
  borderRadius: 2,
33
34
  marginTop: 8,
34
- alignItems: 'center',
35
- alignSelf: 'flex-start'
35
+ alignItems: "center",
36
+ alignSelf: "flex-start"
36
37
  },
37
38
  pdfAttachmentIcon: {
38
39
  fontSize: 16,
39
40
  marginRight: 4
40
41
  },
41
42
  pdfAttachmentText: {
42
- fontFamily: 'sf-semibold',
43
+ fontFamily: "sf-semibold",
43
44
  fontSize: 13
44
45
  }
45
46
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","PureComponent","TouchableOpacity","View","Text","connect","Icon","getLightBrandingColourFromState","getMainBrandingColourFromState","Attachment","render","createElement","key","props","onPress","style","styles","pdfAttachment","backgroundColor","colourBrandingLight","name","type","iconStyle","pdfAttachmentIcon","color","colourBrandingMain","pdfAttachmentText","title","padding","flexDirection","borderRadius","marginTop","alignItems","alignSelf","fontSize","marginRight","fontFamily","mapStateToProps","state","attachment"],"sources":["Attachment.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { TouchableOpacity, View, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { Icon } from 'react-native-elements';\nimport { getLightBrandingColourFromState, getMainBrandingColourFromState } from '../colours';\n\nclass Attachment extends PureComponent {\n render() {\n return (\n <TouchableOpacity key={this.props.key} onPress={this.props.onPress}>\n <View style={[styles.pdfAttachment, { backgroundColor: this.props.colourBrandingLight }]}>\n <Icon name=\"paperclip\" type=\"font-awesome\" iconStyle={[styles.pdfAttachmentIcon, { color: this.props.colourBrandingMain }]} />\n <Text style={[styles.pdfAttachmentText, { color: this.props.colourBrandingMain }]}>{this.props.title}</Text>\n </View>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n pdfAttachment: {\n padding: 4,\n flexDirection: 'row',\n borderRadius: 2,\n marginTop: 8,\n alignItems: 'center',\n alignSelf: 'flex-start',\n },\n pdfAttachmentIcon: {\n fontSize: 16,\n marginRight: 4,\n },\n pdfAttachmentText: {\n fontFamily: 'sf-semibold',\n fontSize: 13,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n colourBrandingLight: getLightBrandingColourFromState(state),\n };\n};\n\nconst attachment = connect(mapStateToProps, {})(Attachment);\nexport { attachment as Attachment };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,+BAA+B,EAAEC,8BAA8B,QAAQ,YAAY;AAE5F,MAAMC,UAAU,SAASR,aAAa,CAAC;EACrCS,MAAMA,CAAA,EAAG;IACP,oBACEV,KAAA,CAAAW,aAAA,CAACT,gBAAgB;MAACU,GAAG,EAAE,IAAI,CAACC,KAAK,CAACD,GAAI;MAACE,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC;IAAQ,gBACjEd,KAAA,CAAAW,aAAA,CAACR,IAAI;MAACY,KAAK,EAAE,CAACC,MAAM,CAACC,aAAa,EAAE;QAAEC,eAAe,EAAE,IAAI,CAACL,KAAK,CAACM;MAAoB,CAAC;IAAE,gBACvFnB,KAAA,CAAAW,aAAA,CAACL,IAAI;MAACc,IAAI,EAAC,WAAW;MAACC,IAAI,EAAC,cAAc;MAACC,SAAS,EAAE,CAACN,MAAM,CAACO,iBAAiB,EAAE;QAAEC,KAAK,EAAE,IAAI,CAACX,KAAK,CAACY;MAAmB,CAAC;IAAE,CAAE,CAAC,eAC9HzB,KAAA,CAAAW,aAAA,CAACP,IAAI;MAACW,KAAK,EAAE,CAACC,MAAM,CAACU,iBAAiB,EAAE;QAAEF,KAAK,EAAE,IAAI,CAACX,KAAK,CAACY;MAAmB,CAAC;IAAE,GAAE,IAAI,CAACZ,KAAK,CAACc,KAAY,CACvG,CACU,CAAC;EAEvB;AACF;AAEA,MAAMX,MAAM,GAAG;EACbC,aAAa,EAAE;IACbW,OAAO,EAAE,CAAC;IACVC,aAAa,EAAE,KAAK;IACpBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE;EACb,CAAC;EACDV,iBAAiB,EAAE;IACjBW,QAAQ,EAAE,EAAE;IACZC,WAAW,EAAE;EACf,CAAC;EACDT,iBAAiB,EAAE;IACjBU,UAAU,EAAE,aAAa;IACzBF,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,MAAMG,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLb,kBAAkB,EAAEjB,8BAA8B,CAAC8B,KAAK,CAAC;IACzDnB,mBAAmB,EAAEZ,+BAA+B,CAAC+B,KAAK;EAC5D,CAAC;AACH,CAAC;AAED,MAAMC,UAAU,GAAGlC,OAAO,CAACgC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC5B,UAAU,CAAC;AAC3D,SAAS8B,UAAU,IAAI9B,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["React","PureComponent","TouchableOpacity","View","Text","connect","Icon","getLightBrandingColourFromState","getMainBrandingColourFromState","Attachment","render","createElement","key","props","onPress","style","styles","pdfAttachment","backgroundColor","colourBrandingLight","name","type","iconStyle","pdfAttachmentIcon","color","colourBrandingMain","pdfAttachmentText","title","padding","flexDirection","borderRadius","marginTop","alignItems","alignSelf","fontSize","marginRight","fontFamily","mapStateToProps","state","attachment"],"sources":["Attachment.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { TouchableOpacity, View } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport { Icon } from \"@rneui/themed\";\nimport {\n\tgetLightBrandingColourFromState,\n\tgetMainBrandingColourFromState,\n} from \"../colours\";\n\nclass Attachment extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<TouchableOpacity key={this.props.key} onPress={this.props.onPress}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.pdfAttachment,\n\t\t\t\t\t\t{ backgroundColor: this.props.colourBrandingLight },\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tname=\"paperclip\"\n\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\t\tstyles.pdfAttachmentIcon,\n\t\t\t\t\t\t\t{ color: this.props.colourBrandingMain },\n\t\t\t\t\t\t]}\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.pdfAttachmentText,\n\t\t\t\t\t\t\t{ color: this.props.colourBrandingMain },\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.props.title}\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\tpdfAttachment: {\n\t\tpadding: 4,\n\t\tflexDirection: \"row\",\n\t\tborderRadius: 2,\n\t\tmarginTop: 8,\n\t\talignItems: \"center\",\n\t\talignSelf: \"flex-start\",\n\t},\n\tpdfAttachmentIcon: {\n\t\tfontSize: 16,\n\t\tmarginRight: 4,\n\t},\n\tpdfAttachmentText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 13,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tcolourBrandingLight: getLightBrandingColourFromState(state),\n\t};\n};\n\nconst attachment = connect(mapStateToProps, {})(Attachment);\nexport { attachment as Attachment };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,IAAI,QAAQ,eAAe;AACpC,SACCC,+BAA+B,EAC/BC,8BAA8B,QACxB,YAAY;AAEnB,MAAMC,UAAU,SAASR,aAAa,CAAC;EACtCS,MAAMA,CAAA,EAAG;IACR,oBACCV,KAAA,CAAAW,aAAA,CAACT,gBAAgB;MAACU,GAAG,EAAE,IAAI,CAACC,KAAK,CAACD,GAAI;MAACE,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC;IAAQ,gBAClEd,KAAA,CAAAW,aAAA,CAACR,IAAI;MACJY,KAAK,EAAE,CACNC,MAAM,CAACC,aAAa,EACpB;QAAEC,eAAe,EAAE,IAAI,CAACL,KAAK,CAACM;MAAoB,CAAC;IAClD,gBAEFnB,KAAA,CAAAW,aAAA,CAACL,IAAI;MACJc,IAAI,EAAC,WAAW;MAChBC,IAAI,EAAC,cAAc;MACnBC,SAAS,EAAE,CACVN,MAAM,CAACO,iBAAiB,EACxB;QAAEC,KAAK,EAAE,IAAI,CAACX,KAAK,CAACY;MAAmB,CAAC;IACvC,CACF,CAAC,eACFzB,KAAA,CAAAW,aAAA,CAACP,IAAI;MACJW,KAAK,EAAE,CACNC,MAAM,CAACU,iBAAiB,EACxB;QAAEF,KAAK,EAAE,IAAI,CAACX,KAAK,CAACY;MAAmB,CAAC;IACvC,GAED,IAAI,CAACZ,KAAK,CAACc,KACP,CACD,CACW,CAAC;EAErB;AACD;AAEA,MAAMX,MAAM,GAAG;EACdC,aAAa,EAAE;IACdW,OAAO,EAAE,CAAC;IACVC,aAAa,EAAE,KAAK;IACpBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE;EACZ,CAAC;EACDV,iBAAiB,EAAE;IAClBW,QAAQ,EAAE,EAAE;IACZC,WAAW,EAAE;EACd,CAAC;EACDT,iBAAiB,EAAE;IAClBU,UAAU,EAAE,aAAa;IACzBF,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAMG,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNb,kBAAkB,EAAEjB,8BAA8B,CAAC8B,KAAK,CAAC;IACzDnB,mBAAmB,EAAEZ,+BAA+B,CAAC+B,KAAK;EAC3D,CAAC;AACF,CAAC;AAED,MAAMC,UAAU,GAAGlC,OAAO,CAACgC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC5B,UAAU,CAAC;AAC3D,SAAS8B,UAAU,IAAI9B,UAAU","ignoreList":[]}
@@ -1,12 +1,12 @@
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, { PureComponent } from 'react';
5
- import { StyleSheet } from 'react-native';
6
- import { connect } from 'react-redux';
7
- import { FormCardSectionOptionLauncher } from './FormCardSectionOptionLauncher';
8
- import { getMainBrandingColourFromState, TEXT_DARK } from '../colours';
9
- import { Services } from '../config';
4
+ import React, { PureComponent } from "react";
5
+ import { StyleSheet } from "react-native";
6
+ import { connect } from "react-redux";
7
+ import { FormCardSectionOptionLauncher } from "./FormCardSectionOptionLauncher";
8
+ import { getMainBrandingColourFromState, TEXT_DARK } from "../colours";
9
+ import { Services } from "../config";
10
10
  class AudienceSelectorLauncher extends PureComponent {
11
11
  constructor(...args) {
12
12
  super(...args);
@@ -16,9 +16,9 @@ class AudienceSelectorLauncher extends PureComponent {
16
16
  audienceType,
17
17
  audienceTypeSelection
18
18
  } = this.props;
19
- Services.navigation.navigate('audienceSelectorPage', {
19
+ Services.navigation.navigate("audienceSelectorPage", {
20
20
  site: user.site,
21
- audienceType: audienceType || 'Custom',
21
+ audienceType: audienceType || "Custom",
22
22
  audienceTypeSelection: audienceTypeSelection || [],
23
23
  onChange: (audienceType, audienceTypeSelection) => {
24
24
  if (this.props.onChange) this.props.onChange(audienceType, audienceTypeSelection);
@@ -32,14 +32,14 @@ class AudienceSelectorLauncher extends PureComponent {
32
32
  textStyle,
33
33
  audienceTypeSelection
34
34
  } = this.props;
35
- const selected = audienceTypeSelection && audienceTypeSelection.length > 0 ? `Current selection: ${audienceTypeSelection.map(i => i.Title).join(', ')}` : '';
35
+ const selected = audienceTypeSelection && audienceTypeSelection.length > 0 ? `Current selection: ${audienceTypeSelection.map(i => i.Title).join(", ")}` : "";
36
36
  return /*#__PURE__*/React.createElement(FormCardSectionOptionLauncher, {
37
37
  sectionStyle: [styles.audienceSection, style],
38
38
  textStyle: [styles.audienceText, textStyle],
39
39
  onPress: this.onPressAudience,
40
40
  title: "Audience",
41
41
  description: selected,
42
- value: selected ? 'Custom' : 'All Users'
42
+ value: selected ? "Custom" : "All Users"
43
43
  });
44
44
  }
45
45
  }
@@ -48,7 +48,7 @@ const styles = StyleSheet.create({
48
48
  paddingHorizontal: 0
49
49
  },
50
50
  audienceText: {
51
- fontFamily: 'sf-semibold',
51
+ fontFamily: "sf-semibold",
52
52
  fontSize: 16,
53
53
  color: TEXT_DARK
54
54
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","PureComponent","StyleSheet","connect","FormCardSectionOptionLauncher","getMainBrandingColourFromState","TEXT_DARK","Services","AudienceSelectorLauncher","constructor","args","_defineProperty","user","audienceType","audienceTypeSelection","props","navigation","navigate","site","onChange","render","style","textStyle","selected","length","map","i","Title","join","createElement","sectionStyle","styles","audienceSection","audienceText","onPress","onPressAudience","title","description","value","create","paddingHorizontal","fontFamily","fontSize","color","mapStateToProps","state","colourBrandingMain","audienceSelectorLauncher"],"sources":["AudienceSelectorLauncher.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { StyleSheet } from 'react-native';\nimport { connect } from 'react-redux';\nimport { FormCardSectionOptionLauncher } from './FormCardSectionOptionLauncher';\nimport { getMainBrandingColourFromState, TEXT_DARK } from '../colours';\nimport { Services } from '../config';\n\nclass AudienceSelectorLauncher extends PureComponent {\n onPressAudience = () => {\n const { user, audienceType, audienceTypeSelection } = this.props;\n\n Services.navigation.navigate('audienceSelectorPage', {\n site: user.site,\n audienceType: audienceType || 'Custom',\n audienceTypeSelection: audienceTypeSelection || [],\n onChange: (audienceType, audienceTypeSelection) => {\n if (this.props.onChange) this.props.onChange(audienceType, audienceTypeSelection);\n },\n });\n };\n\n render() {\n const { style, textStyle, audienceTypeSelection } = this.props;\n const selected =\n audienceTypeSelection && audienceTypeSelection.length > 0\n ? `Current selection: ${audienceTypeSelection.map(i => i.Title).join(', ')}`\n : '';\n\n return (\n <FormCardSectionOptionLauncher\n sectionStyle={[styles.audienceSection, style]}\n textStyle={[styles.audienceText, textStyle]}\n onPress={this.onPressAudience}\n title=\"Audience\"\n description={selected}\n value={selected ? 'Custom' : 'All Users'}\n />\n );\n }\n}\n\nconst styles = StyleSheet.create({\n audienceSection: {\n paddingHorizontal: 0,\n },\n audienceText: {\n fontFamily: 'sf-semibold',\n fontSize: 16,\n color: TEXT_DARK,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n user: state.user,\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst audienceSelectorLauncher = connect(mapStateToProps, {})(AudienceSelectorLauncher);\nexport { audienceSelectorLauncher as AudienceSelectorLauncher };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,8BAA8B,EAAEC,SAAS,QAAQ,YAAY;AACtE,SAASC,QAAQ,QAAQ,WAAW;AAEpC,MAAMC,wBAAwB,SAASP,aAAa,CAAC;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACjC,MAAM;MACtB,MAAM;QAAEC,IAAI;QAAEC,YAAY;QAAEC;MAAsB,CAAC,GAAG,IAAI,CAACC,KAAK;MAEhER,QAAQ,CAACS,UAAU,CAACC,QAAQ,CAAC,sBAAsB,EAAE;QACnDC,IAAI,EAAEN,IAAI,CAACM,IAAI;QACfL,YAAY,EAAEA,YAAY,IAAI,QAAQ;QACtCC,qBAAqB,EAAEA,qBAAqB,IAAI,EAAE;QAClDK,QAAQ,EAAEA,CAACN,YAAY,EAAEC,qBAAqB,KAAK;UACjD,IAAI,IAAI,CAACC,KAAK,CAACI,QAAQ,EAAE,IAAI,CAACJ,KAAK,CAACI,QAAQ,CAACN,YAAY,EAAEC,qBAAqB,CAAC;QACnF;MACF,CAAC,CAAC;IACJ,CAAC;EAAA;EAEDM,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,KAAK;MAAEC,SAAS;MAAER;IAAsB,CAAC,GAAG,IAAI,CAACC,KAAK;IAC9D,MAAMQ,QAAQ,GACZT,qBAAqB,IAAIA,qBAAqB,CAACU,MAAM,GAAG,CAAC,GACrD,sBAAsBV,qBAAqB,CAACW,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE,GAC1E,EAAE;IAER,oBACE5B,KAAA,CAAA6B,aAAA,CAACzB,6BAA6B;MAC5B0B,YAAY,EAAE,CAACC,MAAM,CAACC,eAAe,EAAEX,KAAK,CAAE;MAC9CC,SAAS,EAAE,CAACS,MAAM,CAACE,YAAY,EAAEX,SAAS,CAAE;MAC5CY,OAAO,EAAE,IAAI,CAACC,eAAgB;MAC9BC,KAAK,EAAC,UAAU;MAChBC,WAAW,EAAEd,QAAS;MACtBe,KAAK,EAAEf,QAAQ,GAAG,QAAQ,GAAG;IAAY,CAC1C,CAAC;EAEN;AACF;AAEA,MAAMQ,MAAM,GAAG7B,UAAU,CAACqC,MAAM,CAAC;EAC/BP,eAAe,EAAE;IACfQ,iBAAiB,EAAE;EACrB,CAAC;EACDP,YAAY,EAAE;IACZQ,UAAU,EAAE,aAAa;IACzBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAErC;EACT;AACF,CAAC,CAAC;AAEF,MAAMsC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLjC,IAAI,EAAEiC,KAAK,CAACjC,IAAI;IAChBkC,kBAAkB,EAAEzC,8BAA8B,CAACwC,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAME,wBAAwB,GAAG5C,OAAO,CAACyC,eAAe,EAAE,CAAC,CAAC,CAAC,CAACpC,wBAAwB,CAAC;AACvF,SAASuC,wBAAwB,IAAIvC,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["React","PureComponent","StyleSheet","connect","FormCardSectionOptionLauncher","getMainBrandingColourFromState","TEXT_DARK","Services","AudienceSelectorLauncher","constructor","args","_defineProperty","user","audienceType","audienceTypeSelection","props","navigation","navigate","site","onChange","render","style","textStyle","selected","length","map","i","Title","join","createElement","sectionStyle","styles","audienceSection","audienceText","onPress","onPressAudience","title","description","value","create","paddingHorizontal","fontFamily","fontSize","color","mapStateToProps","state","colourBrandingMain","audienceSelectorLauncher"],"sources":["AudienceSelectorLauncher.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport { FormCardSectionOptionLauncher } from \"./FormCardSectionOptionLauncher\";\nimport { getMainBrandingColourFromState, TEXT_DARK } from \"../colours\";\nimport { Services } from \"../config\";\n\nclass AudienceSelectorLauncher extends PureComponent {\n\tonPressAudience = () => {\n\t\tconst { user, audienceType, audienceTypeSelection } = this.props;\n\n\t\tServices.navigation.navigate(\"audienceSelectorPage\", {\n\t\t\tsite: user.site,\n\t\t\taudienceType: audienceType || \"Custom\",\n\t\t\taudienceTypeSelection: audienceTypeSelection || [],\n\t\t\tonChange: (audienceType, audienceTypeSelection) => {\n\t\t\t\tif (this.props.onChange)\n\t\t\t\t\tthis.props.onChange(audienceType, audienceTypeSelection);\n\t\t\t},\n\t\t});\n\t};\n\n\trender() {\n\t\tconst { style, textStyle, audienceTypeSelection } = this.props;\n\t\tconst selected =\n\t\t\taudienceTypeSelection && audienceTypeSelection.length > 0\n\t\t\t\t? `Current selection: ${audienceTypeSelection.map((i) => i.Title).join(\", \")}`\n\t\t\t\t: \"\";\n\n\t\treturn (\n\t\t\t<FormCardSectionOptionLauncher\n\t\t\t\tsectionStyle={[styles.audienceSection, style]}\n\t\t\t\ttextStyle={[styles.audienceText, textStyle]}\n\t\t\t\tonPress={this.onPressAudience}\n\t\t\t\ttitle=\"Audience\"\n\t\t\t\tdescription={selected}\n\t\t\t\tvalue={selected ? \"Custom\" : \"All Users\"}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\taudienceSection: {\n\t\tpaddingHorizontal: 0,\n\t},\n\taudienceText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_DARK,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tuser: state.user,\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst audienceSelectorLauncher = connect(\n\tmapStateToProps,\n\t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