@plusscommunities/pluss-core-app 4.0.4-auth.0 → 6.0.0-auth.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +86 -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 +12 -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/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/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 +168 -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 +54 -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 +350 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/AutoOffsetImage.js +186 -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/CategoryTabs.js +154 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +328 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +822 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +108 -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/DropDownItem.js +74 -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 +50 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +47 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +36 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +75 -0
- package/dist/module/components/FontScalePopup.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 +212 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +72 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +131 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +148 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +158 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +458 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/ImagePopup.js +240 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +68 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +795 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +65 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +154 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +220 -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 +418 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +43 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +191 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +986 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +262 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +58 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +125 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +119 -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 +106 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +77 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +116 -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 +154 -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/TextStyle.js +45 -0
- package/dist/module/components/TextStyle.js.map +1 -0
- package/dist/module/components/Toggle.js +65 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +67 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +135 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +267 -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 +82 -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 +116 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +55 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +385 -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 +32 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +19 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/fonts/index.js +2 -0
- package/dist/module/fonts/index.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.js +5 -0
- package/dist/module/fonts/pluss60-icons.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.json +1097 -0
- package/dist/module/helper.js +397 -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 +30 -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/package.json +20 -24
- package/src/js/images/detectFaces.js +8 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, Text } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from '../colours';
|
|
5
|
+
class RadioButton extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
const {
|
|
8
|
+
size,
|
|
9
|
+
isActive,
|
|
10
|
+
value,
|
|
11
|
+
onPress,
|
|
12
|
+
colourBrandingMain,
|
|
13
|
+
style,
|
|
14
|
+
label
|
|
15
|
+
} = this.props;
|
|
16
|
+
const iconSize = size || 20;
|
|
17
|
+
const innerSize = iconSize - 8;
|
|
18
|
+
const content = /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
19
|
+
onPress: () => onPress(value)
|
|
20
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: [styles.container, {
|
|
22
|
+
width: iconSize,
|
|
23
|
+
height: iconSize,
|
|
24
|
+
borderRadius: iconSize / 2
|
|
25
|
+
}, style]
|
|
26
|
+
}, isActive && /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
style: {
|
|
28
|
+
width: innerSize,
|
|
29
|
+
height: innerSize,
|
|
30
|
+
borderRadius: innerSize / 2,
|
|
31
|
+
backgroundColor: colourBrandingMain
|
|
32
|
+
}
|
|
33
|
+
})));
|
|
34
|
+
if (label) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
36
|
+
onPress: () => onPress(value),
|
|
37
|
+
key: label,
|
|
38
|
+
style: styles.radioOption,
|
|
39
|
+
hitSlop: {
|
|
40
|
+
top: 8,
|
|
41
|
+
left: 8,
|
|
42
|
+
bottom: 8,
|
|
43
|
+
right: 8
|
|
44
|
+
}
|
|
45
|
+
}, content, /*#__PURE__*/React.createElement(Text, {
|
|
46
|
+
style: styles.radioOptionText
|
|
47
|
+
}, label));
|
|
48
|
+
}
|
|
49
|
+
return content;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
container: {
|
|
54
|
+
borderColor: LINEGREY,
|
|
55
|
+
borderWidth: 1,
|
|
56
|
+
backgroundColor: '#fff',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center'
|
|
59
|
+
},
|
|
60
|
+
radioOption: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
marginRight: 26
|
|
63
|
+
},
|
|
64
|
+
radioOptionText: {
|
|
65
|
+
fontFamily: 'sf-medium',
|
|
66
|
+
fontSize: 14,
|
|
67
|
+
color: TEXT_DARKEST
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const mapStateToProps = state => {
|
|
71
|
+
return {
|
|
72
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const radioButton = connect(mapStateToProps, {})(RadioButton);
|
|
76
|
+
export { radioButton as RadioButton };
|
|
77
|
+
//# sourceMappingURL=RadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","TouchableOpacity","TouchableWithoutFeedback","StyleSheet","Text","connect","getMainBrandingColourFromState","LINEGREY","TEXT_DARKEST","RadioButton","render","size","isActive","value","onPress","colourBrandingMain","style","label","props","iconSize","innerSize","content","createElement","styles","container","width","height","borderRadius","backgroundColor","key","radioOption","hitSlop","top","left","bottom","right","radioOptionText","create","borderColor","borderWidth","alignItems","justifyContent","flexDirection","marginRight","fontFamily","fontSize","color","mapStateToProps","state","radioButton"],"sources":["RadioButton.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getMainBrandingColourFromState, LINEGREY, TEXT_DARKEST } from '../colours';\n\nclass RadioButton extends PureComponent {\n render() {\n const { size, isActive, value, onPress, colourBrandingMain, style, label } = this.props;\n const iconSize = size || 20;\n const innerSize = iconSize - 8;\n\n const content = (\n <TouchableWithoutFeedback onPress={() => onPress(value)}>\n <View style={[styles.container, { width: iconSize, height: iconSize, borderRadius: iconSize / 2 }, style]}>\n {isActive && (\n <View style={{ width: innerSize, height: innerSize, borderRadius: innerSize / 2, backgroundColor: colourBrandingMain }} />\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n\n if (label) {\n return (\n <TouchableOpacity\n onPress={() => onPress(value)}\n key={label}\n style={styles.radioOption}\n hitSlop={{ top: 8, left: 8, bottom: 8, right: 8 }}\n >\n {content}\n <Text style={styles.radioOptionText}>{label}</Text>\n </TouchableOpacity>\n );\n }\n\n return content;\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n borderColor: LINEGREY,\n borderWidth: 1,\n backgroundColor: '#fff',\n alignItems: 'center',\n justifyContent: 'center',\n },\n radioOption: {\n flexDirection: 'row',\n marginRight: 26,\n },\n radioOptionText: {\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: TEXT_DARKEST,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst radioButton = connect(mapStateToProps, {})(RadioButton);\nexport { radioButton as RadioButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACjG,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,8BAA8B,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,YAAY;AAEnF,MAAMC,WAAW,SAASV,aAAa,CAAC;EACtCW,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,IAAI;MAAEC,QAAQ;MAAEC,KAAK;MAAEC,OAAO;MAAEC,kBAAkB;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAG,IAAI,CAACC,KAAK;IACvF,MAAMC,QAAQ,GAAGR,IAAI,IAAI,EAAE;IAC3B,MAAMS,SAAS,GAAGD,QAAQ,GAAG,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,cAAc,EAAE;EAClB,CAAC;EACDX,WAAW,EAAE;IACXY,aAAa,EAAE,KAAK;IACpBC,WAAW,EAAE;EACf,CAAC;EACDP,eAAe,EAAE;IACfQ,UAAU,EAAE,WAAW;IACvBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEtC;EACT;AACF,CAAC,CAAC;AAEF,MAAMuC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLjC,kBAAkB,EAAET,8BAA8B,CAAC0C,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMC,WAAW,GAAG5C,OAAO,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtC,WAAW,CAAC;AAC7D,SAASwC,WAAW,IAAIxC,WAAW"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import { View, Text, Image, TouchableOpacity } from 'react-native';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
import { getReactions, getShadowStyle } from '../helper';
|
|
9
|
+
import { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from '../colours';
|
|
10
|
+
import { reactionActions } from '../apis';
|
|
11
|
+
class Reaction extends Component {
|
|
12
|
+
constructor(...args) {
|
|
13
|
+
super(...args);
|
|
14
|
+
_defineProperty(this, "onPressReaction", () => {
|
|
15
|
+
if (!this.props.reactions[this.props.userId]) {
|
|
16
|
+
reactionActions.add(this.props.entityId, this.props.entityType, this.props.reaction.key, this.props.site);
|
|
17
|
+
this.props.onLike();
|
|
18
|
+
} else {
|
|
19
|
+
reactionActions.remove(this.props.entityId, this.props.entityType, this.props.reaction.key);
|
|
20
|
+
this.props.onUnlike();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getStyleType() {
|
|
25
|
+
if (this.props.reactions[this.props.userId]) {
|
|
26
|
+
return 'ThisHL';
|
|
27
|
+
}
|
|
28
|
+
if (this.props.anyHighlighted) {
|
|
29
|
+
return 'OtherHL';
|
|
30
|
+
}
|
|
31
|
+
return 'Default';
|
|
32
|
+
}
|
|
33
|
+
getTopReaction() {
|
|
34
|
+
return _.maxBy(Object.keys(this.props.reactions), key => {
|
|
35
|
+
return Object.keys(this.props.reactions[key]).length;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
getIcon(topReaction) {
|
|
39
|
+
return _.find(getReactions(), r => {
|
|
40
|
+
return r.key === topReaction;
|
|
41
|
+
}).icon;
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
if (this.props.topReactionOnly) {
|
|
45
|
+
const topReaction = this.getTopReaction();
|
|
46
|
+
if (!topReaction) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
50
|
+
style: [styles.container, styles.containerThisHL, this.props.style]
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
52
|
+
style: [styles.image, this.props.imageStyle],
|
|
53
|
+
source: this.getIcon(topReaction)
|
|
54
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
style: [styles.count, this.props.countStyle]
|
|
56
|
+
}, Object.keys(this.props.reactions[topReaction]).length));
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
59
|
+
style: styles.touchable,
|
|
60
|
+
onPress: this.onPressReaction,
|
|
61
|
+
disabled: this.props.user.type === 'KIOSK'
|
|
62
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
style: [styles.container, styles[`container${this.getStyleType()}`], this.props.style]
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
65
|
+
style: [styles.image, this.props.imageStyle],
|
|
66
|
+
source: this.props.reaction.icon
|
|
67
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
68
|
+
style: [styles.count, this.getStyleType() === 'ThisHL' && {
|
|
69
|
+
color: this.props.colourBrandingMain
|
|
70
|
+
}, this.props.countStyle]
|
|
71
|
+
}, Object.keys(this.props.reactions).length)));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const styles = {
|
|
75
|
+
touchable: {
|
|
76
|
+
marginHorizontal: 4,
|
|
77
|
+
width: 60,
|
|
78
|
+
height: 30
|
|
79
|
+
},
|
|
80
|
+
container: {
|
|
81
|
+
width: 60,
|
|
82
|
+
height: 30,
|
|
83
|
+
borderRadius: 15,
|
|
84
|
+
backgroundColor: BG_GREY,
|
|
85
|
+
flexDirection: 'row-reverse',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
paddingHorizontal: 8
|
|
88
|
+
},
|
|
89
|
+
containerThisHL: {
|
|
90
|
+
...getShadowStyle()
|
|
91
|
+
},
|
|
92
|
+
containerOtherHL: {
|
|
93
|
+
opacity: 0.5
|
|
94
|
+
},
|
|
95
|
+
image: {
|
|
96
|
+
width: 20,
|
|
97
|
+
height: 20,
|
|
98
|
+
resizeMode: 'contain'
|
|
99
|
+
},
|
|
100
|
+
count: {
|
|
101
|
+
fontFamily: 'sf-medium',
|
|
102
|
+
color: TEXT_DARK,
|
|
103
|
+
flex: 1,
|
|
104
|
+
textAlign: 'center',
|
|
105
|
+
fontSize: 16
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const mapStateToProps = state => {
|
|
109
|
+
return {
|
|
110
|
+
colourBrandingMain: getMainBrandingColourFromState(state),
|
|
111
|
+
user: state.user
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const reaction = connect(mapStateToProps, {})(Reaction);
|
|
115
|
+
export { reaction as Reaction };
|
|
116
|
+
//# sourceMappingURL=Reaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","Image","TouchableOpacity","connect","_","getReactions","getShadowStyle","BG_GREY","TEXT_DARK","getMainBrandingColourFromState","reactionActions","Reaction","constructor","args","_defineProperty","props","reactions","userId","add","entityId","entityType","reaction","key","site","onLike","remove","onUnlike","getStyleType","anyHighlighted","getTopReaction","maxBy","Object","keys","length","getIcon","topReaction","find","r","icon","render","topReactionOnly","createElement","style","styles","container","containerThisHL","image","imageStyle","source","count","countStyle","touchable","onPress","onPressReaction","disabled","user","type","color","colourBrandingMain","marginHorizontal","width","height","borderRadius","backgroundColor","flexDirection","alignItems","paddingHorizontal","containerOtherHL","opacity","resizeMode","fontFamily","flex","textAlign","fontSize","mapStateToProps","state"],"sources":["Reaction.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, Image, TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { getReactions, getShadowStyle } from '../helper';\nimport { BG_GREY, TEXT_DARK, getMainBrandingColourFromState } from '../colours';\nimport { reactionActions } from '../apis';\n\nclass Reaction extends Component {\n onPressReaction = () => {\n if (!this.props.reactions[this.props.userId]) {\n reactionActions.add(this.props.entityId, this.props.entityType, this.props.reaction.key, this.props.site);\n this.props.onLike();\n } else {\n reactionActions.remove(this.props.entityId, this.props.entityType, this.props.reaction.key);\n this.props.onUnlike();\n }\n };\n\n getStyleType() {\n if (this.props.reactions[this.props.userId]) {\n return 'ThisHL';\n }\n if (this.props.anyHighlighted) {\n return 'OtherHL';\n }\n return 'Default';\n }\n\n getTopReaction() {\n return _.maxBy(Object.keys(this.props.reactions), key => {\n return Object.keys(this.props.reactions[key]).length;\n });\n }\n\n getIcon(topReaction) {\n return _.find(getReactions(), r => {\n return r.key === topReaction;\n }).icon;\n }\n\n render() {\n if (this.props.topReactionOnly) {\n const topReaction = this.getTopReaction();\n if (!topReaction) {\n return null;\n }\n return (\n <View style={[styles.container, styles.containerThisHL, this.props.style]}>\n <Image style={[styles.image, this.props.imageStyle]} source={this.getIcon(topReaction)} />\n <Text style={[styles.count, this.props.countStyle]}>{Object.keys(this.props.reactions[topReaction]).length}</Text>\n </View>\n );\n }\n return (\n <TouchableOpacity style={styles.touchable} onPress={this.onPressReaction} disabled={this.props.user.type === 'KIOSK'}>\n <View style={[styles.container, styles[`container${this.getStyleType()}`], this.props.style]}>\n <Image style={[styles.image, this.props.imageStyle]} source={this.props.reaction.icon} />\n <Text style={[styles.count, this.getStyleType() === 'ThisHL' && { color: this.props.colourBrandingMain }, this.props.countStyle]}>\n {Object.keys(this.props.reactions).length}\n </Text>\n </View>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n touchable: {\n marginHorizontal: 4,\n width: 60,\n height: 30,\n },\n container: {\n width: 60,\n height: 30,\n borderRadius: 15,\n backgroundColor: BG_GREY,\n flexDirection: 'row-reverse',\n alignItems: 'center',\n paddingHorizontal: 8,\n },\n containerThisHL: {\n ...getShadowStyle(),\n },\n containerOtherHL: {\n opacity: 0.5,\n },\n image: {\n width: 20,\n height: 20,\n resizeMode: 'contain',\n },\n count: {\n fontFamily: 'sf-medium',\n color: TEXT_DARK,\n flex: 1,\n textAlign: 'center',\n fontSize: 16,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n user: state.user,\n };\n};\n\nconst reaction = connect(mapStateToProps, {})(Reaction);\nexport { reaction as Reaction };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,gBAAgB,QAAQ,cAAc;AAClE,SAASC,OAAO,QAAQ,aA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Ae,EAAE;IACf,GAAGvC,cAAc,CAAC;EACpB,CAAC;EACD6D,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDtB,KAAK,EAAE;IACLc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,UAAU,EAAE;EACd,CAAC;EACDpB,KAAK,EAAE;IACLqB,UAAU,EAAE,WAAW;IACvBb,KAAK,EAAEjD,SAAS;IAChB+D,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLjB,kBAAkB,EAAEjD,8BAA8B,CAACkE,KAAK,CAAC;IACzDpB,IAAI,EAAEoB,KAAK,CAACpB;EACd,CAAC;AACH,CAAC;AAED,MAAMlC,QAAQ,GAAGlB,OAAO,CAACuE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC/D,QAAQ,CAAC;AACvD,SAASU,QAAQ,IAAIV,QAAQ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
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 state = {\n reactions: getReactions(),\n };\n\n getReaction(key) {\n if (!this.props.entity) {\n return {};\n }\n if (!this.props.entity.Reactions) {\n this.props.entity.Reactions = {};\n }\n return this.props.entity.Reactions[key] || {};\n }\n\n onLike(key) {\n if (!this.props.entity.Reactions) {\n this.props.entity.Reactions = {};\n }\n if (!this.props.entity.Reactions[key]) {\n this.props.entity.Reactions[key] = {};\n }\n this.props.entity.Reactions[key][this.props.user.uid] = getUserPreview(this.props.user);\n this.props.onUpdateReactions();\n }\n\n onUnlike(key) {\n if (!this.props.entity.Reactions) {\n return;\n }\n if (!this.props.entity.Reactions[key]) {\n return;\n }\n delete this.props.entity.Reactions[key][this.props.user.uid];\n this.props.onUpdateReactions();\n }\n\n render() {\n return (\n <View style={[styles.container, this.props.style]}>\n {this.state.reactions.map((r, i) => {\n return (\n <Reaction\n key={i}\n reaction={r}\n entityType={this.props.entityType}\n entityId={this.props.entityId}\n reactions={this.getReaction(r.key)}\n anyHighlighted={this.props.anyHighlighted}\n userId={this.props.user.uid}\n onLike={this.onLike.bind(this, r.key)}\n onUnlike={this.onUnlike.bind(this, r.key)}\n site={this.props.site}\n />\n );\n })}\n </View>\n );\n }\n}\n\nconst styles = {\n container: {\n flexDirection: 'row',\n justifyContent: 'center',\n width: '100%',\n },\n};\n\nexport { Reactions };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,WAAW;AACxD,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,SAAS,SAASL,SAAS,CAAC;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBACxB;MACNC,SAAS,EAAEP,YAAY,CAAC;IAC1B,CAAC;EAAA;EAEDQ,WAAWA,CAACC,GAAG,EAAE;IACf,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,EAAE;MACtB,OAAO,CAAC,CAAC;IACX;IACA,IAAI,CAAC,IAAI,CAACD,KAAK,CAACC,MAAM,CAACR,SAAS,EAAE;MAChC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,GAAG,CAAC,CAAC;IAClC;IACA,OAAO,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,IAAI,CAAC,CAAC;EAC/C;EAEAG,MAAMA,CAACH,GAAG,EAAE;IACV,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACR,SAAS,EAAE;MAChC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,GAAG,CAAC,CAAC;IAClC;IACA,IAAI,CAAC,IAAI,CAACO,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,EAAE;MACrC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACR,SAAS,CAACM,GAAG,CAAC,GAAG,CAAC,CAAC;I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,KAAK,CAACG,IAAI,CAACC,GAAI;QAC5BF,MAAM,EAAE,IAAI,CAACA,MAAM,CAACmB,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QACtCO,QAAQ,EAAE,IAAI,CAACA,QAAQ,CAACe,IAAI,CAAC,IAAI,EAAEP,CAAC,CAACf,GAAG,CAAE;QAC1CuB,IAAI,EAAE,IAAI,CAACtB,KAAK,CAACsB;MAAK,CACvB,CAAC;IAEN,CAAC,CACG,CAAC;EAEX;AACF;AAEA,MAAMZ,MAAM,GAAG;EACbC,SAAS,EAAE;IACTY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT;AACF,CAAC;AAED,SAAShC,SAAS"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import { TouchableOpacity, StyleSheet, View, Text } from 'react-native';
|
|
7
|
+
import { Icon } from 'react-native-elements';
|
|
8
|
+
import * as FileSystem from 'expo-file-system';
|
|
9
|
+
import * as Sharing from 'expo-sharing';
|
|
10
|
+
import * as MediaLibrary from 'expo-media-library';
|
|
11
|
+
import { StatusBarHeight, isVideo, getMimeType } from '../helper';
|
|
12
|
+
import { MiddlePopup } from './MiddlePopup';
|
|
13
|
+
import Config from '../config';
|
|
14
|
+
class SharingTools extends Component {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
_defineProperty(this, "downloadMedia", async () => {
|
|
18
|
+
const remoteUrl = this.props.uri;
|
|
19
|
+
const parts = remoteUrl.split('/').splice(-2);
|
|
20
|
+
const mediaId = parts[0];
|
|
21
|
+
const extension = parts[1].split('.').splice(-1)[0];
|
|
22
|
+
const downloadPath = `${FileSystem.cacheDirectory}${mediaId}.${extension}`;
|
|
23
|
+
const {
|
|
24
|
+
uri: localUrl
|
|
25
|
+
} = await FileSystem.downloadAsync(remoteUrl, downloadPath);
|
|
26
|
+
return {
|
|
27
|
+
localUrl,
|
|
28
|
+
extension
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
_defineProperty(this, "onSave", () => {
|
|
32
|
+
this.setState({
|
|
33
|
+
message: 'Saving...'
|
|
34
|
+
}, async () => {
|
|
35
|
+
const {
|
|
36
|
+
localUrl
|
|
37
|
+
} = await this.downloadMedia();
|
|
38
|
+
await MediaLibrary.saveToLibraryAsync(localUrl);
|
|
39
|
+
this.setState({
|
|
40
|
+
message: 'Saved'
|
|
41
|
+
}, () => {
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
this.setState({
|
|
44
|
+
message: ''
|
|
45
|
+
});
|
|
46
|
+
}, 2000);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
_defineProperty(this, "onShare", async () => {
|
|
51
|
+
if (!(await Sharing.isAvailableAsync())) return;
|
|
52
|
+
this.setState({
|
|
53
|
+
message: 'Preparing...'
|
|
54
|
+
}, async () => {
|
|
55
|
+
const {
|
|
56
|
+
localUrl,
|
|
57
|
+
extension
|
|
58
|
+
} = await this.downloadMedia();
|
|
59
|
+
// console.log('sharing...', localUrl);
|
|
60
|
+
|
|
61
|
+
const video = isVideo(localUrl);
|
|
62
|
+
const mimeType = getMimeType(localUrl);
|
|
63
|
+
const fileDetails = {
|
|
64
|
+
extension: `.${extension}`,
|
|
65
|
+
shareOptions: {
|
|
66
|
+
mimeType,
|
|
67
|
+
dialogTitle: video ? 'Share video' : 'Share photo',
|
|
68
|
+
UTI: mimeType
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
await Sharing.shareAsync(localUrl, fileDetails.shareOptions);
|
|
72
|
+
this.setState({
|
|
73
|
+
message: ''
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
this.state = {
|
|
78
|
+
message: ''
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
renderTools() {
|
|
82
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
83
|
+
style: styles.toolsContainer
|
|
84
|
+
}, Config.env.allowMediaDownload && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
85
|
+
onPress: this.onSave,
|
|
86
|
+
activeOpacity: 0.6
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
88
|
+
name: "download",
|
|
89
|
+
type: "font-awesome",
|
|
90
|
+
iconStyle: styles.toolIcon,
|
|
91
|
+
style: styles.toolIconContainer
|
|
92
|
+
})), Config.env.allowMediaSharing && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
93
|
+
onPress: this.onShare,
|
|
94
|
+
activeOpacity: 0.6
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
|
+
name: "share-square-o",
|
|
97
|
+
type: "font-awesome",
|
|
98
|
+
iconStyle: styles.toolIcon,
|
|
99
|
+
style: styles.toolIconContainer
|
|
100
|
+
})));
|
|
101
|
+
}
|
|
102
|
+
renderMessage() {
|
|
103
|
+
return /*#__PURE__*/React.createElement(MiddlePopup, {
|
|
104
|
+
visible: !_.isEmpty(this.state.message)
|
|
105
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
106
|
+
style: styles.messageContainer
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
style: styles.messageText
|
|
109
|
+
}, this.state.message)));
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
113
|
+
style: styles.container
|
|
114
|
+
}, this.renderTools(), this.renderMessage());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
container: {
|
|
119
|
+
position: 'absolute'
|
|
120
|
+
},
|
|
121
|
+
toolsContainer: {
|
|
122
|
+
position: 'absolute',
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
justifyContent: 'space-between',
|
|
125
|
+
left: 0,
|
|
126
|
+
zIndex: 3,
|
|
127
|
+
top: StatusBarHeight(0)
|
|
128
|
+
},
|
|
129
|
+
toolIconContainer: {
|
|
130
|
+
width: 55,
|
|
131
|
+
height: 55
|
|
132
|
+
},
|
|
133
|
+
toolIcon: {
|
|
134
|
+
fontSize: 25,
|
|
135
|
+
padding: 15,
|
|
136
|
+
width: 55,
|
|
137
|
+
textAlign: 'center',
|
|
138
|
+
color: '#fff',
|
|
139
|
+
zIndex: 3
|
|
140
|
+
},
|
|
141
|
+
messageContainer: {
|
|
142
|
+
backgroundColor: '#000',
|
|
143
|
+
borderRadius: 10,
|
|
144
|
+
paddingVertical: 10,
|
|
145
|
+
paddingHorizontal: 30
|
|
146
|
+
},
|
|
147
|
+
messageText: {
|
|
148
|
+
fontFamily: 'sf-bold',
|
|
149
|
+
fontSize: 24,
|
|
150
|
+
color: '#fff'
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
export { SharingTools };
|
|
154
|
+
//# sourceMappingURL=SharingTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","_","TouchableOpacity","StyleSheet","View","Text","Icon","FileSystem","Sharing","MediaLibrary","StatusBarHeight","isVideo","getMimeType","MiddlePopup","Config","SharingTools","constructor","props","_defineProperty","remoteUrl","uri","parts","split","splice","mediaId","extension","downloadPath","cacheDirectory","localUrl","downloadAsync","setState","message","downloadMedia","saveToLibraryAsync","setTimeout","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, Text } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport * as FileSystem 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 constructor(props) {\n super(props);\n\n this.state = {\n message: '',\n };\n }\n\n downloadMedia = async () => {\n const remoteUrl = this.props.uri;\n const parts = remoteUrl.split('/').splice(-2);\n const mediaId = parts[0];\n const extension = parts[1].split('.').splice(-1)[0];\n\n const downloadPath = `${FileSystem.cacheDirectory}${mediaId}.${extension}`;\n const { uri: localUrl } = await FileSystem.downloadAsync(remoteUrl, downloadPath);\n return { localUrl, extension };\n };\n\n onSave = () => {\n this.setState({ message: 'Saving...' }, async () => {\n const { localUrl } = await this.downloadMedia();\n await MediaLibrary.saveToLibraryAsync(localUrl);\n\n this.setState({ message: 'Saved' }, () => {\n setTimeout(() => {\n this.setState({ message: '' });\n }, 2000);\n });\n });\n };\n\n onShare = async () => {\n if (!(await Sharing.isAvailableAsync())) return;\n\n this.setState({ message: 'Preparing...' }, async () => {\n const { localUrl, extension } = await this.downloadMedia();\n // console.log('sharing...', localUrl);\n\n const video = isVideo(localUrl);\n const mimeType = getMimeType(localUrl);\n const fileDetails = {\n extension: `.${extension}`,\n shareOptions: {\n mimeType,\n dialogTitle: video ? 'Share video' : 'Share photo',\n UTI: mimeType,\n },\n };\n\n await Sharing.shareAsync(localUrl, fileDetails.shareOptions);\n this.setState({ message: '' });\n });\n };\n\n renderTools() {\n return (\n <View style={styles.toolsContainer}>\n {Config.env.allowMediaDownload && (\n <TouchableOpacity onPress={this.onSave} activeOpacity={0.6}>\n <Icon name=\"download\" type=\"font-awesome\" iconStyle={styles.toolIcon} style={styles.toolIconContainer} />\n </TouchableOpacity>\n )}\n {Config.env.allowMediaSharing && (\n <TouchableOpacity onPress={this.onShare} activeOpacity={0.6}>\n <Icon name=\"share-square-o\" type=\"font-awesome\" iconStyle={styles.toolIcon} style={styles.toolIconContainer} />\n </TouchableOpacity>\n )}\n </View>\n );\n }\n\n renderMessage() {\n return (\n <MiddlePopup visible={!_.isEmpty(this.state.message)}>\n <View style={styles.messageContainer}>\n <Text style={styles.messageText}>{this.state.message}</Text>\n </View>\n </MiddlePopup>\n );\n }\n\n render() {\n return (\n <View style={styles.container}>\n {this.renderTools()}\n {this.renderMessage()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n },\n toolsContainer: {\n position: 'absolute',\n flexDirection: 'row',\n justifyContent: 'space-between',\n left: 0,\n zIndex: 3,\n top: StatusBarHeight(0),\n },\n toolIconContainer: {\n width: 55,\n height: 55,\n },\n toolIcon: {\n fontSize: 25,\n padding: 15,\n width: 55,\n textAlign: 'center',\n color: '#fff',\n zIndex: 3,\n },\n messageContainer: {\n backgroundColor: '#000',\n borderRadius: 10,\n paddingVertical: 10,\n paddingHorizontal: 30,\n },\n messageText: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n color: '#fff',\n },\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,IAAI,QA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AAC;EAEX;AACF;AAEA,MAAMd,MAAM,GAAG5C,UAAU,CAACiE,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,QAAQ,EAAE;EACZ,CAAC;EACDrB,cAAc,EAAE;IACdqB,QAAQ,EAAE,UAAU;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,CAAC;IACTC,GAAG,EAAEhE,eAAe,CAAC,CAAC;EACxB,CAAC;EACDgD,iBAAiB,EAAE;IACjBiB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDnB,QAAQ,EAAE;IACRoB,QAAQ,EAAE,EAAE;IACZC,OAAO,EAAE,EAAE;IACXH,KAAK,EAAE,EAAE;IACTI,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,MAAM;IACbP,MAAM,EAAE;EACV,CAAC;EACDT,gBAAgB,EAAE;IAChBiB,eAAe,EAAE,MAAM;IACvBC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDnB,WAAW,EAAE;IACXoB,UAAU,EAAE,SAAS;IACrBR,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,SAASjE,YAAY"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { LoadingCircles } from './LoadingCircles';
|
|
4
|
+
const Spinner = ({
|
|
5
|
+
color,
|
|
6
|
+
style
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
9
|
+
style: [styles.spinnerStyle, style]
|
|
10
|
+
}, /*#__PURE__*/React.createElement(LoadingCircles, {
|
|
11
|
+
color: color
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
const styles = {
|
|
15
|
+
spinnerStyle: {
|
|
16
|
+
flex: 1,
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export { Spinner };
|
|
22
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","LoadingCircles","Spinner","color","style","createElement","styles","spinnerStyle","flex","justifyContent","alignItems"],"sources":["Spinner.js"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { LoadingCircles } from './LoadingCircles';\n\nconst Spinner = ({ color, style }) => {\n return (\n <View style={[styles.spinnerStyle, style]}>\n <LoadingCircles color={color} />\n </View>\n );\n};\n\nconst styles = {\n spinnerStyle: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n};\n\nexport { Spinner };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,MAAMC,OAAO,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAM,CAAC,KAAK;EACpC,oBACEL,KAAA,CAAAM,aAAA,CAACL,IAAI;IAACI,KAAK,EAAE,CAACE,MAAM,CAACC,YAAY,EAAEH,KAAK;EAAE,gBACxCL,KAAA,CAAAM,aAAA,CAACJ,cAAc;IAACE,KAAK,EAAEA;EAAM,CAAE,CAC3B,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAG;EACbC,YAAY,EAAE;IACZC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC;AAED,SAASR,OAAO"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { LINEGREY } from '../colours';
|
|
4
|
+
import { FOOTER_HEIGHT } from '../constants';
|
|
5
|
+
class StickyFooter extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
8
|
+
style: [styles.section, this.props.lineSeparated && styles.lineSeparated, this.props.style]
|
|
9
|
+
}, this.props.children);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const styles = {
|
|
13
|
+
section: {
|
|
14
|
+
backgroundColor: '#fff',
|
|
15
|
+
height: FOOTER_HEIGHT,
|
|
16
|
+
borderTopWidth: 0,
|
|
17
|
+
shadowColor: '#000',
|
|
18
|
+
shadowOffset: {
|
|
19
|
+
width: 0,
|
|
20
|
+
height: -1
|
|
21
|
+
},
|
|
22
|
+
shadowOpacity: 0.1,
|
|
23
|
+
shadowRadius: 6,
|
|
24
|
+
elevation: 16
|
|
25
|
+
},
|
|
26
|
+
lineSeparated: {
|
|
27
|
+
borderTopWidth: 1,
|
|
28
|
+
borderColor: LINEGREY,
|
|
29
|
+
shadowOpacity: 0,
|
|
30
|
+
elevation: 0
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export { StickyFooter };
|
|
34
|
+
//# sourceMappingURL=StickyFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","LINEGREY","FOOTER_HEIGHT","StickyFooter","render","createElement","style","styles","section","props","lineSeparated","children","backgroundColor","height","borderTopWidth","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderColor"],"sources":["StickyFooter.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View } from 'react-native';\nimport { LINEGREY } from '../colours';\nimport { FOOTER_HEIGHT } from '../constants';\n\nclass StickyFooter extends PureComponent {\n render() {\n return <View style={[styles.section, this.props.lineSeparated && styles.lineSeparated, this.props.style]}>{this.props.children}</View>;\n }\n}\n\nconst styles = {\n section: {\n backgroundColor: '#fff',\n height: FOOTER_HEIGHT,\n borderTopWidth: 0,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: -1,\n },\n shadowOpacity: 0.1,\n shadowRadius: 6,\n elevation: 16,\n },\n lineSeparated: {\n borderTopWidth: 1,\n borderColor: LINEGREY,\n shadowOpacity: 0,\n elevation: 0,\n },\n};\n\nexport { StickyFooter };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,aAAa,QAAQ,cAAc;AAE5C,MAAMC,YAAY,SAASJ,aAAa,CAAC;EACvCK,MAAMA,CAAA,EAAG;IACP,oBAAON,KAAA,CAAAO,aAAA,CAACL,IAAI;MAACM,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAE,IAAI,CAACC,KAAK,CAACC,aAAa,IAAIH,MAAM,CAACG,aAAa,EAAE,IAAI,CAACD,KAAK,CAACH,KAAK;IAAE,GAAE,IAAI,CAACG,KAAK,CAACE,QAAe,CAAC;EACxI;AACF;AAEA,MAAMJ,MAAM,GAAG;EACbC,OAAO,EAAE;IACPI,eAAe,EAAE,MAAM;IACvBC,MAAM,EAAEX,aAAa;IACrBY,cAAc,EAAE,CAAC;IACjBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRJ,MAAM,EAAE,CAAC;IACX,CAAC;IACDK,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CAAC;EACDV,aAAa,EAAE;IACbI,cAAc,EAAE,CAAC;IACjBO,WAAW,EAAEpB,QAAQ;IACrBiB,aAAa,EAAE,CAAC;IAChBE,SAAS,EAAE;EACb;AACF,CAAC;AAED,SAASjB,YAAY"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { PureComponent } from 'react';
|
|
3
|
+
import { StyleSheet, Text } from 'react-native';
|
|
4
|
+
import { TEXT_DARKEST, COLOUR_RED } from '../colours';
|
|
5
|
+
class TextStyle extends PureComponent {
|
|
6
|
+
render() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(Text, _extends({}, this.props, {
|
|
8
|
+
style: [styles[this.props.type], this.props.style]
|
|
9
|
+
}), this.props.children);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const styles = StyleSheet.create({
|
|
13
|
+
pageHeading: {
|
|
14
|
+
fontFamily: 'sf-bold',
|
|
15
|
+
fontSize: 24,
|
|
16
|
+
color: TEXT_DARKEST
|
|
17
|
+
},
|
|
18
|
+
body: {
|
|
19
|
+
fontFamily: 'sf-regular',
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
color: TEXT_DARKEST
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
fontFamily: 'sf-semibold',
|
|
25
|
+
color: TEXT_DARKEST,
|
|
26
|
+
fontSize: 16
|
|
27
|
+
},
|
|
28
|
+
detailLabel: {
|
|
29
|
+
fontFamily: 'sf-bold',
|
|
30
|
+
color: TEXT_DARKEST,
|
|
31
|
+
fontSize: 16
|
|
32
|
+
},
|
|
33
|
+
input: {
|
|
34
|
+
color: TEXT_DARKEST,
|
|
35
|
+
fontFamily: 'sf-regular',
|
|
36
|
+
fontSize: 16
|
|
37
|
+
},
|
|
38
|
+
error: {
|
|
39
|
+
fontFamily: 'sf-bold',
|
|
40
|
+
color: COLOUR_RED,
|
|
41
|
+
fontSize: 16
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export { TextStyle };
|
|
45
|
+
//# sourceMappingURL=TextStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","StyleSheet","Text","TEXT_DARKEST","COLOUR_RED","TextStyle","render","createElement","_extends","props","style","styles","type","children","create","pageHeading","fontFamily","fontSize","color","body","label","detailLabel","input","error"],"sources":["TextStyle.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { StyleSheet, Text } from 'react-native';\nimport { TEXT_DARKEST, COLOUR_RED } from '../colours';\n\nclass TextStyle extends PureComponent {\n render() {\n return (\n <Text {...this.props} style={[styles[this.props.type], this.props.style]}>\n {this.props.children}\n </Text>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n pageHeading: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n color: TEXT_DARKEST,\n },\n body: {\n fontFamily: 'sf-regular',\n fontSize: 14,\n color: TEXT_DARKEST,\n },\n label: {\n fontFamily: 'sf-semibold',\n color: TEXT_DARKEST,\n fontSize: 16,\n },\n detailLabel: {\n fontFamily: 'sf-bold',\n color: TEXT_DARKEST,\n fontSize: 16,\n },\n input: {\n color: TEXT_DARKEST,\n fontFamily: 'sf-regular',\n fontSize: 16,\n },\n error: {\n fontFamily: 'sf-bold',\n color: COLOUR_RED,\n fontSize: 16,\n },\n});\n\nexport { TextStyle };\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,YAAY,EAAEC,UAAU,QAAQ,YAAY;AAErD,MAAMC,SAAS,SAASL,aAAa,CAAC;EACpCM,MAAMA,CAAA,EAAG;IACP,oBACEP,KAAA,CAAAQ,aAAA,CAACL,IAAI,EAAAM,QAAA,KAAK,IAAI,CAACC,KAAK;MAAEC,KAAK,EAAE,CAACC,MAAM,CAAC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC,EAAE,IAAI,CAACH,KAAK,CAACC,KAAK;IAAE,IACtE,IAAI,CAACD,KAAK,CAACI,QACR,CAAC;EAEX;AACF;AAEA,MAAMF,MAAM,GAAGV,UAAU,CAACa,MAAM,CAAC;EAC/BC,WAAW,EAAE;IACXC,UAAU,EAAE,SAAS;IACrBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEf;EACT,CA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