@plusscommunities/pluss-core-app 8.0.28 → 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
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +91 -87
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import { View, ImageBackground } from "react-native";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
|
+
import Config from "../config";
|
|
5
|
+
import { Spinner } from "./Spinner";
|
|
6
|
+
import { LINEGREY, getMainBrandingColourFromState } from "../colours";
|
|
7
|
+
class ProfilePic extends Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = {
|
|
11
|
+
image: null,
|
|
12
|
+
imageBorderRadius: 18,
|
|
13
|
+
imageUploading: false,
|
|
14
|
+
backgroundFill: false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
UNSAFE_componentWillMount() {
|
|
18
|
+
this.setState({
|
|
19
|
+
image: this.props.ProfilePic != null ? this.props.ProfilePic : Config.env.defaultProfileImage,
|
|
20
|
+
imageDiameterStyle: {
|
|
21
|
+
height: this.props.Diameter != null ? this.props.Diameter : 35,
|
|
22
|
+
width: this.props.Diameter != null ? this.props.Diameter : 35
|
|
23
|
+
},
|
|
24
|
+
imageBorderRadius: this.props.Diameter != null ? this.props.Diameter / 2 : 18,
|
|
25
|
+
imageUploading: this.props.ImageUploading,
|
|
26
|
+
backgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
30
|
+
let profPic = null;
|
|
31
|
+
if (nextProps.ProfilePic) {
|
|
32
|
+
profPic = nextProps.ProfilePic;
|
|
33
|
+
}
|
|
34
|
+
this.setState({
|
|
35
|
+
image: profPic,
|
|
36
|
+
imageUploading: nextProps.ImageUploading
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
renderImage() {
|
|
40
|
+
if (this.state.imageUploading) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(Spinner, {
|
|
42
|
+
style: {
|
|
43
|
+
backgroundColor: "white",
|
|
44
|
+
borderRadius: this.state.imageBorderRadius
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
let image = Config.env.defaultProfileImage;
|
|
49
|
+
let isDefault = true;
|
|
50
|
+
if (this.state.image !== null && typeof this.state.image === "string") {
|
|
51
|
+
if (this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg" && this.state.image !== "https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg" && this.state.image !== "https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg") {
|
|
52
|
+
image = {
|
|
53
|
+
uri: this.state.image
|
|
54
|
+
};
|
|
55
|
+
isDefault = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement(ImageBackground, {
|
|
59
|
+
key: "default",
|
|
60
|
+
source: image,
|
|
61
|
+
style: [styles.profilePicImage, {
|
|
62
|
+
borderRadius: this.state.imageBorderRadius
|
|
63
|
+
}, (isDefault || this.state.backgroundFill) && {
|
|
64
|
+
backgroundColor: this.props.colourBrandingMain
|
|
65
|
+
}],
|
|
66
|
+
imageStyle: {
|
|
67
|
+
borderRadius: this.state.imageBorderRadius
|
|
68
|
+
}
|
|
69
|
+
}, this.props.children);
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
73
|
+
style: [styles.profilePicOuter, this.state.imageDiameterStyle, this.props.bordered && styles.bordered, {
|
|
74
|
+
borderRadius: this.state.imageBorderRadius
|
|
75
|
+
}, this.props.style],
|
|
76
|
+
key: this.props.id
|
|
77
|
+
}, this.renderImage());
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const styles = {
|
|
81
|
+
profilePicOuter: {
|
|
82
|
+
height: 35,
|
|
83
|
+
width: 35,
|
|
84
|
+
zIndex: 1,
|
|
85
|
+
backgroundColor: LINEGREY
|
|
86
|
+
// overflow: 'hidden'
|
|
87
|
+
},
|
|
88
|
+
profilePicImage: {
|
|
89
|
+
flex: 1,
|
|
90
|
+
height: null,
|
|
91
|
+
width: null
|
|
92
|
+
},
|
|
93
|
+
bordered: {
|
|
94
|
+
borderWidth: 1,
|
|
95
|
+
borderColor: "#fff"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const mapStateToProps = state => {
|
|
99
|
+
return {
|
|
100
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
const profilePic = connect(mapStateToProps, {})(ProfilePic);
|
|
104
|
+
export { profilePic as ProfilePic };
|
|
105
|
+
//# sourceMappingURL=ProfilePic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","ImageBackground","connect","Config","Spinner","LINEGREY","getMainBrandingColourFromState","ProfilePic","constructor","props","state","image","imageBorderRadius","imageUploading","backgroundFill","UNSAFE_componentWillMount","setState","env","defaultProfileImage","imageDiameterStyle","height","Diameter","width","ImageUploading","tinyChatDefault","UNSAFE_componentWillReceiveProps","nextProps","profPic","renderImage","createElement","style","backgroundColor","borderRadius","isDefault","uri","key","source","styles","profilePicImage","colourBrandingMain","imageStyle","children","render","profilePicOuter","bordered","id","zIndex","flex","borderWidth","borderColor","mapStateToProps","profilePic"],"sources":["ProfilePic.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, ImageBackground } from \"react-native\";\nimport { connect } from \"react-redux\";\nimport Config from \"../config\";\nimport { Spinner } from \"./Spinner\";\nimport { LINEGREY, getMainBrandingColourFromState } from \"../colours\";\n\nclass ProfilePic extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\timage: null,\n\t\t\timageBorderRadius: 18,\n\t\t\timageUploading: false,\n\t\t\tbackgroundFill: false,\n\t\t};\n\t}\n\n\tUNSAFE_componentWillMount() {\n\t\tthis.setState({\n\t\t\timage:\n\t\t\t\tthis.props.ProfilePic != null\n\t\t\t\t\t? this.props.ProfilePic\n\t\t\t\t\t: Config.env.defaultProfileImage,\n\t\t\timageDiameterStyle: {\n\t\t\t\theight: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t\twidth: this.props.Diameter != null ? this.props.Diameter : 35,\n\t\t\t},\n\t\t\timageBorderRadius:\n\t\t\t\tthis.props.Diameter != null ? this.props.Diameter / 2 : 18,\n\t\t\timageUploading: this.props.ImageUploading,\n\t\t\tbackgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault,\n\t\t});\n\t}\n\n\tUNSAFE_componentWillReceiveProps(nextProps) {\n\t\tlet profPic = null;\n\t\tif (nextProps.ProfilePic) {\n\t\t\tprofPic = nextProps.ProfilePic;\n\t\t}\n\n\t\tthis.setState({\n\t\t\timage: profPic,\n\t\t\timageUploading: nextProps.ImageUploading,\n\t\t});\n\t}\n\n\trenderImage() {\n\t\tif (this.state.imageUploading) {\n\t\t\treturn (\n\t\t\t\t<Spinner\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: \"white\",\n\t\t\t\t\t\tborderRadius: this.state.imageBorderRadius,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tlet image = Config.env.defaultProfileImage;\n\t\tlet isDefault = true;\n\t\tif (this.state.image !== null && typeof this.state.image === \"string\") {\n\t\t\tif (\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg\" &&\n\t\t\t\tthis.state.image !==\n\t\t\t\t\t\"https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg\"\n\t\t\t) {\n\t\t\t\timage = { uri: this.state.image };\n\t\t\t\tisDefault = false;\n\t\t\t}\n\t\t}\n\t\treturn (\n\t\t\t<ImageBackground\n\t\t\t\tkey=\"default\"\n\t\t\t\tsource={image}\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicImage,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\t(isDefault || this.state.backgroundFill) && {\n\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t\timageStyle={{ borderRadius: this.state.imageBorderRadius }}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</ImageBackground>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.profilePicOuter,\n\t\t\t\t\tthis.state.imageDiameterStyle,\n\t\t\t\t\tthis.props.bordered && styles.bordered,\n\t\t\t\t\t{ borderRadius: this.state.imageBorderRadius },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t\tkey={this.props.id}\n\t\t\t>\n\t\t\t\t{this.renderImage()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tprofilePicOuter: {\n\t\theight: 35,\n\t\twidth: 35,\n\t\tzIndex: 1,\n\t\tbackgroundColor: LINEGREY,\n\t\t// overflow: 'hidden'\n\t},\n\tprofilePicImage: {\n\t\tflex: 1,\n\t\theight: null,\n\t\twidth: null,\n\t},\n\tbordered: {\n\t\tborderWidth: 1,\n\t\tborderColor: \"#fff\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst profilePic = connect(mapStateToProps, {})(ProfilePic);\nexport { profilePic as ProfilePic };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,eAAe,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,EAAEC,8BAA8B,QAAQ,YAAY;AAErE,MAAMC,UAAU,SAASR,SAAS,CAAC;EAClCS,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MACZC,KAAK,EAAE,IAAI;MACXC,iBAAiB,EAAE,EAAE;MACrBC,cAAc,EAAE,KAAK;MACrBC,cAAc,EAAE;IACjB,CAAC;EACF;EAEAC,yBAAyBA,CAAA,EAAG;IAC3B,IAAI,CAACC,QAAQ,CAAC;MACbL,KAAK,EACJ,IAAI,CAACF,KAAK,CAACF,UAAU,IAAI,IAAI,GAC1B,IAAI,CAACE,KAAK,CAACF,UAAU,GACrBJ,MAAM,CAACc,GAAG,CAACC,mBAAmB;MAClCC,k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;AAEA,MAAMS,MAAM,GAAG;EACdM,eAAe,EAAE;IAChBvB,MAAM,EAAE,EAAE;IACVE,KAAK,EAAE,EAAE;IACTwB,MAAM,EAAE,CAAC;IACTf,eAAe,EAAE1B;IACjB;EACD,CAAC;EACDiC,eAAe,EAAE;IAChBS,IAAI,EAAE,CAAC;IACP3B,MAAM,EAAE,IAAI;IACZE,KAAK,EAAE;EACR,CAAC;EACDsB,QAAQ,EAAE;IACTI,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACd;AACD,CAAC;AAED,MAAMC,eAAe,GAAIxC,KAAK,IAAK;EAClC,OAAO;IACN6B,kBAAkB,EAAEjC,8BAA8B,CAACI,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMyC,UAAU,GAAGjD,OAAO,CAACgD,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC3C,UAAU,CAAC;AAC3D,SAAS4C,UAAU,IAAI5C,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { Text } from "@plusscommunities/pluss-core-app/components";
|
|
3
|
+
import { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet } from "react-native";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from "../colours";
|
|
6
|
+
class RadioButton extends PureComponent {
|
|
7
|
+
render() {
|
|
8
|
+
const {
|
|
9
|
+
size,
|
|
10
|
+
isActive,
|
|
11
|
+
value,
|
|
12
|
+
onPress,
|
|
13
|
+
colourBrandingMain,
|
|
14
|
+
style,
|
|
15
|
+
label
|
|
16
|
+
} = this.props;
|
|
17
|
+
const iconSize = size || 20;
|
|
18
|
+
const innerSize = iconSize - 8;
|
|
19
|
+
const content = /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
20
|
+
onPress: () => onPress(value)
|
|
21
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
22
|
+
style: [styles.container, {
|
|
23
|
+
width: iconSize,
|
|
24
|
+
height: iconSize,
|
|
25
|
+
borderRadius: iconSize / 2
|
|
26
|
+
}, style]
|
|
27
|
+
}, isActive && /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: {
|
|
29
|
+
width: innerSize,
|
|
30
|
+
height: innerSize,
|
|
31
|
+
borderRadius: innerSize / 2,
|
|
32
|
+
backgroundColor: colourBrandingMain
|
|
33
|
+
}
|
|
34
|
+
})));
|
|
35
|
+
if (label) {
|
|
36
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
37
|
+
onPress: () => onPress(value),
|
|
38
|
+
key: label,
|
|
39
|
+
style: styles.radioOption,
|
|
40
|
+
hitSlop: {
|
|
41
|
+
top: 8,
|
|
42
|
+
left: 8,
|
|
43
|
+
bottom: 8,
|
|
44
|
+
right: 8
|
|
45
|
+
}
|
|
46
|
+
}, content, /*#__PURE__*/React.createElement(Text, {
|
|
47
|
+
style: styles.radioOptionText
|
|
48
|
+
}, label));
|
|
49
|
+
}
|
|
50
|
+
return content;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
borderColor: LINEGREY,
|
|
56
|
+
borderWidth: 1,
|
|
57
|
+
backgroundColor: "#fff",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center"
|
|
60
|
+
},
|
|
61
|
+
radioOption: {
|
|
62
|
+
flexDirection: "row",
|
|
63
|
+
marginRight: 26
|
|
64
|
+
},
|
|
65
|
+
radioOptionText: {
|
|
66
|
+
fontFamily: "sf-medium",
|
|
67
|
+
fontSize: 14,
|
|
68
|
+
color: TEXT_DARKEST
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const mapStateToProps = state => {
|
|
72
|
+
return {
|
|
73
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const radioButton = connect(mapStateToProps, {})(RadioButton);
|
|
77
|
+
export { radioButton as RadioButton };
|
|
78
|
+
//# sourceMappingURL=RadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","Text","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","connect","getMainBrandingColourFromState","LINEGREY","TEXT_DARKEST","RadioButton","render","size","isActive","value","onPress","colourBrandingMain","style","label","props","iconSize","innerSize","content","createElement","styles","container","width","height","borderRadius","backgroundColor","key","radioOption","hitSlop","top","left","bottom","right","radioOptionText","create","borderColor","borderWidth","alignItems","justifyContent","flexDirection","marginRight","fontFamily","fontSize","color","mapStateToProps","state","radioButton"],"sources":["RadioButton.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tView,\n\tTouchableOpacity,\n\tTouchableWithoutFeedback,\n\tStyleSheet,\n} from \"react-native\";\nimport { connect } from \"react-redux\";\nimport {\n\tgetMainBrandingColourFromState,\n\tLINEGREY,\n\tTEXT_DARKEST,\n} from \"../colours\";\n\nclass RadioButton extends PureComponent {\n\trender() {\n\t\tconst { size, isActive, value, onPress, colourBrandingMain, style, label } =\n\t\t\tthis.props;\n\t\tconst iconSize = size || 20;\n\t\tconst innerSize = iconSize - 8;\n\n\t\tconst content = (\n\t\t\t<TouchableWithoutFeedback onPress={() => onPress(value)}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\t{ width: iconSize, height: iconSize, borderRadius: iconSize / 2 },\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{isActive && (\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: innerSize,\n\t\t\t\t\t\t\t\theight: innerSize,\n\t\t\t\t\t\t\t\tborderRadius: innerSize / 2,\n\t\t\t\t\t\t\t\tbackgroundColor: colourBrandingMain,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\n\t\tif (label) {\n\t\t\treturn (\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tonPress={() => onPress(value)}\n\t\t\t\t\tkey={label}\n\t\t\t\t\tstyle={styles.radioOption}\n\t\t\t\t\thitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n\t\t\t\t>\n\t\t\t\t\t{content}\n\t\t\t\t\t<Text style={styles.radioOptionText}>{label}</Text>\n\t\t\t\t</TouchableOpacity>\n\t\t\t);\n\t\t}\n\n\t\treturn content;\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tborderColor: LINEGREY,\n\t\tborderWidth: 1,\n\t\tbackgroundColor: \"#fff\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tradioOption: {\n\t\tflexDirection: \"row\",\n\t\tmarginRight: 26,\n\t},\n\tradioOptionText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst radioButton = connect(mapStateToProps, {})(RadioButton);\nexport { radioButton as RadioButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,IAAI,EACJC,gBAAgB,EAChBC,wBAAwB,EACxBC,UAAU,QACJ,cAAc;AACrB,SAASC,OAAO,QAAQ,aAAa;AACrC,SACCC,8BAA8B,EAC9BC,QAAQ,EACRC,YAAY,QACN,YAAY;AAEnB,MAAMC,WAAW,SAASV,aAAa,CAAC;EACvCW,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC,IAAI;MAAEC,QAAQ;M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MAAME,MAAM,GAAGnB,UAAU,CAACiC,MAAM,CAAC;EAChCb,SAAS,EAAE;IACVc,WAAW,EAAE/B,QAAQ;IACrBgC,WAAW,EAAE,CAAC;IACdX,eAAe,EAAE,MAAM;IACvBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACjB,CAAC;EACDX,WAAW,EAAE;IACZY,aAAa,EAAE,KAAK;IACpBC,WAAW,EAAE;EACd,CAAC;EACDP,eAAe,EAAE;IAChBQ,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEtC;EACR;AACD,CAAC,CAAC;AAEF,MAAMuC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjC,kBAAkB,EAAET,8BAA8B,CAAC0C,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,WAAW,GAAG5C,OAAO,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtC,WAAW,CAAC;AAC7D,SAASwC,WAAW,IAAIxC,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
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, { Component } from "react";
|
|
5
|
+
import { View, Image, TouchableOpacity } from "react-native";
|
|
6
|
+
import { Text } from "./Text";
|
|
7
|
+
import { connect } from "react-redux";
|
|
8
|
+
import _ from "lodash";
|
|
9
|
+
import { getReactions, getShadowStyle } from "../helper";
|
|
10
|
+
import { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from "../colours";
|
|
11
|
+
import { reactionActions } from "../apis";
|
|
12
|
+
class Reaction extends Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
_defineProperty(this, "onPressReaction", () => {
|
|
16
|
+
if (!this.props.reactions[this.props.userId]) {
|
|
17
|
+
reactionActions.add(this.props.entityId, this.props.entityType, this.props.reaction.key, this.props.site);
|
|
18
|
+
this.props.onLike();
|
|
19
|
+
} else {
|
|
20
|
+
reactionActions.remove(this.props.entityId, this.props.entityType, this.props.reaction.key);
|
|
21
|
+
this.props.onUnlike();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
getStyleType() {
|
|
26
|
+
if (this.props.reactions[this.props.userId]) {
|
|
27
|
+
return "ThisHL";
|
|
28
|
+
}
|
|
29
|
+
if (this.props.anyHighlighted) {
|
|
30
|
+
return "OtherHL";
|
|
31
|
+
}
|
|
32
|
+
return "Default";
|
|
33
|
+
}
|
|
34
|
+
getTopReaction() {
|
|
35
|
+
return _.maxBy(Object.keys(this.props.reactions), key => {
|
|
36
|
+
return Object.keys(this.props.reactions[key]).length;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
getIcon(topReaction) {
|
|
40
|
+
return _.find(getReactions(), r => {
|
|
41
|
+
return r.key === topReaction;
|
|
42
|
+
}).icon;
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
if (this.props.topReactionOnly) {
|
|
46
|
+
const topReaction = this.getTopReaction();
|
|
47
|
+
if (!topReaction) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
style: [styles.container, styles.containerThisHL, this.props.style]
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
53
|
+
style: [styles.image, this.props.imageStyle],
|
|
54
|
+
source: this.getIcon(topReaction)
|
|
55
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
56
|
+
style: [styles.count, this.props.countStyle]
|
|
57
|
+
}, Object.keys(this.props.reactions[topReaction]).length));
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
60
|
+
style: styles.touchable,
|
|
61
|
+
onPress: this.onPressReaction,
|
|
62
|
+
disabled: this.props.user.type === "KIOSK"
|
|
63
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
64
|
+
style: [styles.container, styles[`container${this.getStyleType()}`], this.props.style]
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
66
|
+
style: [styles.image, this.props.imageStyle],
|
|
67
|
+
source: this.props.reaction.icon
|
|
68
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
69
|
+
style: [styles.count, this.getStyleType() === "ThisHL" && {
|
|
70
|
+
color: this.props.colourBrandingMain
|
|
71
|
+
}, this.props.countStyle]
|
|
72
|
+
}, Object.keys(this.props.reactions).length)));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const styles = {
|
|
76
|
+
touchable: {
|
|
77
|
+
marginHorizontal: 4,
|
|
78
|
+
width: 60,
|
|
79
|
+
height: 30
|
|
80
|
+
},
|
|
81
|
+
container: {
|
|
82
|
+
width: 60,
|
|
83
|
+
height: 30,
|
|
84
|
+
borderRadius: 15,
|
|
85
|
+
backgroundColor: BG_GREY,
|
|
86
|
+
flexDirection: "row-reverse",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
paddingHorizontal: 8
|
|
89
|
+
},
|
|
90
|
+
containerThisHL: {
|
|
91
|
+
...getShadowStyle()
|
|
92
|
+
},
|
|
93
|
+
containerOtherHL: {
|
|
94
|
+
opacity: 0.5
|
|
95
|
+
},
|
|
96
|
+
image: {
|
|
97
|
+
width: 20,
|
|
98
|
+
height: 20,
|
|
99
|
+
resizeMode: "contain"
|
|
100
|
+
},
|
|
101
|
+
count: {
|
|
102
|
+
fontFamily: "sf-medium",
|
|
103
|
+
color: TEXT_DARK,
|
|
104
|
+
flex: 1,
|
|
105
|
+
textAlign: "center",
|
|
106
|
+
fontSize: 16
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const mapStateToProps = state => {
|
|
110
|
+
return {
|
|
111
|
+
colourBrandingMain: getMainBrandingColourFromState(state),
|
|
112
|
+
user: state.user
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const reaction = connect(mapStateToProps, {})(Reaction);
|
|
116
|
+
export { reaction as Reaction };
|
|
117
|
+
//# sourceMappingURL=Reaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Image","TouchableOpacity","Text","connect","_","getReactions","getShadowStyle","BG_GREY","TEXT_DARK","getMainBrandingColourFromState","reactionActions","Reaction","constructor","args","_defineProperty","props","reactions","userId","add","entityId","entityType","reaction","key","site","onLike","remove","onUnlike","getStyleType","anyHighlighted","getTopReaction","maxBy","Object","keys","length","getIcon","topReaction","find","r","icon","render","topReactionOnly","createElement","style","styles","container","containerThisHL","image","imageStyle","source","count","countStyle","touchable","onPress","onPressReaction","disabled","user","type","color","colourBrandingMain","marginHorizontal","width","height","borderRadius","backgroundColor","flexDirection","alignItems","paddingHorizontal","containerOtherHL","opacity","resizeMode","fontFamily","flex","textAlign","fontSize","mapStateToProps","state"],"sources":["Reaction.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, Image, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport _ from \"lodash\";\nimport { getReactions, getShadowStyle } from \"../helper\";\nimport { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\nimport { reactionActions } from \"../apis\";\n\nclass Reaction extends Component {\n\tonPressReaction = () => {\n\t\tif (!this.props.reactions[this.props.userId]) {\n\t\t\treactionActions.add(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t\tthis.props.site,\n\t\t\t);\n\t\t\tthis.props.onLike();\n\t\t} else {\n\t\t\treactionActions.remove(\n\t\t\t\tthis.props.entityId,\n\t\t\t\tthis.props.entityType,\n\t\t\t\tthis.props.reaction.key,\n\t\t\t);\n\t\t\tthis.props.onUnlike();\n\t\t}\n\t};\n\n\tgetStyleType() {\n\t\tif (this.props.reactions[this.props.userId]) {\n\t\t\treturn \"ThisHL\";\n\t\t}\n\t\tif (this.props.anyHighlighted) {\n\t\t\treturn \"OtherHL\";\n\t\t}\n\t\treturn \"Default\";\n\t}\n\n\tgetTopReaction() {\n\t\treturn _.maxBy(Object.keys(this.props.reactions), (key) => {\n\t\t\treturn Object.keys(this.props.reactions[key]).length;\n\t\t});\n\t}\n\n\tgetIcon(topReaction) {\n\t\treturn _.find(getReactions(), (r) => {\n\t\t\treturn r.key === topReaction;\n\t\t}).icon;\n\t}\n\n\trender() {\n\t\tif (this.props.topReactionOnly) {\n\t\t\tconst topReaction = this.getTopReaction();\n\t\t\tif (!topReaction) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<View\n\t\t\t\t\tstyle={[styles.container, styles.containerThisHL, this.props.style]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.getIcon(topReaction)}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text style={[styles.count, this.props.countStyle]}>\n\t\t\t\t\t\t{Object.keys(this.props.reactions[topReaction]).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.touchable}\n\t\t\t\tonPress={this.onPressReaction}\n\t\t\t\tdisabled={this.props.user.type === \"KIOSK\"}\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.container,\n\t\t\t\t\t\tstyles[`container${this.getStyleType()}`],\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={[styles.image, this.props.imageStyle]}\n\t\t\t\t\t\tsource={this.props.reaction.icon}\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.count,\n\t\t\t\t\t\t\tthis.getStyleType() === \"ThisHL\" && {\n\t\t\t\t\t\t\t\tcolor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.countStyle,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{Object.keys(this.props.reactions).length}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\ttouchable: {\n\t\tmarginHorizontal: 4,\n\t\twidth: 60,\n\t\theight: 30,\n\t},\n\tcontainer: {\n\t\twidth: 60,\n\t\theight: 30,\n\t\tborderRadius: 15,\n\t\tbackgroundColor: BG_GREY,\n\t\tflexDirection: \"row-reverse\",\n\t\talignItems: \"center\",\n\t\tpaddingHorizontal: 8,\n\t},\n\tcontainerThisHL: {\n\t\t...getShadowStyle(),\n\t},\n\tcontainerOtherHL: {\n\t\topacity: 0.5,\n\t},\n\timage: {\n\t\twidth: 20,\n\t\theight: 20,\n\t\tresizeMode: \"contain\",\n\t},\n\tcount: {\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: TEXT_DARK,\n\t\tflex: 1,\n\t\ttextAlign: \"center\",\n\t\tfontSize: 16,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tuser: state.user,\n\t};\n};\n\nconst reaction = connect(mapStateToProps, {})(Reaction);\nexport { reaction as Reaction };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI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AAO;IACxByD,aAAa,EAAE,aAAa;IAC5BC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE;EACpB,CAAC;EACDrB,eAAe,EAAE;IAChB,GAAGvC,cAAc,CAAC;EACnB,CAAC;EACD6D,gBAAgB,EAAE;IACjBC,OAAO,EAAE;EACV,CAAC;EACDtB,KAAK,EAAE;IACNc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,UAAU,EAAE;EACb,CAAC;EACDpB,KAAK,EAAE;IACNqB,UAAU,EAAE,WAAW;IACvBb,KAAK,EAAEjD,SAAS;IAChB+D,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNjB,kBAAkB,EAAEjD,8BAA8B,CAACkE,KAAK,CAAC;IACzDpB,IAAI,EAAEoB,KAAK,CAACpB;EACb,CAAC;AACF,CAAC;AAED,MAAMlC,QAAQ,GAAGlB,OAAO,CAACuE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC/D,QAAQ,CAAC;AACvD,SAASU,QAAQ,IAAIV,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
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, { Component } from "react";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { getReactions, getUserPreview } from "../helper";
|
|
7
|
+
import { Reaction } from "./Reaction";
|
|
8
|
+
class Reactions extends Component {
|
|
9
|
+
constructor(...args) {
|
|
10
|
+
super(...args);
|
|
11
|
+
_defineProperty(this, "state", {
|
|
12
|
+
reactions: getReactions()
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
getReaction(key) {
|
|
16
|
+
if (!this.props.entity) {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
if (!this.props.entity.Reactions) {
|
|
20
|
+
this.props.entity.Reactions = {};
|
|
21
|
+
}
|
|
22
|
+
return this.props.entity.Reactions[key] || {};
|
|
23
|
+
}
|
|
24
|
+
onLike(key) {
|
|
25
|
+
if (!this.props.entity.Reactions) {
|
|
26
|
+
this.props.entity.Reactions = {};
|
|
27
|
+
}
|
|
28
|
+
if (!this.props.entity.Reactions[key]) {
|
|
29
|
+
this.props.entity.Reactions[key] = {};
|
|
30
|
+
}
|
|
31
|
+
this.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(this.props.user);
|
|
32
|
+
this.props.onUpdateReactions();
|
|
33
|
+
}
|
|
34
|
+
onUnlike(key) {
|
|
35
|
+
if (!this.props.entity.Reactions) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!this.props.entity.Reactions[key]) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
delete this.props.entity.Reactions[key][this.props.user.uid];
|
|
42
|
+
this.props.onUpdateReactions();
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
46
|
+
style: [styles.container, this.props.style]
|
|
47
|
+
}, this.state.reactions.map((r, i) => {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Reaction, {
|
|
49
|
+
key: i,
|
|
50
|
+
reaction: r,
|
|
51
|
+
entityType: this.props.entityType,
|
|
52
|
+
entityId: this.props.entityId,
|
|
53
|
+
reactions: this.getReaction(r.key),
|
|
54
|
+
anyHighlighted: this.props.anyHighlighted,
|
|
55
|
+
userId: this.props.user.uid,
|
|
56
|
+
onLike: this.onLike.bind(this, r.key),
|
|
57
|
+
onUnlike: this.onUnlike.bind(this, r.key),
|
|
58
|
+
site: this.props.site
|
|
59
|
+
});
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const styles = {
|
|
64
|
+
container: {
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
justifyContent: "center",
|
|
67
|
+
width: "100%"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export { Reactions };
|
|
71
|
+
//# sourceMappingURL=Reactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","getReactions","getUserPreview","Reaction","Reactions","constructor","args","_defineProperty","reactions","getReaction","key","props","entity","onLike","user","uid","onUpdateReactions","onUnlike","render","createElement","style","styles","container","state","map","r","i","reaction","entityType","entityId","anyHighlighted","userId","bind","site","flexDirection","justifyContent","width"],"sources":["Reactions.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View } from \"react-native\";\nimport { getReactions, getUserPreview } from \"../helper\";\nimport { Reaction } from \"./Reaction\";\n\nclass Reactions extends Component {\n\tstate = {\n\t\treactions: getReactions(),\n\t};\n\n\tgetReaction(key) {\n\t\tif (!this.props.entity) {\n\t\t\treturn {};\n\t\t}\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\treturn this.props.entity.Reactions[key] || {};\n\t}\n\n\tonLike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\tthis.props.entity.Reactions = {};\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\tthis.props.entity.Reactions[key] = {};\n\t\t}\n\t\tthis.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(\n\t\t\tthis.props.user,\n\t\t);\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\tonUnlike(key) {\n\t\tif (!this.props.entity.Reactions) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this.props.entity.Reactions[key]) {\n\t\t\treturn;\n\t\t}\n\t\tdelete this.props.entity.Reactions[key][this.props.user.uid];\n\t\tthis.props.onUpdateReactions();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{this.state.reactions.map((r, i) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Reaction\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\treaction={r}\n\t\t\t\t\t\t\tentityType={this.props.entityType}\n\t\t\t\t\t\t\tentityId={this.props.entityId}\n\t\t\t\t\t\t\treactions={this.getReaction(r.key)}\n\t\t\t\t\t\t\tanyHighlighted={this.props.anyHighlighted}\n\t\t\t\t\t\t\tuserId={this.props.user.uid}\n\t\t\t\t\t\t\tonLike={this.onLike.bind(this, r.key)}\n\t\t\t\t\t\t\tonUnlike={this.onUnlike.bind(this, r.key)}\n\t\t\t\t\t\t\tsite={this.props.site}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"center\",\n\t\twidth: \"100%\",\n\t},\n};\n\nexport { Reactions };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,SAAS,SAASL,SAAS,CAAC;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBACzB;MACPC,SAAS,EAAEP,YAAY,CAAC;IACzB,CAAC;EAAA;EAEDQ,WAAWA,CAACC,GAAG,EAAE;IAChB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,EAAE;MACvB,OAAO,CA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AG;IACR,oBACCpB,KAAA,CAAAqB,aAAA,CAACnB,IAAI;MAACoB,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACX,KAAK,CAACS,KAAK;IAAE,GAChD,IAAI,CAACG,KAAK,CAACf,SAAS,CAACgB,GAAG,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;MACnC,oBACC5B,KAAA,CAAAqB,aAAA,CAAChB,QAAQ;QACRO,GAAG,EAAEgB,CAAE;QACPC,QAAQ,EAAEF,CAAE;QACZG,UAAU,EAAE,IAAI,CAACjB,KAAK,CAACiB,UAAW;QAClCC,QAAQ,EAAE,IAAI,CAAClB,KAAK,CAACkB,QAAS;QAC9BrB,SAAS,EAAE,IAAI,CAACC,WAAW,CAACgB,CAAC,CAACf,GAAG,CAAE;QACnCoB,cAAc,EAAE,IAAI,CAACnB,KAAK,CAACmB,cAAe;QAC1CC,MAAM,EAAE,IAAI,CAACpB,KAAK,CAACG,IAAI,CAACC,GAAI;QAC5BF,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmB,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QACtCO,QAAQ,EAAE,IAAI,CAACA,QAAQ,CAACe,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QAC1CuB,IAAI,EAAE,IAAI,CAACtB,KAAK,CAACsB;MAAK,CACtB,CAAC;IAEJ,CAAC,CACI,CAAC;EAET;AACD;AAEA,MAAMZ,MAAM,GAAG;EACdC,SAAS,EAAE;IACVY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACR;AACD,CAAC;AAED,SAAShC,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,189 @@
|
|
|
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, { Component } from "react";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import { TouchableOpacity, StyleSheet, View, Alert } from "react-native";
|
|
7
|
+
import { Text } from "./Text";
|
|
8
|
+
import { Icon } from "@rneui/themed";
|
|
9
|
+
import { File, Paths } from "expo-file-system";
|
|
10
|
+
import * as Sharing from "expo-sharing";
|
|
11
|
+
import * as MediaLibrary from "expo-media-library";
|
|
12
|
+
import { StatusBarHeight, isVideo, getMimeType } from "../helper";
|
|
13
|
+
import { MiddlePopup } from "./MiddlePopup";
|
|
14
|
+
import Config from "../config";
|
|
15
|
+
class SharingTools extends Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
_defineProperty(this, "downloadMedia", async () => {
|
|
19
|
+
var _parts$;
|
|
20
|
+
const remoteUrl = this.props.uri;
|
|
21
|
+
if (!remoteUrl) {
|
|
22
|
+
throw new Error("No media URL provided");
|
|
23
|
+
}
|
|
24
|
+
const parts = remoteUrl.split("/").splice(-2);
|
|
25
|
+
const mediaId = parts[0];
|
|
26
|
+
const extension = ((_parts$ = parts[1]) === null || _parts$ === void 0 ? void 0 : _parts$.split(".").splice(-1)[0]) || "jpg";
|
|
27
|
+
const file = await File.downloadFileAsync(remoteUrl, new File(Paths.cache, `${mediaId}.${extension}`), {
|
|
28
|
+
idempotent: true
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
localUrl: file.uri,
|
|
32
|
+
extension
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
_defineProperty(this, "onSave", async () => {
|
|
36
|
+
try {
|
|
37
|
+
// Request permissions first
|
|
38
|
+
const {
|
|
39
|
+
status
|
|
40
|
+
} = await MediaLibrary.requestPermissionsAsync();
|
|
41
|
+
if (status !== "granted") {
|
|
42
|
+
Alert.alert("Permission Required", "Please allow access to your photo library to save photos.", [{
|
|
43
|
+
text: "OK"
|
|
44
|
+
}]);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.setState({
|
|
48
|
+
message: "Saving..."
|
|
49
|
+
});
|
|
50
|
+
const {
|
|
51
|
+
localUrl
|
|
52
|
+
} = await this.downloadMedia();
|
|
53
|
+
await MediaLibrary.saveToLibraryAsync(localUrl);
|
|
54
|
+
this.setState({
|
|
55
|
+
message: "Saved"
|
|
56
|
+
}, () => {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.setState({
|
|
59
|
+
message: ""
|
|
60
|
+
});
|
|
61
|
+
}, 2000);
|
|
62
|
+
});
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.log("SharingTools onSave error:", error);
|
|
65
|
+
this.setState({
|
|
66
|
+
message: ""
|
|
67
|
+
});
|
|
68
|
+
Alert.alert("Save Failed", "Unable to save photo. Please try again.", [{
|
|
69
|
+
text: "OK"
|
|
70
|
+
}]);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "onShare", async () => {
|
|
74
|
+
if (!(await Sharing.isAvailableAsync())) {
|
|
75
|
+
Alert.alert("Sharing Unavailable", "Sharing is not available on this device.", [{
|
|
76
|
+
text: "OK"
|
|
77
|
+
}]);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
this.setState({
|
|
82
|
+
message: "Preparing..."
|
|
83
|
+
});
|
|
84
|
+
const {
|
|
85
|
+
localUrl,
|
|
86
|
+
extension
|
|
87
|
+
} = await this.downloadMedia();
|
|
88
|
+
const video = isVideo(localUrl);
|
|
89
|
+
const mimeType = getMimeType(localUrl);
|
|
90
|
+
const fileDetails = {
|
|
91
|
+
extension: `.${extension}`,
|
|
92
|
+
shareOptions: {
|
|
93
|
+
mimeType,
|
|
94
|
+
dialogTitle: video ? "Share video" : "Share photo",
|
|
95
|
+
UTI: mimeType
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
await Sharing.shareAsync(localUrl, fileDetails.shareOptions);
|
|
99
|
+
this.setState({
|
|
100
|
+
message: ""
|
|
101
|
+
});
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.log("SharingTools onShare error:", error);
|
|
104
|
+
this.setState({
|
|
105
|
+
message: ""
|
|
106
|
+
});
|
|
107
|
+
Alert.alert("Share Failed", "Unable to share photo. Please try again.", [{
|
|
108
|
+
text: "OK"
|
|
109
|
+
}]);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
this.state = {
|
|
113
|
+
message: ""
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
renderTools() {
|
|
117
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
118
|
+
style: styles.toolsContainer
|
|
119
|
+
}, Config.env.allowMediaDownload && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
120
|
+
onPress: this.onSave,
|
|
121
|
+
activeOpacity: 0.6
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
123
|
+
name: "download",
|
|
124
|
+
type: "font-awesome",
|
|
125
|
+
iconStyle: styles.toolIcon,
|
|
126
|
+
style: styles.toolIconContainer
|
|
127
|
+
})), Config.env.allowMediaSharing && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
128
|
+
onPress: this.onShare,
|
|
129
|
+
activeOpacity: 0.6
|
|
130
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
131
|
+
name: "share-square-o",
|
|
132
|
+
type: "font-awesome",
|
|
133
|
+
iconStyle: styles.toolIcon,
|
|
134
|
+
style: styles.toolIconContainer
|
|
135
|
+
})));
|
|
136
|
+
}
|
|
137
|
+
renderMessage() {
|
|
138
|
+
return /*#__PURE__*/React.createElement(MiddlePopup, {
|
|
139
|
+
visible: !_.isEmpty(this.state.message)
|
|
140
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
141
|
+
style: styles.messageContainer
|
|
142
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
143
|
+
style: styles.messageText
|
|
144
|
+
}, this.state.message)));
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
148
|
+
style: styles.container
|
|
149
|
+
}, this.renderTools(), this.renderMessage());
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const styles = StyleSheet.create({
|
|
153
|
+
container: {
|
|
154
|
+
position: "absolute"
|
|
155
|
+
},
|
|
156
|
+
toolsContainer: {
|
|
157
|
+
position: "absolute",
|
|
158
|
+
flexDirection: "row",
|
|
159
|
+
justifyContent: "space-between",
|
|
160
|
+
left: 0,
|
|
161
|
+
zIndex: 3,
|
|
162
|
+
top: StatusBarHeight(0)
|
|
163
|
+
},
|
|
164
|
+
toolIconContainer: {
|
|
165
|
+
width: 55,
|
|
166
|
+
height: 55
|
|
167
|
+
},
|
|
168
|
+
toolIcon: {
|
|
169
|
+
fontSize: 25,
|
|
170
|
+
padding: 15,
|
|
171
|
+
width: 55,
|
|
172
|
+
textAlign: "center",
|
|
173
|
+
color: "#fff",
|
|
174
|
+
zIndex: 3
|
|
175
|
+
},
|
|
176
|
+
messageContainer: {
|
|
177
|
+
backgroundColor: "#000",
|
|
178
|
+
borderRadius: 10,
|
|
179
|
+
paddingVertical: 10,
|
|
180
|
+
paddingHorizontal: 30
|
|
181
|
+
},
|
|
182
|
+
messageText: {
|
|
183
|
+
fontFamily: "sf-bold",
|
|
184
|
+
fontSize: 24,
|
|
185
|
+
color: "#fff"
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
export { SharingTools };
|
|
189
|
+
//# sourceMappingURL=SharingTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","_","TouchableOpacity","StyleSheet","View","Alert","Text","Icon","File","Paths","Sharing","MediaLibrary","StatusBarHeight","isVideo","getMimeType","MiddlePopup","Config","SharingTools","constructor","props","_defineProperty","_parts$","remoteUrl","uri","Error","parts","split","splice","mediaId","extension","file","downloadFileAsync","cache","idempotent","localUrl","status","requestPermissionsAsync","alert","text","setState","message","downloadMedia","saveToLibraryAsync","setTimeout","error","console","log","isAvailableAsync","video","mimeType","fileDetails","shareOptions","dialogTitle","UTI","shareAsync","state","renderTools","createElement","style","styles","toolsContainer","env","allowMediaDownload","onPress","onSave","activeOpacity","name","type","iconStyle","toolIcon","toolIconContainer","allowMediaSharing","onShare","renderMessage","visible","isEmpty","messageContainer","messageText","render","container","create","position","flexDirection","justifyContent","left","zIndex","top","width","height","fontSize","padding","textAlign","color","backgroundColor","borderRadius","paddingVertical","paddingHorizontal","fontFamily"],"sources":["SharingTools.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TouchableOpacity, StyleSheet, View, Alert } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { File, Paths } from \"expo-file-system\";\nimport * as Sharing from \"expo-sharing\";\nimport * as MediaLibrary from \"expo-media-library\";\nimport { StatusBarHeight, isVideo, getMimeType } from \"../helper\";\nimport { MiddlePopup } from \"./MiddlePopup\";\nimport Config from \"../config\";\n\nclass SharingTools extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tmessage: \"\",\n\t\t};\n\t}\n\n\tdownloadMedia = async () => {\n\t\tconst remoteUrl = this.props.uri;\n\t\tif (!remoteUrl) {\n\t\t\tthrow new Error(\"No media URL provided\");\n\t\t}\n\n\t\tconst parts = remoteUrl.split(\"/\").splice(-2);\n\t\tconst mediaId = parts[0];\n\t\tconst extension = parts[1]?.split(\".\").splice(-1)[0] || \"jpg\";\n\n\t\tconst file = await File.downloadFileAsync(\n\t\t\tremoteUrl,\n\t\t\tnew File(Paths.cache, `${mediaId}.${extension}`),\n\t\t\t{ idempotent: true },\n\t\t);\n\t\treturn { localUrl: file.uri, extension };\n\t};\n\n\tonSave = async () => {\n\t\ttry {\n\t\t\t// Request permissions first\n\t\t\tconst { status } = await MediaLibrary.requestPermissionsAsync();\n\t\t\tif (status !== \"granted\") {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t\"Permission Required\",\n\t\t\t\t\t\"Please allow access to your photo library to save photos.\",\n\t\t\t\t\t[{ text: \"OK\" }],\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({ message: \"Saving...\" });\n\n\t\t\tconst { localUrl } = await this.downloadMedia();\n\t\t\tawait MediaLibrary.saveToLibraryAsync(localUrl);\n\n\t\t\tthis.setState({ message: \"Saved\" }, () => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.setState({ message: \"\" });\n\t\t\t\t}, 2000);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.log(\"SharingTools onSave error:\", error);\n\t\t\tthis.setState({ message: \"\" });\n\t\t\tAlert.alert(\"Save Failed\", \"Unable to save photo. Please try again.\", [\n\t\t\t\t{ text: \"OK\" },\n\t\t\t]);\n\t\t}\n\t};\n\n\tonShare = async () => {\n\t\tif (!(await Sharing.isAvailableAsync())) {\n\t\t\tAlert.alert(\n\t\t\t\t\"Sharing Unavailable\",\n\t\t\t\t\"Sharing is not available on this device.\",\n\t\t\t\t[{ text: \"OK\" }],\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.setState({ message: \"Preparing...\" });\n\n\t\t\tconst { localUrl, extension } = await this.downloadMedia();\n\n\t\t\tconst video = isVideo(localUrl);\n\t\t\tconst mimeType = getMimeType(localUrl);\n\t\t\tconst fileDetails = {\n\t\t\t\textension: `.${extension}`,\n\t\t\t\tshareOptions: {\n\t\t\t\t\tmimeType,\n\t\t\t\t\tdialogTitle: video ? \"Share video\" : \"Share photo\",\n\t\t\t\t\tUTI: mimeType,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tawait Sharing.shareAsync(localUrl, fileDetails.shareOptions);\n\t\t\tthis.setState({ message: \"\" });\n\t\t} catch (error) {\n\t\t\tconsole.log(\"SharingTools onShare error:\", error);\n\t\t\tthis.setState({ message: \"\" });\n\t\t\tAlert.alert(\"Share Failed\", \"Unable to share photo. Please try again.\", [\n\t\t\t\t{ text: \"OK\" },\n\t\t\t]);\n\t\t}\n\t};\n\n\trenderTools() {\n\t\treturn (\n\t\t\t<View style={styles.toolsContainer}>\n\t\t\t\t{Config.env.allowMediaDownload && (\n\t\t\t\t\t<TouchableOpacity onPress={this.onSave} activeOpacity={0.6}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={styles.toolIcon}\n\t\t\t\t\t\t\tstyle={styles.toolIconContainer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t)}\n\t\t\t\t{Config.env.allowMediaSharing && (\n\t\t\t\t\t<TouchableOpacity onPress={this.onShare} activeOpacity={0.6}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"share-square-o\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={styles.toolIcon}\n\t\t\t\t\t\t\tstyle={styles.toolIconContainer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderMessage() {\n\t\treturn (\n\t\t\t<MiddlePopup visible={!_.isEmpty(this.state.message)}>\n\t\t\t\t<View style={styles.messageContainer}>\n\t\t\t\t\t<Text style={styles.messageText}>{this.state.message}</Text>\n\t\t\t\t</View>\n\t\t\t</MiddlePopup>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={styles.container}>\n\t\t\t\t{this.renderTools()}\n\t\t\t\t{this.renderMessage()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tposition: \"absolute\",\n\t},\n\ttoolsContainer: {\n\t\tposition: \"absolute\",\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t\tleft: 0,\n\t\tzIndex: 3,\n\t\ttop: StatusBarHeight(0),\n\t},\n\ttoolIconContainer: {\n\t\twidth: 55,\n\t\theight: 55,\n\t},\n\ttoolIcon: {\n\t\tfontSize: 25,\n\t\tpadding: 15,\n\t\twidth: 55,\n\t\ttextAlign: \"center\",\n\t\tcolor: \"#fff\",\n\t\tzIndex: 3,\n\t},\n\tmessageContainer: {\n\t\tbackgroundColor: \"#000\",\n\t\tborderRadius: 10,\n\t\tpaddingVertical: 10,\n\t\tpaddingHorizontal: 30,\n\t},\n\tmessageText: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 24,\n\t\tcolor: \"#fff\",\n\t},\n});\n\nexport { SharingTools };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,gBAAgB,EAAEC,UAAU,EAAEC,IAAI,EAAEC,KAAK,QAAQ,cAAc;AACxE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AAC9C,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAClD,SAASC,eAAe,EAAEC,OAAO,EAAEC,WAAW,QAAQ,WAAW;AACjE,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,MAAM,MAAM,WAAW;AAE9B,MAAMC,YAAY,SAASjB,SAAS,CAAC;EACpCkB,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,wBAOE,YAAY;MAA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