@plusscommunities/pluss-core-app 8.0.29 → 8.0.31
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.
- package/dist/module/actions/FollowerActions.js +34 -0
- package/dist/module/actions/FollowerActions.js.map +1 -0
- package/dist/module/actions/MediaActions.js +29 -0
- package/dist/module/actions/MediaActions.js.map +1 -0
- package/dist/module/actions/ResidentActions.js +26 -0
- package/dist/module/actions/ResidentActions.js.map +1 -0
- package/dist/module/actions/UserActions.js +223 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/UserSettingsActions.js +14 -0
- package/dist/module/actions/UserSettingsActions.js.map +1 -0
- package/dist/module/actions/index.js +6 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +17 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/analyticsActions.js +20 -0
- package/dist/module/apis/analyticsActions.js.map +1 -0
- package/dist/module/apis/contactActions.js +27 -0
- package/dist/module/apis/contactActions.js.map +1 -0
- package/dist/module/apis/eventActions.js +161 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +93 -0
- package/dist/module/apis/fileActions.js.map +1 -0
- package/dist/module/apis/followerActions.js +38 -0
- package/dist/module/apis/followerActions.js.map +1 -0
- package/dist/module/apis/index.js +13 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/notificationActions.js +60 -0
- package/dist/module/apis/notificationActions.js.map +1 -0
- package/dist/module/apis/profileActions.js +14 -0
- package/dist/module/apis/profileActions.js.map +1 -0
- package/dist/module/apis/reactionActions.js +76 -0
- package/dist/module/apis/reactionActions.js.map +1 -0
- package/dist/module/apis/settingActions.js +22 -0
- package/dist/module/apis/settingActions.js.map +1 -0
- package/dist/module/apis/stringActions.js +30 -0
- package/dist/module/apis/stringActions.js.map +1 -0
- package/dist/module/apis/typeActions.js +15 -0
- package/dist/module/apis/typeActions.js.map +1 -0
- package/dist/module/apis/userActions.js +104 -0
- package/dist/module/apis/userActions.js.map +1 -0
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/dist/module/assets/icons/reactions/heart.png +0 -0
- package/dist/module/assets/icons/reactions/party.png +0 -0
- package/dist/module/assets/icons/reactions/sad.png +0 -0
- package/dist/module/assets/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +165 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +43 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/AddToCalendarButton.js +225 -0
- package/dist/module/components/AddToCalendarButton.js.map +1 -0
- package/dist/module/components/Attachment.js +55 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +64 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +351 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/AutoOffsetImage.js +184 -0
- package/dist/module/components/AutoOffsetImage.js.map +1 -0
- package/dist/module/components/BackButton.js +58 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CalendarPopup.js +126 -0
- package/dist/module/components/CalendarPopup.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +155 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +334 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +823 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +109 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +72 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DocumentUploader.js +253 -0
- package/dist/module/components/DocumentUploader.js.map +1 -0
- package/dist/module/components/DropDownItem.js +75 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +41 -0
- package/dist/module/components/DropDownMenu.js.map +1 -0
- package/dist/module/components/EmptyStateMain.js +51 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +48 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +37 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +76 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/Forbidden.js +58 -0
- package/dist/module/components/Forbidden.js.map +1 -0
- package/dist/module/components/FormCard.js +25 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +214 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +73 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +133 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +151 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +173 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +459 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/Icon.js +109 -0
- package/dist/module/components/Icon.js.map +1 -0
- package/dist/module/components/ImagePopup.js +400 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +69 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +831 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +66 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +156 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +219 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +86 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +46 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +407 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +49 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +296 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +1078 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +299 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +59 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +126 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +120 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +313 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +105 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +78 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +117 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +71 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +189 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +22 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +34 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/Text.js +57 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +24 -0
- package/dist/module/components/TickIcon.js.map +1 -0
- package/dist/module/components/Toggle.js +66 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +68 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +136 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +268 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +113 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +85 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +289 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +117 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +60 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +422 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +387 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +27 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +18 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/helper.js +424 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/index.js +13 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/images/detectFaces.js +31 -0
- package/dist/module/js/images/detectFaces.js.map +1 -0
- package/dist/module/js/images/findLandmarkRange.js +93 -0
- package/dist/module/js/images/findLandmarkRange.js.map +1 -0
- package/dist/module/js/images/getScaledOffset.js +81 -0
- package/dist/module/js/images/getScaledOffset.js.map +1 -0
- package/dist/module/js/site/getSiteLevelFromState.js +29 -0
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -0
- package/dist/module/js/site/isTVEnabled.js +10 -0
- package/dist/module/js/site/isTVEnabled.js.map +1 -0
- package/dist/module/session.js +58 -0
- package/dist/module/session.js.map +1 -0
- package/dist/module/styles.js +67 -0
- package/dist/module/styles.js.map +1 -0
- package/dist/module/withNavigationFocus.js +30 -0
- package/dist/module/withNavigationFocus.js.map +1 -0
- package/package.json +1 -1
- package/src/components/PDFPopup.js +130 -35
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// const COLOUR_1 = '#011d5c';
|
|
2
|
+
// const COLOUR_2 = '#3179cb';
|
|
3
|
+
// const COLOUR_3 = '#1bb7ee';
|
|
4
|
+
const TEXT_DARKEST = "#3e4245";
|
|
5
|
+
const TEXT_DARK = TEXT_DARKEST;
|
|
6
|
+
const TEXT_BLUEGREY = "#6c7a90";
|
|
7
|
+
// const TEXT_DARK_ALPHA50 = 'rgba(60, 60, 80, .5)';
|
|
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";
|
|
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";
|
|
23
|
+
// const COLOUR_TEAL_ALPHA50 = 'rgba(4, 196, 169, 0.2)';
|
|
24
|
+
// const COLOUR_BLUE = '#0083ee';
|
|
25
|
+
// const COLOUR_BLUE_LIVE = 'rgb(0, 173, 238)';
|
|
26
|
+
// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
|
|
27
|
+
// const COLOUR_DARKBLUE = '#191e78';
|
|
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";
|
|
34
|
+
// const COLOUR_CITRON = '#bdbd27';
|
|
35
|
+
// const DARK_OVERLAY = 'rgba(19,19,26,.6)';
|
|
36
|
+
// const FACEBOOK_BLUE = '#3B5998';
|
|
37
|
+
// const COLOUR_NAV_GREY = '#f6f6f6';
|
|
38
|
+
const COLOUR_TRANSPARENT = "rgba(0,0,0,0)";
|
|
39
|
+
// const COLOUR_SIDEBAR = '#303030';
|
|
40
|
+
const COLOUR_BRANDING_MAIN = "#FF6363";
|
|
41
|
+
// const COLOUR_BRANDING_OFF = '#FCE1E1';
|
|
42
|
+
const COLOUR_BRANDING_LIGHT = "#FCE1E1";
|
|
43
|
+
// const COLOUR_BRANDING_SECONDARY = COLOUR_BRANDING_MAIN;
|
|
44
|
+
const COLOUR_BRANDING_DARK = "#D13636";
|
|
45
|
+
// const COLOUR_DAY = '#89c4f4';
|
|
46
|
+
// const COLOUR_NIGHT = '#003159';
|
|
47
|
+
const COLOUR_TAN = "#fff3d1";
|
|
48
|
+
|
|
49
|
+
// const hexToRGB = hex => {
|
|
50
|
+
// // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
51
|
+
// const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
52
|
+
// hex = hex.replace(shorthandRegex, (m, r, g, b) => {
|
|
53
|
+
// return r + r + g + g + b + b;
|
|
54
|
+
// });
|
|
55
|
+
|
|
56
|
+
// const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
57
|
+
// return result
|
|
58
|
+
// ? {
|
|
59
|
+
// r: parseInt(result[1], 16),
|
|
60
|
+
// g: parseInt(result[2], 16),
|
|
61
|
+
// b: parseInt(result[3], 16),
|
|
62
|
+
// }
|
|
63
|
+
// : null;
|
|
64
|
+
// };
|
|
65
|
+
|
|
66
|
+
const hexToRGBAstring = (hex, opacity) => {
|
|
67
|
+
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
68
|
+
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
69
|
+
hex = hex.replace(shorthandRegex, (m, r, g, b) => {
|
|
70
|
+
return r + r + g + g + b + b;
|
|
71
|
+
});
|
|
72
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
73
|
+
return result ? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${opacity})` : null;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// const pctBtwnColours = (c1, c2, percentage) => {
|
|
77
|
+
// const rgbC1 = hexToRGB(c1);
|
|
78
|
+
// const rgbC2 = hexToRGB(c2);
|
|
79
|
+
// const r = rgbC2.r + (rgbC1.r - rgbC2.r) * percentage;
|
|
80
|
+
// const g = rgbC2.g + (rgbC1.g - rgbC2.g) * percentage;
|
|
81
|
+
// const b = rgbC2.b + (rgbC1.b - rgbC2.b) * percentage;
|
|
82
|
+
// return `rgb(${r}, ${g}, ${b})`;
|
|
83
|
+
// };
|
|
84
|
+
|
|
85
|
+
// const getTabIconColour = (mainColour, footerType, selected) => {
|
|
86
|
+
// if (footerType !== 'white') {
|
|
87
|
+
// return '#fff';
|
|
88
|
+
// }
|
|
89
|
+
// if (selected) {
|
|
90
|
+
// return mainColour;
|
|
91
|
+
// }
|
|
92
|
+
// return TEXT_BLUEGREY;
|
|
93
|
+
// };
|
|
94
|
+
|
|
95
|
+
// const getHeaderBrandingColourFromState = state => {
|
|
96
|
+
// return (state && state.user && state.user.siteBranding && state.user.siteBranding.HeaderBrandingColour) || null;
|
|
97
|
+
// };
|
|
98
|
+
|
|
99
|
+
const getMainBrandingColourFromState = state => {
|
|
100
|
+
return state && state.user && state.user.siteBranding && state.user.siteBranding.MainBrandingColour || COLOUR_BRANDING_MAIN;
|
|
101
|
+
};
|
|
102
|
+
const getDarkBrandingColourFromState = state => {
|
|
103
|
+
return state && state.user && state.user.siteBranding && state.user.siteBranding.DarkBrandingColour || COLOUR_BRANDING_DARK;
|
|
104
|
+
};
|
|
105
|
+
const getLightBrandingColourFromState = state => {
|
|
106
|
+
return state && state.user && state.user.siteBranding && state.user.siteBranding.LightBrandingColour || COLOUR_BRANDING_LIGHT;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// const getSecondaryBrandingColourFromState = state => {
|
|
110
|
+
// return (state && state.user && state.user.siteBranding && state.user.siteBranding.SecondaryBrandingColour) || COLOUR_BRANDING_SECONDARY;
|
|
111
|
+
// };
|
|
112
|
+
|
|
113
|
+
// const getMainBrandingColourFromSite = site => {
|
|
114
|
+
// return (site.Branding && site.Branding.MainBrandingColour) || COLOUR_BRANDING_MAIN;
|
|
115
|
+
// };
|
|
116
|
+
|
|
117
|
+
// const getDarkBrandingColourFromSite = site => {
|
|
118
|
+
// return (site.Branding && site.Branding.DarkBrandingColour) || COLOUR_BRANDING_DARK;
|
|
119
|
+
// };
|
|
120
|
+
|
|
121
|
+
// const getLightBrandingColourFromSite = site => {
|
|
122
|
+
// return (site.Branding && site.Branding.LightBrandingColour) || COLOUR_BRANDING_LIGHT;
|
|
123
|
+
// };
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
// COLOUR_1,
|
|
127
|
+
// COLOUR_2,
|
|
128
|
+
// COLOUR_3,
|
|
129
|
+
TEXT_DARKEST, TEXT_BLUEGREY, TEXT_DARK,
|
|
130
|
+
// TEXT_DARK_ALPHA50,
|
|
131
|
+
// TEXT_DARK_ALPHA20,
|
|
132
|
+
TEXT_DARK_ALPHA10, TEXT_MID, TEXT_MID_ALPHA50, TEXT_LIGHT, TEXT_LIGHTER, TEXT_SUPER_LIGHT, BG_GREY, LINEGREY, PINKISH_GREY, BOXGREY,
|
|
133
|
+
// PALE_GREY,
|
|
134
|
+
INACTIVE_BUTTON, INACTIVE_TEXT, COLOUR_TEAL,
|
|
135
|
+
// COLOUR_TEAL_ALPHA50,
|
|
136
|
+
// COLOUR_BLUE,
|
|
137
|
+
// COLOUR_BLUE_LIVE,
|
|
138
|
+
// COLOUR_BLUE_ALPHA10,
|
|
139
|
+
// COLOUR_DARKBLUE,
|
|
140
|
+
// COLOUR_PURPLE,
|
|
141
|
+
COLOUR_RED, COLOUR_TANGERINE,
|
|
142
|
+
// COLOUR_CITRON,
|
|
143
|
+
// DARK_OVERLAY,
|
|
144
|
+
// hexToRGB,
|
|
145
|
+
hexToRGBAstring,
|
|
146
|
+
// pctBtwnColours,
|
|
147
|
+
// FACEBOOK_BLUE,
|
|
148
|
+
// COLOUR_NAV_GREY,
|
|
149
|
+
COLOUR_TRANSPARENT,
|
|
150
|
+
// COLOUR_SIDEBAR,
|
|
151
|
+
COLOUR_BRANDING_MAIN,
|
|
152
|
+
// COLOUR_BRANDING_OFF,
|
|
153
|
+
COLOUR_BRANDING_LIGHT, COLOUR_BRANDING_DARK, COLOUR_GREEN, COLOUR_GREEN_LIGHT, COLOUR_GRAPEFRUIT,
|
|
154
|
+
// COLOUR_DAY,
|
|
155
|
+
// COLOUR_NIGHT,
|
|
156
|
+
COLOUR_TAN,
|
|
157
|
+
// getHeaderBrandingColourFromState,
|
|
158
|
+
getMainBrandingColourFromState, getDarkBrandingColourFromState, getLightBrandingColourFromState
|
|
159
|
+
// getSecondaryBrandingColourFromState,
|
|
160
|
+
// getMainBrandingColourFromSite,
|
|
161
|
+
// getDarkBrandingColourFromSite,
|
|
162
|
+
// getLightBrandingColourFromSite,
|
|
163
|
+
// getTabIconColour,
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=colours.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,OAA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;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":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
|
|
8
|
+
/*
|
|
9
|
+
Props-
|
|
10
|
+
onPress - onPress action
|
|
11
|
+
diameter - size of button
|
|
12
|
+
iconSize - size of inner plus
|
|
13
|
+
color - default will be aveoMain
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class AddButton extends PureComponent {
|
|
17
|
+
render() {
|
|
18
|
+
const size = this.props.diameter || 48;
|
|
19
|
+
const radius = size / 2;
|
|
20
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
21
|
+
style: [Styles.addButton, {
|
|
22
|
+
height: size,
|
|
23
|
+
width: size,
|
|
24
|
+
borderRadius: radius,
|
|
25
|
+
backgroundColor: this.props.colourBrandingMain
|
|
26
|
+
}, this.props.color && {
|
|
27
|
+
backgroundColor: this.props.color
|
|
28
|
+
}, this.props.style],
|
|
29
|
+
onPress: this.props.onPress
|
|
30
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
31
|
+
name: "plus",
|
|
32
|
+
style: Styles.addButtonIcon
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const mapStateToProps = state => {
|
|
37
|
+
return {
|
|
38
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const addButton = connect(mapStateToProps, {})(AddButton);
|
|
42
|
+
export { addButton as AddButton };
|
|
43
|
+
//# sourceMappingURL=AddButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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 { 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.";
|
|
17
|
+
|
|
18
|
+
// Required: eventToAdd
|
|
19
|
+
// Documentation: https://docs.expo.dev/versions/latest/sdk/calendar/#event
|
|
20
|
+
class AddToCalendarButton extends Component {
|
|
21
|
+
constructor(props) {
|
|
22
|
+
super(props);
|
|
23
|
+
_defineProperty(this, "showWarningPopup", () => {
|
|
24
|
+
if (Platform.OS !== "ios") return;
|
|
25
|
+
this.setState({
|
|
26
|
+
showPermissionWarning: true
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
_defineProperty(this, "closeWarningPopup", () => {
|
|
30
|
+
this.setState({
|
|
31
|
+
showPermissionWarning: false
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(this, "goToPermissionSettings", () => {
|
|
35
|
+
Linking.openURL("app-settings:");
|
|
36
|
+
this.setState({
|
|
37
|
+
showPermissionWarning: false
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
_defineProperty(this, "onAdd", async () => {
|
|
41
|
+
if (!this.props.eventToAdd) {
|
|
42
|
+
this.setState({
|
|
43
|
+
message: "There is no event to add"
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const {
|
|
48
|
+
status
|
|
49
|
+
} = await Calendar.requestCalendarPermissionsAsync();
|
|
50
|
+
if (status !== "granted") {
|
|
51
|
+
this.showWarningPopup();
|
|
52
|
+
} else {
|
|
53
|
+
let calendars = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);
|
|
54
|
+
// console.log('all calendars', calendars);
|
|
55
|
+
if (calendars && calendars.length > 0) {
|
|
56
|
+
calendars = calendars.filter(c => c.allowsModifications).map(c => {
|
|
57
|
+
return {
|
|
58
|
+
id: c.id,
|
|
59
|
+
title: c.title,
|
|
60
|
+
source: c.source.name,
|
|
61
|
+
color: c.color,
|
|
62
|
+
type: c.type
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
calendars = _.orderBy(calendars, ["source", "title"]);
|
|
66
|
+
// console.log('sorted calendars', calendars);
|
|
67
|
+
}
|
|
68
|
+
this.setState({
|
|
69
|
+
calendars
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "onCloseCalendars", () => {
|
|
74
|
+
this.setState({
|
|
75
|
+
calendars: null
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
_defineProperty(this, "onSelectCalendar", async calendar => {
|
|
79
|
+
try {
|
|
80
|
+
const {
|
|
81
|
+
eventToAdd
|
|
82
|
+
} = this.props;
|
|
83
|
+
if (!eventToAdd) return;
|
|
84
|
+
const eventId = await Calendar.createEventAsync(calendar.id, eventToAdd);
|
|
85
|
+
this.setState({
|
|
86
|
+
calendars: null,
|
|
87
|
+
message: eventId ? `${eventToAdd.title} was added to ${calendar.title} successfully.` : ERROR_EVENT_ADD
|
|
88
|
+
});
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.log("onSelectCalendar", error);
|
|
91
|
+
this.setState({
|
|
92
|
+
calendars: null,
|
|
93
|
+
message: ERROR_EVENT_ADD
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
_defineProperty(this, "onCloseMessage", () => {
|
|
98
|
+
this.setState({
|
|
99
|
+
message: null
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
this.state = {
|
|
103
|
+
showPermissionWarning: false,
|
|
104
|
+
calendars: null,
|
|
105
|
+
message: null
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
renderPermission() {
|
|
109
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
110
|
+
title: "Permissions missing",
|
|
111
|
+
text: "You must grant access to the Calendars. Tap Go to settings to change your permission settings.",
|
|
112
|
+
options: [{
|
|
113
|
+
text: "Go to settings",
|
|
114
|
+
action: this.goToPermissionSettings,
|
|
115
|
+
bold: true
|
|
116
|
+
}, {
|
|
117
|
+
text: "Ignore",
|
|
118
|
+
action: this.closeWarningPopup
|
|
119
|
+
}]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
renderCalendars(calendars) {
|
|
123
|
+
return /*#__PURE__*/React.createElement(MiddlePopup, {
|
|
124
|
+
style: [styles.calendarsPopup, {
|
|
125
|
+
height: calendars.length * 60 + 120
|
|
126
|
+
}],
|
|
127
|
+
onClose: this.onCloseCalendars
|
|
128
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
129
|
+
style: styles.calendarPopupTitle
|
|
130
|
+
}, "Select Calendar"), /*#__PURE__*/React.createElement(View, {
|
|
131
|
+
style: styles.calendarPopupContainer
|
|
132
|
+
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
133
|
+
style: {
|
|
134
|
+
flex: 1
|
|
135
|
+
},
|
|
136
|
+
showsVerticalScrollIndicator: false
|
|
137
|
+
}, calendars.map(cal => {
|
|
138
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
139
|
+
key: cal.id,
|
|
140
|
+
onPress: () => this.onSelectCalendar(cal)
|
|
141
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
style: [styles.calendarContainer, {
|
|
143
|
+
backgroundColor: cal.color
|
|
144
|
+
}]
|
|
145
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
146
|
+
style: styles.calendarText
|
|
147
|
+
}, `${cal.source}${cal.source === cal.title ? "" : `\n${cal.title}`}`)));
|
|
148
|
+
})), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
149
|
+
key: "cancel",
|
|
150
|
+
onPress: this.onCloseCalendars
|
|
151
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
152
|
+
style: [styles.calendarContainer, {
|
|
153
|
+
marginTop: 20,
|
|
154
|
+
backgroundColor: this.props.colourBrandingMain
|
|
155
|
+
}]
|
|
156
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
157
|
+
style: styles.calendarText
|
|
158
|
+
}, "Cancel")))));
|
|
159
|
+
}
|
|
160
|
+
renderMessage(message) {
|
|
161
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
162
|
+
title: "Add to Calendar",
|
|
163
|
+
text: message,
|
|
164
|
+
options: [{
|
|
165
|
+
text: "Ok",
|
|
166
|
+
action: this.onCloseMessage
|
|
167
|
+
}]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
const {
|
|
172
|
+
showPermissionWarning,
|
|
173
|
+
calendars,
|
|
174
|
+
message
|
|
175
|
+
} = this.state;
|
|
176
|
+
if (showPermissionWarning) return this.renderPermission();
|
|
177
|
+
if (calendars && calendars.length > 0) return this.renderCalendars(calendars);
|
|
178
|
+
if (message) return this.renderMessage(message);
|
|
179
|
+
return /*#__PURE__*/React.createElement(InlineButton, _extends({}, this.props, {
|
|
180
|
+
onPress: this.onAdd
|
|
181
|
+
}), this.props.children || DEFAULT_TITLE);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const styles = StyleSheet.create({
|
|
185
|
+
calendarsPopup: {
|
|
186
|
+
width: 250,
|
|
187
|
+
maxHeight: 400,
|
|
188
|
+
padding: 16,
|
|
189
|
+
borderRadius: 12
|
|
190
|
+
},
|
|
191
|
+
calendarPopupTitle: {
|
|
192
|
+
fontFamily: "sf-bold",
|
|
193
|
+
color: TEXT_DARK,
|
|
194
|
+
fontSize: 18,
|
|
195
|
+
marginBottom: 16
|
|
196
|
+
},
|
|
197
|
+
calendarPopupContainer: {
|
|
198
|
+
flex: 1,
|
|
199
|
+
justifyContent: "space-between"
|
|
200
|
+
},
|
|
201
|
+
calendarContainer: {
|
|
202
|
+
flexDirection: "row",
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
width: 200,
|
|
205
|
+
height: 40,
|
|
206
|
+
paddingHorizontal: 8,
|
|
207
|
+
borderRadius: 4,
|
|
208
|
+
marginBottom: 10
|
|
209
|
+
},
|
|
210
|
+
calendarText: {
|
|
211
|
+
color: "#fff",
|
|
212
|
+
textAlign: "center",
|
|
213
|
+
fontFamily: "sf-semibold",
|
|
214
|
+
fontSize: 13,
|
|
215
|
+
flex: 1
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
const mapStateToProps = state => {
|
|
219
|
+
return {
|
|
220
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
const button = connect(mapStateToProps, {})(AddToCalendarButton);
|
|
224
|
+
export { button as AddToCalendarButton };
|
|
225
|
+
//# sourceMappingURL=AddToCalendarButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,QAA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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":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
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";
|
|
7
|
+
class Attachment extends PureComponent {
|
|
8
|
+
render() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
10
|
+
key: this.props.key,
|
|
11
|
+
onPress: this.props.onPress
|
|
12
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
13
|
+
style: [styles.pdfAttachment, {
|
|
14
|
+
backgroundColor: this.props.colourBrandingLight
|
|
15
|
+
}]
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
+
name: "paperclip",
|
|
18
|
+
type: "font-awesome",
|
|
19
|
+
iconStyle: [styles.pdfAttachmentIcon, {
|
|
20
|
+
color: this.props.colourBrandingMain
|
|
21
|
+
}]
|
|
22
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
23
|
+
style: [styles.pdfAttachmentText, {
|
|
24
|
+
color: this.props.colourBrandingMain
|
|
25
|
+
}]
|
|
26
|
+
}, this.props.title)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const styles = {
|
|
30
|
+
pdfAttachment: {
|
|
31
|
+
padding: 4,
|
|
32
|
+
flexDirection: "row",
|
|
33
|
+
borderRadius: 2,
|
|
34
|
+
marginTop: 8,
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
alignSelf: "flex-start"
|
|
37
|
+
},
|
|
38
|
+
pdfAttachmentIcon: {
|
|
39
|
+
fontSize: 16,
|
|
40
|
+
marginRight: 4
|
|
41
|
+
},
|
|
42
|
+
pdfAttachmentText: {
|
|
43
|
+
fontFamily: "sf-semibold",
|
|
44
|
+
fontSize: 13
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const mapStateToProps = state => {
|
|
48
|
+
return {
|
|
49
|
+
colourBrandingMain: getMainBrandingColourFromState(state),
|
|
50
|
+
colourBrandingLight: getLightBrandingColourFromState(state)
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const attachment = connect(mapStateToProps, {})(Attachment);
|
|
54
|
+
export { attachment as Attachment };
|
|
55
|
+
//# sourceMappingURL=Attachment.js.map
|
|
@@ -0,0 +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 } 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,e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;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":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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";
|
|
10
|
+
class AudienceSelectorLauncher extends PureComponent {
|
|
11
|
+
constructor(...args) {
|
|
12
|
+
super(...args);
|
|
13
|
+
_defineProperty(this, "onPressAudience", () => {
|
|
14
|
+
const {
|
|
15
|
+
user,
|
|
16
|
+
audienceType,
|
|
17
|
+
audienceTypeSelection
|
|
18
|
+
} = this.props;
|
|
19
|
+
Services.navigation.navigate("audienceSelectorPage", {
|
|
20
|
+
site: user.site,
|
|
21
|
+
audienceType: audienceType || "Custom",
|
|
22
|
+
audienceTypeSelection: audienceTypeSelection || [],
|
|
23
|
+
onChange: (audienceType, audienceTypeSelection) => {
|
|
24
|
+
if (this.props.onChange) this.props.onChange(audienceType, audienceTypeSelection);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const {
|
|
31
|
+
style,
|
|
32
|
+
textStyle,
|
|
33
|
+
audienceTypeSelection
|
|
34
|
+
} = this.props;
|
|
35
|
+
const selected = audienceTypeSelection && audienceTypeSelection.length > 0 ? `Current selection: ${audienceTypeSelection.map(i => i.Title).join(", ")}` : "";
|
|
36
|
+
return /*#__PURE__*/React.createElement(FormCardSectionOptionLauncher, {
|
|
37
|
+
sectionStyle: [styles.audienceSection, style],
|
|
38
|
+
textStyle: [styles.audienceText, textStyle],
|
|
39
|
+
onPress: this.onPressAudience,
|
|
40
|
+
title: "Audience",
|
|
41
|
+
description: selected,
|
|
42
|
+
value: selected ? "Custom" : "All Users"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
audienceSection: {
|
|
48
|
+
paddingHorizontal: 0
|
|
49
|
+
},
|
|
50
|
+
audienceText: {
|
|
51
|
+
fontFamily: "sf-semibold",
|
|
52
|
+
fontSize: 16,
|
|
53
|
+
color: TEXT_DARK
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const mapStateToProps = state => {
|
|
57
|
+
return {
|
|
58
|
+
user: state.user,
|
|
59
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const audienceSelectorLauncher = connect(mapStateToProps, {})(AudienceSelectorLauncher);
|
|
63
|
+
export { audienceSelectorLauncher as AudienceSelectorLauncher };
|
|
64
|
+
//# sourceMappingURL=AudienceSelectorLauncher.js.map
|
|
@@ -0,0 +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\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{},\n)(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,0BAClC,MAAM;MACvB,MAAM;QAAEC,IAAI;QAAEC,YAAY;QAAEC;MAAsB,CAAC,GAAG,IAAI,CAACC,KAAK;MAEhER,QAAQ,CAACS,UAAU,CAACC,QAAQ,CAAC,sBAAsB,EAAE;QACpDC,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;UAClD,IAAI,IAAI,CAACC,KAAK,CAACI,QAAQ,EACtB,IAAI,CAACJ,KAAK,CAACI,QAAQ,CAACN,YAAY,EAAEC,qBAAqB,CAAC;QAC1D;MACD,CAAC,CAAC;IACH,CAAC;EAAA;EAEDM,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC,KAAK;MAAEC,SAAS;MAAER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