@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 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","TouchableWithoutFeedback","Modal","_","connect","LINEGREY","TEXT_DARK","TEXT_LIGHT","getMainBrandingColourFromState","InlineButton","Popup","renderOptions","props","options","createElement","style","styles","bottom","map","option","index","key","onPress","action","color","textStyle","optionText","colourBrandingMain","bold","optionTextBold","text","renderTitle","title","renderContent","content","render","visible","transparent","animationType","onRequestClose","onClose","container","menu","containerStyle","top","children","position","left","right","backgroundColor","zIndex","paddingHorizontal","paddingVertical","justifyContent","alignItems","width","borderRadius","padding","fontFamily","fontSize","lineHeight","textAlign","marginBottom","borderTopColor","borderTopWidth","flexDirection","marginRight","mapStateToProps","state","popup"],"sources":["Popup.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, TouchableWithoutFeedback, Modal } from 'react-native';\nimport _ from 'lodash';\nimport { connect } from 'react-redux';\nimport { LINEGREY, TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState } from '../colours';\nimport { InlineButton } from './InlineButton';\n\nclass Popup extends Component {\n renderOptions() {\n if (!this.props.options) {\n return null;\n }\n return (\n <View style={styles.bottom}>\n {_.map(this.props.options, (option, index) => {\n return (\n <InlineButton\n key={index}\n onPress={option.action}\n color=\"#fff\"\n textStyle={[styles.optionText, { color: this.props.colourBrandingMain }, option.bold && styles.optionTextBold]}\n >\n {option.text}\n </InlineButton>\n );\n })}\n </View>\n );\n }\n\n renderTitle() {\n if (!this.props.title) {\n return null;\n }\n return <Text style={[styles.title, { color: this.props.colourBrandingMain }]}>{this.props.title}</Text>;\n }\n\n renderContent() {\n if (this.props.content) {\n return this.props.content;\n }\n if (!this.props.text) {\n return null;\n }\n return <Text style={styles.text}>{this.props.text}</Text>;\n }\n\n render() {\n return (\n <Modal visible transparent animationType=\"fade\" onRequestClose={this.props.onClose}>\n <TouchableWithoutFeedback style={styles.container} onPress={this.props.onClose}>\n <View style={styles.container}>\n <View style={[styles.menu, this.props.containerStyle]}>\n <View style={styles.top}>\n {this.renderTitle()}\n {this.renderContent()}\n {this.props.children}\n </View>\n {this.renderOptions()}\n </View>\n </View>\n </TouchableWithoutFeedback>\n </Modal>\n );\n }\n}\n\nconst styles = {\n container: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n zIndex: 1000,\n paddingHorizontal: 16,\n paddingVertical: 32,\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n },\n menu: {\n backgroundColor: '#fff',\n borderRadius: 12,\n },\n top: {\n padding: 24,\n },\n title: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n lineHeight: 24,\n color: TEXT_DARK,\n textAlign: 'center',\n marginBottom: 16,\n },\n text: {\n fontFamily: 'sf-regular',\n fontSize: 16,\n lineHeight: 22,\n color: TEXT_LIGHT,\n textAlign: 'center',\n },\n bottom: {\n borderTopColor: LINEGREY,\n borderTopWidth: 1,\n flexDirection: 'row-reverse',\n padding: 8,\n },\n option: {\n marginRight: 16,\n },\n optionText: {\n fontFamily: 'sf-regular',\n fontSize: 16,\n },\n optionTextBold: {\n fontFamily: 'sf-semibold',\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst popup = connect(mapStateToProps, {})(Popup);\nexport { popup as Popup };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,wBAAwB,EAAEC,KAAK,QAAQ,cAAc;AAC1E,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,8BAA8B,QAAQ,YAAY;AAC5F,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,MAAMC,KAAK,SAASZ,SAAS,CAAC;EAC5Ba,aAAaA,CAAA,EAAG;IACd,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,OAAO,EAAE;MACvB,OAAO,IAAI;IACb;IACA,oBACEhB,KAAA,CAAAiB,aAAA,CAACf,IAAI;MAACgB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SAAS;IACrBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdpC,KAAK,EAAElB,SAAS;IAChBuD,SAAS,EAAE,QAAQ;IACnBC,YAAY,EAAE;EAChB,CAAC;EACDhC,IAAI,EAAE;IACJ4B,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdpC,KAAK,EAAEjB,UAAU;IACjBsD,SAAS,EAAE;EACb,CAAC;EACD5C,MAAM,EAAE;IACN8C,cAAc,EAAE1D,QAAQ;IACxB2D,cAAc,EAAE,CAAC;IACjBC,aAAa,EAAE,aAAa;IAC5BR,OAAO,EAAE;EACX,CAAC;EACDtC,MAAM,EAAE;IACN+C,WAAW,EAAE;EACf,CAAC;EACDxC,UAAU,EAAE;IACVgC,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE;EACZ,CAAC;EACD9B,cAAc,EAAE;IACd6B,UAAU,EAAE;EACd;AACF,CAAC;AAED,MAAMS,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACLzC,kBAAkB,EAAEnB,8BAA8B,CAAC4D,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAMC,KAAK,GAAGjE,OAAO,CAAC+D,eAAe,EAAE,CAAC,CAAC,CAAC,CAACzD,KAAK,CAAC;AACjD,SAAS2D,KAAK,IAAI3D,KAAK"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { View, Text, TouchableWithoutFeedback, TouchableOpacity, Modal } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { getMainBrandingColourFromState, LINEGREY, TEXT_DARK } from '../colours';
|
|
6
|
+
class PopupMenu extends Component {
|
|
7
|
+
renderOption(item, index) {
|
|
8
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
9
|
+
key: index,
|
|
10
|
+
onPress: item.onPress
|
|
11
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
12
|
+
style: [styles.option, index === 0 && styles.firstOption]
|
|
13
|
+
}, _.isEmpty(item.text) && item.content ? item.content : /*#__PURE__*/React.createElement(Text, {
|
|
14
|
+
style: styles.optionText
|
|
15
|
+
}, item.text)));
|
|
16
|
+
}
|
|
17
|
+
renderOptions() {
|
|
18
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: styles.optionsContainer
|
|
20
|
+
}, _.map(this.props.options, (item, index) => {
|
|
21
|
+
return this.renderOption(item, index);
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
renderTitle() {
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: styles.titleContainer
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
style: styles.titleText
|
|
29
|
+
}, this.props.title));
|
|
30
|
+
}
|
|
31
|
+
renderCancel() {
|
|
32
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
33
|
+
onPress: this.props.onClose
|
|
34
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: [styles.option, styles.cancelOption]
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
37
|
+
style: [styles.optionText, styles.cancelText, {
|
|
38
|
+
color: this.props.colourBrandingMain
|
|
39
|
+
}]
|
|
40
|
+
}, this.props.cancelText)));
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
44
|
+
visible: true,
|
|
45
|
+
transparent: true,
|
|
46
|
+
animationType: "slide",
|
|
47
|
+
onRequestClose: this.props.onClose
|
|
48
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
49
|
+
style: styles.container,
|
|
50
|
+
onPress: this.props.onClose
|
|
51
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.container
|
|
53
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
54
|
+
style: styles.menu
|
|
55
|
+
}, this.renderTitle(), this.renderOptions(), this.renderCancel()))));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const styles = {
|
|
59
|
+
container: {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
right: 0,
|
|
64
|
+
top: 0,
|
|
65
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
66
|
+
zIndex: 1000
|
|
67
|
+
},
|
|
68
|
+
menu: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
bottom: 0,
|
|
71
|
+
left: 0,
|
|
72
|
+
right: 0,
|
|
73
|
+
backgroundColor: '#fff',
|
|
74
|
+
borderTopLeftRadius: 12,
|
|
75
|
+
borderTopRightRadius: 12
|
|
76
|
+
},
|
|
77
|
+
optionsContainer: {
|
|
78
|
+
paddingHorizontal: 16
|
|
79
|
+
},
|
|
80
|
+
option: {
|
|
81
|
+
paddingVertical: 16,
|
|
82
|
+
borderColor: LINEGREY,
|
|
83
|
+
borderTopWidth: 1
|
|
84
|
+
},
|
|
85
|
+
cancelOption: {
|
|
86
|
+
paddingHorizontal: 16
|
|
87
|
+
},
|
|
88
|
+
firstOption: {
|
|
89
|
+
borderTopWidth: 0
|
|
90
|
+
},
|
|
91
|
+
optionText: {
|
|
92
|
+
fontFamily: 'sf-regular',
|
|
93
|
+
fontSize: 16,
|
|
94
|
+
textAlign: 'center',
|
|
95
|
+
color: TEXT_DARK
|
|
96
|
+
},
|
|
97
|
+
cancelText: {
|
|
98
|
+
fontFamily: 'sf-medium'
|
|
99
|
+
},
|
|
100
|
+
titleContainer: {
|
|
101
|
+
padding: 16,
|
|
102
|
+
borderColor: LINEGREY,
|
|
103
|
+
borderBottomWidth: 1
|
|
104
|
+
},
|
|
105
|
+
titleText: {
|
|
106
|
+
fontFamily: 'sf-semibold',
|
|
107
|
+
fontSize: 16,
|
|
108
|
+
textAlign: 'center',
|
|
109
|
+
color: TEXT_DARK
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const mapStateToProps = state => {
|
|
113
|
+
return {
|
|
114
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const popupMenu = connect(mapStateToProps, {})(PopupMenu);
|
|
118
|
+
export { popupMenu as PopupMenu };
|
|
119
|
+
//# sourceMappingURL=PopupMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","TouchableWithoutFeedback","TouchableOpacity","Modal","connect","_","getMainBrandingColourFromState","LINEGREY","TEXT_DARK","PopupMenu","renderOption","item","index","createElement","key","onPress","style","styles","option","firstOption","isEmpty","text","content","optionText","renderOptions","optionsContainer","map","props","options","renderTitle","titleContainer","titleText","title","renderCancel","onClose","cancelOption","cancelText","color","colourBrandingMain","render","visible","transparent","animationType","onRequestClose","container","menu","position","bottom","left","right","top","backgroundColor","zIndex","borderTopLeftRadius","borderTopRightRadius","paddingHorizontal","paddingVertical","borderColor","borderTopWidth","fontFamily","fontSize","textAlign","padding","borderBottomWidth","mapStateToProps","state","popupMenu"],"sources":["PopupMenu.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, TouchableWithoutFeedback, TouchableOpacity, Modal } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { getMainBrandingColourFromState, LINEGREY, TEXT_DARK } from '../colours';\n\nclass PopupMenu extends Component {\n renderOption(item, index) {\n return (\n <TouchableOpacity key={index} onPress={item.onPress}>\n <View style={[styles.option, index === 0 && styles.firstOption]}>\n {_.isEmpty(item.text) && item.content ? item.content : <Text style={styles.optionText}>{item.text}</Text>}\n </View>\n </TouchableOpacity>\n );\n }\n\n renderOptions() {\n return (\n <View style={styles.optionsContainer}>\n {_.map(this.props.options, (item, index) => {\n return this.renderOption(item, index);\n })}\n </View>\n );\n }\n\n renderTitle() {\n return (\n <View style={styles.titleContainer}>\n <Text style={styles.titleText}>{this.props.title}</Text>\n </View>\n );\n }\n\n renderCancel() {\n return (\n <TouchableOpacity onPress={this.props.onClose}>\n <View style={[styles.option, styles.cancelOption]}>\n <Text style={[styles.optionText, styles.cancelText, { color: this.props.colourBrandingMain }]}>{this.props.cancelText}</Text>\n </View>\n </TouchableOpacity>\n );\n }\n\n render() {\n return (\n <Modal visible transparent animationType=\"slide\" onRequestClose={this.props.onClose}>\n <TouchableWithoutFeedback style={styles.container} onPress={this.props.onClose}>\n <View style={styles.container}>\n <View style={styles.menu}>\n {this.renderTitle()}\n {this.renderOptions()}\n {this.renderCancel()}\n </View>\n </View>\n </TouchableWithoutFeedback>\n </Modal>\n );\n }\n}\n\nconst styles = {\n container: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n zIndex: 1000,\n },\n menu: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: '#fff',\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n },\n optionsContainer: {\n paddingHorizontal: 16,\n },\n option: {\n paddingVertical: 16,\n borderColor: LINEGREY,\n borderTopWidth: 1,\n },\n cancelOption: {\n paddingHorizontal: 16,\n },\n firstOption: {\n borderTopWidth: 0,\n },\n optionText: {\n fontFamily: 'sf-regular',\n fontSize: 16,\n textAlign: 'center',\n color: TEXT_DARK,\n },\n cancelText: {\n fontFamily: 'sf-medium',\n },\n titleContainer: {\n padding: 16,\n borderColor: LINEGREY,\n borderBottomWidth: 1,\n },\n titleText: {\n fontFamily: 'sf-semibold',\n fontSize: 16,\n textAlign: 'center',\n color: TEXT_DARK,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst popupMenu = connect(mapStateToProps, {})(PopupMenu);\nexport { popupMenu as PopupMenu };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;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AMC,SAAS,GAAG9D,OAAO,CAAC4D,eAAe,EAAE,CAAC,CAAC,CAAC,CAACvD,SAAS,CAAC;AACzD,SAASyD,SAAS,IAAIzD,SAAS"}
|
|
@@ -0,0 +1,313 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
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); }
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import { View, Animated, PanResponder, Image, StyleSheet } from 'react-native';
|
|
7
|
+
import { Icon } from 'react-native-elements';
|
|
8
|
+
import { BOXGREY, TEXT_LIGHT } from '../colours';
|
|
9
|
+
class PositionedImage extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
_defineProperty(this, "calculateDimensions", () => {
|
|
13
|
+
Image.getSize(this.props.source.uri, (imageWidth, imageHeight) => {
|
|
14
|
+
// Default vertical positioning
|
|
15
|
+
const newWidth = this.props.width;
|
|
16
|
+
const newHeight = imageHeight * (this.props.width / imageWidth);
|
|
17
|
+
if (newHeight < this.props.height) {
|
|
18
|
+
// If vertical positioning isn't possible, enable horizontal positioning
|
|
19
|
+
this.setState({
|
|
20
|
+
imageWidth: imageWidth * (this.props.height / imageHeight),
|
|
21
|
+
imageHeight: this.props.height,
|
|
22
|
+
isVertical: false,
|
|
23
|
+
showGuide: this.props.onPositionEnd ? true : false
|
|
24
|
+
}, this.onDimensionAvailable);
|
|
25
|
+
} else {
|
|
26
|
+
this.setState({
|
|
27
|
+
imageWidth: newWidth,
|
|
28
|
+
imageHeight: newHeight,
|
|
29
|
+
isVertical: true,
|
|
30
|
+
showGuide: this.props.onPositionEnd ? true : false
|
|
31
|
+
}, this.onDimensionAvailable);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
_defineProperty(this, "onDimensionAvailable", () => {
|
|
36
|
+
const {
|
|
37
|
+
offset
|
|
38
|
+
} = this.props;
|
|
39
|
+
const {
|
|
40
|
+
imageWidth,
|
|
41
|
+
imageHeight,
|
|
42
|
+
isVertical
|
|
43
|
+
} = this.state;
|
|
44
|
+
if (offset) {
|
|
45
|
+
// Apply percentage offset
|
|
46
|
+
const actual = {
|
|
47
|
+
x: offset.x * imageWidth,
|
|
48
|
+
y: offset.y * imageHeight
|
|
49
|
+
};
|
|
50
|
+
this.imagePosition.setValue(actual);
|
|
51
|
+
} else {
|
|
52
|
+
// Centered by default
|
|
53
|
+
this.imagePosition.setValue({
|
|
54
|
+
x: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,
|
|
55
|
+
y: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (this.props.onPositionEnd) {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
Animated.timing(this.state.animatedOpacity, {
|
|
61
|
+
toValue: 0,
|
|
62
|
+
duration: 900,
|
|
63
|
+
useNativeDriver: false
|
|
64
|
+
}).start(() => {
|
|
65
|
+
this.setState({
|
|
66
|
+
showGuide: false
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}, 1000);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
this.lastPos = {
|
|
73
|
+
x: 0,
|
|
74
|
+
y: 0
|
|
75
|
+
};
|
|
76
|
+
this.imagePosition = new Animated.ValueXY(this.lastPos);
|
|
77
|
+
this.imagePosition.addListener(value => {
|
|
78
|
+
this.lastPos = value;
|
|
79
|
+
});
|
|
80
|
+
const imagePanResponder = PanResponder.create({
|
|
81
|
+
onStartShouldSetPanResponder: () => {
|
|
82
|
+
this.startPos = this.lastPos;
|
|
83
|
+
if (this.props.onPositionEnd) {
|
|
84
|
+
if (this.props.onPositionStart) this.props.onPositionStart();
|
|
85
|
+
this.setState({
|
|
86
|
+
panning: true
|
|
87
|
+
});
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
},
|
|
92
|
+
onPanResponderMove: (event, gesture) => {
|
|
93
|
+
const newPos = this.state.isVertical ? {
|
|
94
|
+
x: 0,
|
|
95
|
+
y: this.startPos.y + gesture.dy
|
|
96
|
+
} : {
|
|
97
|
+
x: this.startPos.x + gesture.dx,
|
|
98
|
+
y: 0
|
|
99
|
+
};
|
|
100
|
+
this.imagePosition.setValue(newPos);
|
|
101
|
+
},
|
|
102
|
+
onPanResponderTerminationRequest: (event, gesture) => true,
|
|
103
|
+
onPanResponderRelease: (event, gesture) => {
|
|
104
|
+
let endPos = {
|
|
105
|
+
x: 0,
|
|
106
|
+
y: 0
|
|
107
|
+
};
|
|
108
|
+
if (this.state.isVertical) {
|
|
109
|
+
const endY = this.startPos.y + gesture.dy;
|
|
110
|
+
const limitY = this.props.height - this.state.imageHeight;
|
|
111
|
+
if (endY > 0) {
|
|
112
|
+
// console.log('top reached', endY);
|
|
113
|
+
endPos = {
|
|
114
|
+
x: 0,
|
|
115
|
+
y: 0
|
|
116
|
+
};
|
|
117
|
+
} else if (endY < limitY) {
|
|
118
|
+
// console.log('bottom reached', endY, limitY);
|
|
119
|
+
endPos = {
|
|
120
|
+
x: 0,
|
|
121
|
+
y: limitY
|
|
122
|
+
};
|
|
123
|
+
} else {
|
|
124
|
+
endPos = {
|
|
125
|
+
x: 0,
|
|
126
|
+
y: endY
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
const endX = this.startPos.x + gesture.dx;
|
|
131
|
+
const limitX = this.props.width - this.state.imageWidth;
|
|
132
|
+
if (endX > 0) {
|
|
133
|
+
// console.log('left reached', endX);
|
|
134
|
+
endPos = {
|
|
135
|
+
x: 0,
|
|
136
|
+
y: 0
|
|
137
|
+
};
|
|
138
|
+
} else if (endX < limitX) {
|
|
139
|
+
// console.log('right reached', endX, limitX);
|
|
140
|
+
endPos = {
|
|
141
|
+
x: limitX,
|
|
142
|
+
y: 0
|
|
143
|
+
};
|
|
144
|
+
} else {
|
|
145
|
+
endPos = {
|
|
146
|
+
x: endX,
|
|
147
|
+
y: 0
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
Animated.spring(this.imagePosition, {
|
|
152
|
+
toValue: endPos,
|
|
153
|
+
useNativeDriver: false
|
|
154
|
+
}).start();
|
|
155
|
+
if (this.props.onPositionEnd) this.props.onPositionEnd({
|
|
156
|
+
x: endPos.x / this.state.imageWidth,
|
|
157
|
+
y: endPos.y / this.state.imageHeight
|
|
158
|
+
});
|
|
159
|
+
this.setState({
|
|
160
|
+
panning: false
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
onPanResponderTerminate: (event, gesture) => {
|
|
164
|
+
this.setState({
|
|
165
|
+
panning: false
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
this.state = {
|
|
170
|
+
imageWidth: 0,
|
|
171
|
+
imageHeight: 0,
|
|
172
|
+
imagePanResponder,
|
|
173
|
+
isVertical: true,
|
|
174
|
+
showGuide: false,
|
|
175
|
+
animatedOpacity: new Animated.Value(1),
|
|
176
|
+
panning: false
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
componentDidMount() {
|
|
180
|
+
this.calculateDimensions();
|
|
181
|
+
}
|
|
182
|
+
componentDidUpdate(prevProps) {
|
|
183
|
+
if (prevProps.source.uri !== this.props.source.uri) {
|
|
184
|
+
// console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);
|
|
185
|
+
this.calculateDimensions();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
renderGrid() {
|
|
189
|
+
if (!this.state.panning) return null;
|
|
190
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
191
|
+
style: styles.gridContainer
|
|
192
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
193
|
+
style: styles.gridHorizontal
|
|
194
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
195
|
+
style: styles.gridVertical
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
renderGuide() {
|
|
199
|
+
if (!this.state.showGuide) return null;
|
|
200
|
+
const {
|
|
201
|
+
animatedOpacity,
|
|
202
|
+
isVertical
|
|
203
|
+
} = this.state;
|
|
204
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
205
|
+
style: [styles.guideContainer, {
|
|
206
|
+
opacity: animatedOpacity
|
|
207
|
+
}]
|
|
208
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
209
|
+
style: [styles.guideIconContainer, {
|
|
210
|
+
flexDirection: 'column'
|
|
211
|
+
}]
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
213
|
+
name: "arrow-up",
|
|
214
|
+
type: "font-awesome",
|
|
215
|
+
iconStyle: [styles.guideIcon, !isVertical && styles.guideIconDisabled]
|
|
216
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
217
|
+
name: "arrow-down",
|
|
218
|
+
type: "font-awesome",
|
|
219
|
+
iconStyle: [styles.guideIcon, !isVertical && styles.guideIconDisabled]
|
|
220
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
221
|
+
style: [styles.guideIconContainer, {
|
|
222
|
+
flexDirection: 'row'
|
|
223
|
+
}]
|
|
224
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
225
|
+
name: "arrow-left",
|
|
226
|
+
type: "font-awesome",
|
|
227
|
+
iconStyle: [styles.guideIcon, isVertical && styles.guideIconDisabled]
|
|
228
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
229
|
+
name: "arrow-right",
|
|
230
|
+
type: "font-awesome",
|
|
231
|
+
iconStyle: [styles.guideIcon, isVertical && styles.guideIconDisabled]
|
|
232
|
+
})));
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
const {
|
|
236
|
+
imageWidth,
|
|
237
|
+
imageHeight,
|
|
238
|
+
imagePanResponder
|
|
239
|
+
} = this.state;
|
|
240
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
241
|
+
style: [styles.container, {
|
|
242
|
+
width: this.props.width,
|
|
243
|
+
height: this.props.height
|
|
244
|
+
}, this.props.style]
|
|
245
|
+
}, /*#__PURE__*/React.createElement(Animated.Image, _extends({
|
|
246
|
+
source: this.props.source,
|
|
247
|
+
style: [{
|
|
248
|
+
width: imageWidth,
|
|
249
|
+
height: imageHeight
|
|
250
|
+
}, this.imagePosition.getLayout()]
|
|
251
|
+
}, imagePanResponder.panHandlers)), this.renderGrid(), this.renderGuide());
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const styles = StyleSheet.create({
|
|
255
|
+
container: {
|
|
256
|
+
overflow: 'hidden',
|
|
257
|
+
backgroundColor: BOXGREY
|
|
258
|
+
},
|
|
259
|
+
guideContainer: {
|
|
260
|
+
position: 'absolute',
|
|
261
|
+
top: 0,
|
|
262
|
+
right: 0,
|
|
263
|
+
bottom: 0,
|
|
264
|
+
left: 0,
|
|
265
|
+
alignItems: 'center',
|
|
266
|
+
justifyContent: 'center',
|
|
267
|
+
backgroundColor: '#0006'
|
|
268
|
+
},
|
|
269
|
+
guideIconContainer: {
|
|
270
|
+
position: 'absolute',
|
|
271
|
+
top: 0,
|
|
272
|
+
right: 0,
|
|
273
|
+
bottom: 0,
|
|
274
|
+
left: 0,
|
|
275
|
+
alignItems: 'center',
|
|
276
|
+
justifyContent: 'center'
|
|
277
|
+
},
|
|
278
|
+
guideIcon: {
|
|
279
|
+
color: '#fff',
|
|
280
|
+
fontSize: 50,
|
|
281
|
+
margin: 15
|
|
282
|
+
},
|
|
283
|
+
guideIconDisabled: {
|
|
284
|
+
color: TEXT_LIGHT
|
|
285
|
+
},
|
|
286
|
+
gridContainer: {
|
|
287
|
+
position: 'absolute',
|
|
288
|
+
top: 0,
|
|
289
|
+
right: 0,
|
|
290
|
+
bottom: 0,
|
|
291
|
+
left: 0
|
|
292
|
+
},
|
|
293
|
+
gridHorizontal: {
|
|
294
|
+
position: 'absolute',
|
|
295
|
+
top: 0,
|
|
296
|
+
right: 0,
|
|
297
|
+
left: 0,
|
|
298
|
+
height: '50%',
|
|
299
|
+
borderBottomWidth: 1,
|
|
300
|
+
borderBottomColor: BOXGREY
|
|
301
|
+
},
|
|
302
|
+
gridVertical: {
|
|
303
|
+
position: 'absolute',
|
|
304
|
+
top: 0,
|
|
305
|
+
right: 0,
|
|
306
|
+
bottom: 0,
|
|
307
|
+
width: '50%',
|
|
308
|
+
borderLeftWidth: 1,
|
|
309
|
+
borderLeftColor: BOXGREY
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
export default PositionedImage;
|
|
313
|
+
//# sourceMappingURL=PositionedImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Animated","PanResponder","Image","StyleSheet","Icon","BOXGREY","TEXT_LIGHT","PositionedImage","constructor","props","_defineProperty","getSize","source","uri","imageWidth","imageHeight","newWidth","width","newHeight","height","setState","isVertical","showGuide","onPositionEnd","onDimensionAvailable","offset","state","actual","x","y","imagePosition","setValue","setTimeout","timing","animatedOpacity","toValue","duration","useNativeDriver","start","lastPos","ValueXY","addListener","value","imagePanResponder","create","onStartShouldSetPanResponder","startPos","onPositionStart","panning","onPanResponderMove","event","gesture","newPos","dy","dx","onPanResponderTerminationRequest","onPanResponderRelease","endPos","endY","limitY","endX","limitX","spring","onPanResponderTerminate","Value","componentDidMount","calculateDimensions","componentDidUpdate","prevProps","renderGrid","createElement","style","styles","gridContainer","gridHorizontal","gridVertical","renderGuide","guideContainer","opacity","guideIconContainer","flexDirection","name","type","iconStyle","guideIcon","guideIconDisabled","render","container","_extends","getLayout","panHandlers","overflow","backgroundColor","position","top","right","bottom","left","alignItems","justifyContent","color","fontSize","margin","borderBottomWidth","borderBottomColor","borderLeftWidth","borderLeftColor"],"sources":["PositionedImage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Animated, PanResponder, Image, StyleSheet } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport { BOXGREY, TEXT_LIGHT } from '../colours';\n\nclass PositionedImage extends Component {\n constructor(props) {\n super(props);\n\n this.lastPos = { x: 0, y: 0 };\n this.imagePosition = new Animated.ValueXY(this.lastPos);\n this.imagePosition.addListener(value => {\n this.lastPos = value;\n });\n const imagePanResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => {\n this.startPos = this.lastPos;\n if (this.props.onPositionEnd) {\n if (this.props.onPositionStart) this.props.onPositionStart();\n this.setState({ panning: true });\n return true;\n }\n return false;\n },\n onPanResponderMove: (event, gesture) => {\n const newPos = this.state.isVertical ? { x: 0, y: this.startPos.y + gesture.dy } : { x: this.startPos.x + gesture.dx, y: 0 };\n this.imagePosition.setValue(newPos);\n },\n onPanResponderTerminationRequest: (event, gesture) => true,\n onPanResponderRelease: (event, gesture) => {\n let endPos = { x: 0, y: 0 };\n if (this.state.isVertical) {\n const endY = this.startPos.y + gesture.dy;\n const limitY = this.props.height - this.state.imageHeight;\n if (endY > 0) {\n // console.log('top reached', endY);\n endPos = { x: 0, y: 0 };\n } else if (endY < limitY) {\n // console.log('bottom reached', endY, limitY);\n endPos = { x: 0, y: limitY };\n } else {\n endPos = { x: 0, y: endY };\n }\n } else {\n const endX = this.startPos.x + gesture.dx;\n const limitX = this.props.width - this.state.imageWidth;\n if (endX > 0) {\n // console.log('left reached', endX);\n endPos = { x: 0, y: 0 };\n } else if (endX < limitX) {\n // console.log('right reached', endX, limitX);\n endPos = { x: limitX, y: 0 };\n } else {\n endPos = { x: endX, y: 0 };\n }\n }\n Animated.spring(this.imagePosition, { toValue: endPos, useNativeDriver: false }).start();\n\n if (this.props.onPositionEnd)\n this.props.onPositionEnd({\n x: endPos.x / this.state.imageWidth,\n y: endPos.y / this.state.imageHeight,\n });\n\n this.setState({ panning: false });\n },\n onPanResponderTerminate: (event, gesture) => {\n this.setState({ panning: false });\n },\n });\n\n this.state = {\n imageWidth: 0,\n imageHeight: 0,\n imagePanResponder,\n isVertical: true,\n showGuide: false,\n animatedOpacity: new Animated.Value(1),\n panning: false,\n };\n }\n\n componentDidMount() {\n this.calculateDimensions();\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.source.uri !== this.props.source.uri) {\n // console.log('componentDidUpdate', prevProps.source.uri, this.props.source.uri);\n this.calculateDimensions();\n }\n }\n\n calculateDimensions = () => {\n Image.getSize(this.props.source.uri, (imageWidth, imageHeight) => {\n // Default vertical positioning\n const newWidth = this.props.width;\n const newHeight = imageHeight * (this.props.width / imageWidth);\n\n if (newHeight < this.props.height) {\n // If vertical positioning isn't possible, enable horizontal positioning\n this.setState(\n {\n imageWidth: imageWidth * (this.props.height / imageHeight),\n imageHeight: this.props.height,\n isVertical: false,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n } else {\n this.setState(\n {\n imageWidth: newWidth,\n imageHeight: newHeight,\n isVertical: true,\n showGuide: this.props.onPositionEnd ? true : false,\n },\n this.onDimensionAvailable,\n );\n }\n });\n };\n\n onDimensionAvailable = () => {\n const { offset } = this.props;\n const { imageWidth, imageHeight, isVertical } = this.state;\n\n if (offset) {\n // Apply percentage offset\n const actual = {\n x: offset.x * imageWidth,\n y: offset.y * imageHeight,\n };\n this.imagePosition.setValue(actual);\n } else {\n // Centered by default\n this.imagePosition.setValue({\n x: isVertical ? 0 : -0.5 * imageWidth + 0.5 * this.props.width,\n y: isVertical ? -0.5 * imageHeight + 0.5 * this.props.height : 0,\n });\n }\n\n if (this.props.onPositionEnd) {\n setTimeout(() => {\n Animated.timing(this.state.animatedOpacity, {\n toValue: 0,\n duration: 900,\n useNativeDriver: false,\n }).start(() => {\n this.setState({ showGuide: false });\n });\n }, 1000);\n }\n };\n\n renderGrid() {\n if (!this.state.panning) return null;\n return (\n <View style={styles.gridContainer}>\n <View style={styles.gridHorizontal} />\n <View style={styles.gridVertical} />\n </View>\n );\n }\n\n renderGuide() {\n if (!this.state.showGuide) return null;\n const { animatedOpacity, isVertical } = this.state;\n return (\n <Animated.View style={[styles.guideContainer, { opacity: animatedOpacity }]}>\n <View style={[styles.guideIconContainer, { flexDirection: 'column' }]}>\n <Icon name=\"arrow-up\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-down\" type=\"font-awesome\" iconStyle={[styles.guideIcon, !isVertical && styles.guideIconDisabled]} />\n </View>\n <View style={[styles.guideIconContainer, { flexDirection: 'row' }]}>\n <Icon name=\"arrow-left\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n <Icon name=\"arrow-right\" type=\"font-awesome\" iconStyle={[styles.guideIcon, isVertical && styles.guideIconDisabled]} />\n </View>\n </Animated.View>\n );\n }\n\n render() {\n const { imageWidth, imageHeight, imagePanResponder } = this.state;\n\n return (\n <View style={[styles.container, { width: this.props.width, height: this.props.height }, this.props.style]}>\n <Animated.Image\n source={this.props.source}\n style={[{ width: imageWidth, height: imageHeight }, this.imagePosition.getLayout()]}\n {...imagePanResponder.panHandlers}\n />\n {this.renderGrid()}\n {this.renderGuide()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n backgroundColor: BOXGREY,\n },\n guideContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#0006',\n },\n guideIconContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n alignItems: 'center',\n justifyContent: 'center',\n },\n guideIcon: {\n color: '#fff',\n fontSize: 50,\n margin: 15,\n },\n guideIconDisabled: {\n color: TEXT_LIGHT,\n },\n gridContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n gridHorizontal: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n height: '50%',\n borderBottomWidth: 1,\n borderBottomColor: BOXGREY,\n },\n gridVertical: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n width: '50%',\n borderLeftWidth: 1,\n borderLeftColor: BOXGREY,\n },\n});\n\nexport default PositionedImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,UAAU,QAAQ,cAAc;AAC9E,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,EAAEC,UAAU,QAAQ,YAAY;AAEhD,MAAMC,eAAe,SAAST,SAAS,CAAC;EACtCU,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,8BAsFO,MAAM;MAC1BR,KAAK,CAACS,OAAO,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,GAAG,EAAE,CAACC,UAAU,EAAEC,WAAW,KAAK;QAChE;QACA,MAAMC,QAAQ,GAAG,IAAI,CAACP,KAAK,CAACQ,KAAK;QACjC,MAAMC,SAAS,GAAGH,WAAW,IAAI,IAAI,CAACN,KAAK,CAACQ,KAAK,GAAGH,UAAU,CAAC;QAE/D,IAAII,SAAS,GAAG,IAAI,CAACT,KAAK,CAACU,MAAM,EAAE;UACjC;UACA,IAAI,CAACC,QAAQ,CACX;YACEN,UAAU,EAAEA,UA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E;EACR,CAAC;EACDvB,cAAc,EAAE;IACdmB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRE,IAAI,EAAE,CAAC;IACP9E,MAAM,EAAE,KAAK;IACboF,iBAAiB,EAAE,CAAC;IACpBC,iBAAiB,EAAEnG;EACrB,CAAC;EACDsE,YAAY,EAAE;IACZkB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT/E,KAAK,EAAE,KAAK;IACZwF,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAErG;EACnB;AACF,CAAC,CAAC;AAEF,eAAeE,eAAe"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
|
|
89
|
+
profilePicImage: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
height: null,
|
|
92
|
+
width: null
|
|
93
|
+
},
|
|
94
|
+
bordered: {
|
|
95
|
+
borderWidth: 1,
|
|
96
|
+
borderColor: '#fff'
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const mapStateToProps = state => {
|
|
100
|
+
return {
|
|
101
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const profilePic = connect(mapStateToProps, {})(ProfilePic);
|
|
105
|
+
export { profilePic as ProfilePic };
|
|
106
|
+
//# 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 constructor(props) {\n super(props);\n this.state = {\n image: null,\n imageBorderRadius: 18,\n imageUploading: false,\n backgroundFill: false,\n };\n }\n\n UNSAFE_componentWillMount() {\n this.setState({\n image: this.props.ProfilePic != null ? this.props.ProfilePic : Config.env.defaultProfileImage,\n imageDiameterStyle: {\n height: this.props.Diameter != null ? this.props.Diameter : 35,\n width: this.props.Diameter != null ? this.props.Diameter : 35,\n },\n imageBorderRadius: this.props.Diameter != null ? this.props.Diameter / 2 : 18,\n imageUploading: this.props.ImageUploading,\n backgroundFill: this.props.ProfilePic === Config.env.tinyChatDefault,\n });\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n let profPic = null;\n if (nextProps.ProfilePic) {\n profPic = nextProps.ProfilePic;\n }\n\n this.setState({\n image: profPic,\n imageUploading: nextProps.ImageUploading,\n });\n }\n\n renderImage() {\n if (this.state.imageUploading) {\n return (\n <Spinner\n style={{\n backgroundColor: 'white',\n borderRadius: this.state.imageBorderRadius,\n }}\n />\n );\n }\n let image = Config.env.defaultProfileImage;\n let isDefault = true;\n if (this.state.image !== null && typeof this.state.image === 'string') {\n if (\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' &&\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/23046-1/636675694526742825882defaultavatar.jpg' &&\n this.state.image !== 'https://plusscdn.azureedge.net/uploads/687-1/63663744750845828739defaultavatar.jpg' &&\n this.state.image !==\n 'https://pluss60-dev-uploads.s3.ap-southeast-2.amazonaws.com/uploads/users/ap-southeast-2:e2dc6a8b-61e8-4a76-a7ea-b1a15a013b94/public/2b3df48c4394a03840e52db886/profilepic.jpg'\n ) {\n image = { uri: this.state.image };\n isDefault = false;\n }\n }\n return (\n <ImageBackground\n key=\"default\"\n source={image}\n style={[\n styles.profilePicImage,\n { borderRadius: this.state.imageBorderRadius },\n (isDefault || this.state.backgroundFill) && { backgroundColor: this.props.colourBrandingMain },\n ]}\n imageStyle={{ borderRadius: this.state.imageBorderRadius }}\n >\n {this.props.children}\n </ImageBackground>\n );\n }\n\n render() {\n return (\n <View\n style={[\n styles.profilePicOuter,\n this.state.imageDiameterStyle,\n this.props.bordered && styles.bordered,\n { borderRadius: this.state.imageBorderRadius },\n this.props.style,\n ]}\n key={this.props.id}\n >\n {this.renderImage()}\n </View>\n );\n }\n}\n\nconst styles = {\n profilePicOuter: {\n height: 35,\n width: 35,\n zIndex: 1,\n backgroundColor: LINEGREY,\n // overflow: 'hidden'\n },\n profilePicImage: {\n flex: 1,\n height: null,\n width: null,\n },\n bordered: {\n borderWidth: 1,\n borderColor: '#fff',\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst profilePic = connect(mapStateToProps, {})(ProfilePic);\nexport { profilePic as ProfilePic };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,eAAe,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,EAAEC,8BAA8B,QAAQ,YAAY;AAErE,MAAMC,UAAU,SAASR,SAAS,CAAC;EACjCS,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IACZ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