@plusscommunities/pluss-core-app 1.4.9 → 1.5.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 +20 -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 +214 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/index.js +5 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +14 -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 +163 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +96 -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 +11 -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 +78 -0
- package/dist/module/apis/reactionActions.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/{assets → dist/module/assets}/icons/reactions/heart.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/party.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/sad.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +149 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +45 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/Attachment.js +59 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +70 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +376 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/BackButton.js +62 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +171 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +363 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +785 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +85 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +77 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DropDownItem.js +82 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +46 -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 +52 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +37 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +77 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/FormCard.js +28 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +240 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +77 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +145 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +161 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +174 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +491 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/ImagePopup.js +257 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +72 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +850 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +72 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +164 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +224 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +95 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +51 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +440 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +46 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +188 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +997 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +204 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +66 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +138 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +128 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +333 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +119 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +84 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +129 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +84 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +162 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +25 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +37 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/TextStyle.js +34 -0
- package/dist/module/components/TextStyle.js.map +1 -0
- package/dist/module/components/Toggle.js +70 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +73 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +146 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +291 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +123 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +87 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +325 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +123 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +53 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +416 -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 +405 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +27 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +16 -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 +436 -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/session.js +54 -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 +22 -5
- package/src/assets/icons/reactions/heart.png +0 -0
- package/src/assets/icons/reactions/party.png +0 -0
- package/src/assets/icons/reactions/sad.png +0 -0
- package/src/assets/icons/reactions/smile.png +0 -0
- package/src/components/CommentReply.js +0 -2
- package/src/constants.js +4 -4
- package/src/helper.js +4 -4
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import { Dimensions, Modal, TouchableOpacity, StyleSheet, View, ImageBackground, Text } from 'react-native';
|
|
7
|
+
import ImageViewer from 'react-native-image-zoom-viewer';
|
|
8
|
+
import { Icon } from 'react-native-elements';
|
|
9
|
+
import { TEXT_DARK } from '../colours';
|
|
10
|
+
import { StatusBarHeight, isVideo, get1400 } from '../helper';
|
|
11
|
+
import { Pl60Icon } from '../fonts';
|
|
12
|
+
import { SharingTools } from './SharingTools';
|
|
13
|
+
import { VideoPopup } from './VideoPopup';
|
|
14
|
+
import { ProfilePic } from './ProfilePic';
|
|
15
|
+
const SCREEN_WIDTH = Dimensions.get('window').width;
|
|
16
|
+
const SCREEN_HEIGHT = Dimensions.get('window').height;
|
|
17
|
+
|
|
18
|
+
class ImagePopup extends Component {
|
|
19
|
+
constructor(_props) {
|
|
20
|
+
super(_props);
|
|
21
|
+
|
|
22
|
+
_defineProperty(this, "setupUrls", () => {
|
|
23
|
+
if (!this.props.images) return;
|
|
24
|
+
const images = this.props.images.map(image => {
|
|
25
|
+
if (typeof image === 'string') {
|
|
26
|
+
return {
|
|
27
|
+
url: get1400(image),
|
|
28
|
+
original: image,
|
|
29
|
+
isVideo: isVideo(image)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
url: get1400(image === null || image === void 0 ? void 0 : image.uri),
|
|
35
|
+
original: image === null || image === void 0 ? void 0 : image.uri,
|
|
36
|
+
isVideo: isVideo(image === null || image === void 0 ? void 0 : image.uri),
|
|
37
|
+
date: image === null || image === void 0 ? void 0 : image.date,
|
|
38
|
+
user: image === null || image === void 0 ? void 0 : image.user
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
this.setState({
|
|
42
|
+
images,
|
|
43
|
+
index: this.state.index || this.props.index || 0
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
_defineProperty(this, "onChange", index => {
|
|
48
|
+
this.setState({
|
|
49
|
+
index
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
_defineProperty(this, "toggleFullscreenVideo", url => {
|
|
54
|
+
if (typeof url !== 'string') url = '';
|
|
55
|
+
this.setState({
|
|
56
|
+
showFullscreenVideo: url.length > 0,
|
|
57
|
+
currentVideoUrl: url
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
_defineProperty(this, "renderImage", props => {
|
|
62
|
+
const media = this.state.images.find(image => image.url === props.source.uri);
|
|
63
|
+
const isVideo = !_.isNil(media) && media.isVideo;
|
|
64
|
+
let dateText, timeText;
|
|
65
|
+
|
|
66
|
+
if (!_.isNil(media.date)) {
|
|
67
|
+
const imageDate = moment(media.date);
|
|
68
|
+
dateText = imageDate.format('MMMM D, YYYY');
|
|
69
|
+
timeText = imageDate.format('hh:mm A');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(ImageBackground, props, isVideo && /*#__PURE__*/React.createElement(View, {
|
|
73
|
+
style: styles.videoOverlay
|
|
74
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
75
|
+
onPress: this.toggleFullscreenVideo.bind(this, media.original)
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
77
|
+
name: "play",
|
|
78
|
+
type: "font-awesome",
|
|
79
|
+
iconStyle: styles.videoPlayIcon
|
|
80
|
+
})))), (!_.isNil(media.user) || !_.isNil(media.date)) && /*#__PURE__*/React.createElement(View, {
|
|
81
|
+
style: styles.imageInfoContainer
|
|
82
|
+
}, /*#__PURE__*/React.createElement(ProfilePic, {
|
|
83
|
+
Diameter: 42,
|
|
84
|
+
ProfilePic: media.user.profilePic
|
|
85
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
style: styles.imageTextContainer
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
88
|
+
style: styles.imageTextName
|
|
89
|
+
}, media.user.displayName), /*#__PURE__*/React.createElement(Text, {
|
|
90
|
+
numberOfLines: 2,
|
|
91
|
+
style: styles.iamgeTextDate
|
|
92
|
+
}, `Uploaded ${dateText} • ${timeText}`))));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
this.state = {
|
|
96
|
+
index: 0,
|
|
97
|
+
images: [],
|
|
98
|
+
showFullscreenVideo: false,
|
|
99
|
+
currentVideoUrl: ''
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
componentDidMount() {
|
|
104
|
+
this.setupUrls();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
componentDidUpdate(prevProps) {
|
|
108
|
+
const {
|
|
109
|
+
visible,
|
|
110
|
+
index
|
|
111
|
+
} = this.props;
|
|
112
|
+
if (!prevProps.visible && visible) this.setupUrls();
|
|
113
|
+
if (prevProps.index !== index) this.setState({
|
|
114
|
+
index
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
scrollTo(index) {
|
|
119
|
+
this.setState({
|
|
120
|
+
index
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
renderClose() {
|
|
125
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
126
|
+
style: styles.menuIconContainer,
|
|
127
|
+
onPress: this.props.onClose,
|
|
128
|
+
activeOpacity: 0.6
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Pl60Icon, {
|
|
130
|
+
name: "close",
|
|
131
|
+
style: [styles.menuIcon]
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
renderVideoPlayerPopup() {
|
|
136
|
+
const {
|
|
137
|
+
showFullscreenVideo,
|
|
138
|
+
currentVideoUrl
|
|
139
|
+
} = this.state;
|
|
140
|
+
if (!currentVideoUrl) return;
|
|
141
|
+
return /*#__PURE__*/React.createElement(VideoPopup, {
|
|
142
|
+
uri: currentVideoUrl,
|
|
143
|
+
visible: showFullscreenVideo,
|
|
144
|
+
onClose: this.toggleFullscreenVideo
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
render() {
|
|
149
|
+
const {
|
|
150
|
+
visible,
|
|
151
|
+
onClose
|
|
152
|
+
} = this.props;
|
|
153
|
+
const {
|
|
154
|
+
index,
|
|
155
|
+
images
|
|
156
|
+
} = this.state;
|
|
157
|
+
|
|
158
|
+
if (_.isEmpty(images)) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
163
|
+
visible: visible,
|
|
164
|
+
animationType: "slide",
|
|
165
|
+
onRequestClose: onClose,
|
|
166
|
+
style: styles.modal
|
|
167
|
+
}, /*#__PURE__*/React.createElement(ImageViewer, {
|
|
168
|
+
style: styles.scrollable,
|
|
169
|
+
index: index,
|
|
170
|
+
onChange: this.onChange,
|
|
171
|
+
onSwipeDown: onClose,
|
|
172
|
+
enableSwipeDown: true,
|
|
173
|
+
imageUrls: images,
|
|
174
|
+
saveToLocalByLongPress: false,
|
|
175
|
+
renderImage: this.renderImage
|
|
176
|
+
}), this.renderClose(), /*#__PURE__*/React.createElement(SharingTools, {
|
|
177
|
+
uri: images[index].original
|
|
178
|
+
}), this.renderVideoPlayerPopup());
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const styles = StyleSheet.create({
|
|
184
|
+
modal: {
|
|
185
|
+
backgroundColor: '#000'
|
|
186
|
+
},
|
|
187
|
+
scrollable: {
|
|
188
|
+
width: SCREEN_WIDTH,
|
|
189
|
+
height: SCREEN_HEIGHT,
|
|
190
|
+
backgroundColor: '#000'
|
|
191
|
+
},
|
|
192
|
+
image: {
|
|
193
|
+
width: SCREEN_WIDTH,
|
|
194
|
+
height: SCREEN_HEIGHT,
|
|
195
|
+
backgroundColor: '#000'
|
|
196
|
+
},
|
|
197
|
+
menuIconContainer: {
|
|
198
|
+
position: 'absolute',
|
|
199
|
+
top: StatusBarHeight(0),
|
|
200
|
+
right: 0,
|
|
201
|
+
width: 55,
|
|
202
|
+
height: 55,
|
|
203
|
+
zIndex: 3
|
|
204
|
+
},
|
|
205
|
+
menuIcon: {
|
|
206
|
+
fontSize: 25,
|
|
207
|
+
padding: 15,
|
|
208
|
+
width: 55,
|
|
209
|
+
textAlign: 'center',
|
|
210
|
+
color: '#fff',
|
|
211
|
+
zIndex: 3
|
|
212
|
+
},
|
|
213
|
+
videoOverlay: {
|
|
214
|
+
position: 'absolute',
|
|
215
|
+
top: 0,
|
|
216
|
+
left: 0,
|
|
217
|
+
right: 0,
|
|
218
|
+
bottom: 0,
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
justifyContent: 'center'
|
|
221
|
+
},
|
|
222
|
+
videoPlayIcon: {
|
|
223
|
+
color: '#fff',
|
|
224
|
+
fontSize: 30,
|
|
225
|
+
textShadowColor: 'rgba(0,0,0,0.3)',
|
|
226
|
+
textShadowOffset: {
|
|
227
|
+
width: 2,
|
|
228
|
+
height: 2
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
imageInfoContainer: {
|
|
232
|
+
flexDirection: 'row',
|
|
233
|
+
paddingHorizontal: 12,
|
|
234
|
+
height: 70,
|
|
235
|
+
backgroundColor: '#fff',
|
|
236
|
+
alignItems: 'center'
|
|
237
|
+
},
|
|
238
|
+
imageTextContainer: {
|
|
239
|
+
marginLeft: 12,
|
|
240
|
+
flexDirection: 'column',
|
|
241
|
+
flex: 1,
|
|
242
|
+
height: 42,
|
|
243
|
+
justifyContent: 'space-around'
|
|
244
|
+
},
|
|
245
|
+
imageTextName: {
|
|
246
|
+
fontFamily: 'sf-semibold',
|
|
247
|
+
fontSize: 14,
|
|
248
|
+
color: TEXT_DARK
|
|
249
|
+
},
|
|
250
|
+
iamgeTextDate: {
|
|
251
|
+
fontFamily: 'sf-regular',
|
|
252
|
+
fontSize: 12,
|
|
253
|
+
color: TEXT_DARK
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
export { ImagePopup };
|
|
257
|
+
//# sourceMappingURL=ImagePopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ImagePopup.js"],"names":["React","Component","_","moment","Dimensions","Modal","TouchableOpacity","StyleSheet","View","ImageBackground","Text","ImageViewer","Icon","TEXT_DARK","StatusBarHeight","isVideo","get1400","Pl60Icon","SharingTools","VideoPopup","ProfilePic","SCREEN_WIDTH","get","width","SCREEN_HEIGHT","height","ImagePopup","constructor","props","images","map","image","url","original","uri","date","user","setState","index","state","showFullscreenVideo","length","currentVideoUrl","media","find","source","isNil","dateText","timeText","imageDate","format","styles","videoOverlay","toggleFullscreenVideo","bind","videoPlayIcon","imageInfoContainer","profilePic","imageTextContainer","imageTextName","displayName","iamgeTextDate","componentDidMount","setupUrls","componentDidUpdate","prevProps","visible","scrollTo","renderClose","menuIconContainer","onClose","menuIcon","renderVideoPlayerPopup","render","isEmpty","modal","scrollable","onChange","renderImage","create","backgroundColor","position","top","right","zIndex","fontSize","padding","textAlign","color","left","bottom","alignItems","justifyContent","textShadowColor","textShadowOffset","flexDirection","paddingHorizontal","marginLeft","flex","fontFamily"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,OAAOC,MAAP,MAAmB,QAAnB;AACA,SAASC,UAAT,EAAqBC,KAArB,EAA4BC,gBAA5B,EAA8CC,UAA9C,EAA0DC,IAA1D,EAAgEC,eAAhE,EAAiFC,IAAjF,QAA6F,cAA7F;AACA,OAAOC,WAAP,MAAwB,gCAAxB;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,SAAT,QAA0B,YAA1B;AACA,SAASC,eAAT,EAA0BC,OAA1B,EAAmCC,OAAnC,QAAkD,WAAlD;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,MAAMC,YAAY,GAAGjB,UAAU,CAACkB,GAAX,CAAe,QAAf,EAAyBC,KAA9C;AACA,MAAMC,aAAa,GAAGpB,UAAU,CAACkB,GAAX,CAAe,QAAf,EAAyBG,MAA/C;;AAEA,MAAMC,UAAN,SAAyBzB,SAAzB,CAAmC;AACjC0B,EAAAA,WAAW,CAACC,MAAD,EAAQ;AACjB,UAAMA,MAAN;;AADiB,uCAoBP,MAAM;AAChB,UA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ZO,IAAAA,MAAM,EAAE,CALI;AAMZC,IAAAA,UAAU,EAAE,QANA;AAOZC,IAAAA,cAAc,EAAE;AAPJ,GA9BiB;AAuC/BrC,EAAAA,aAAa,EAAE;AACbiC,IAAAA,KAAK,EAAE,MADM;AAEbH,IAAAA,QAAQ,EAAE,EAFG;AAGbQ,IAAAA,eAAe,EAAE,iBAHJ;AAIbC,IAAAA,gBAAgB,EAAE;AAAEvE,MAAAA,KAAK,EAAE,CAAT;AAAYE,MAAAA,MAAM,EAAE;AAApB;AAJL,GAvCgB;AA6C/B+B,EAAAA,kBAAkB,EAAE;AAClBuC,IAAAA,aAAa,EAAE,KADG;AAElBC,IAAAA,iBAAiB,EAAE,EAFD;AAGlBvE,IAAAA,MAAM,EAAE,EAHU;AAIlBuD,IAAAA,eAAe,EAAE,MAJC;AAKlBW,IAAAA,UAAU,EAAE;AALM,GA7CW;AAoD/BjC,EAAAA,kBAAkB,EAAE;AAClBuC,IAAAA,UAAU,EAAE,EADM;AAElBF,IAAAA,aAAa,EAAE,QAFG;AAGlBG,IAAAA,IAAI,EAAE,CAHY;AAIlBzE,IAAAA,MAAM,EAAE,EAJU;AAKlBmE,IAAAA,cAAc,EAAE;AALE,GApDW;AA2D/BjC,EAAAA,aAAa,EAAE;AACbwC,IAAAA,UAAU,EAAE,aADC;AAEbd,IAAAA,QAAQ,EAAE,EAFG;AAGbG,IAAAA,KAAK,EAAE3E;AAHM,GA3DgB;AAgE/BgD,EAAAA,aAAa,EAAE;AACbsC,IAAAA,UAAU,EAAE,YADC;AAEbd,IAAAA,QAAQ,EAAE,EAFG;AAGbG,IAAAA,KAAK,EAAE3E;AAHM;AAhEgB,CAAlB,CAAf;AAuEA,SAASa,UAAT","sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport { Dimensions, Modal, TouchableOpacity, StyleSheet, View, ImageBackground, Text } from 'react-native';\nimport ImageViewer from 'react-native-image-zoom-viewer';\nimport { Icon } from 'react-native-elements';\nimport { TEXT_DARK } from '../colours';\nimport { StatusBarHeight, isVideo, get1400 } from '../helper';\nimport { Pl60Icon } from '../fonts';\nimport { SharingTools } from './SharingTools';\nimport { VideoPopup } from './VideoPopup';\nimport { ProfilePic } from './ProfilePic';\n\nconst SCREEN_WIDTH = Dimensions.get('window').width;\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\n\nclass ImagePopup extends Component {\n constructor(props) {\n super(props);\n this.state = {\n index: 0,\n images: [],\n showFullscreenVideo: false,\n currentVideoUrl: '',\n };\n }\n\n componentDidMount() {\n this.setupUrls();\n }\n\n componentDidUpdate(prevProps) {\n const { visible, index } = this.props;\n if (!prevProps.visible && visible) this.setupUrls();\n if (prevProps.index !== index) this.setState({ index });\n }\n\n setupUrls = () => {\n if (!this.props.images) return;\n\n const images = this.props.images.map(image => {\n if (typeof image === 'string') {\n return { url: get1400(image), original: image, isVideo: isVideo(image) };\n }\n return { url: get1400(image?.uri), original: image?.uri, isVideo: isVideo(image?.uri), date: image?.date, user: image?.user };\n });\n\n this.setState({ images, index: this.state.index || this.props.index || 0 });\n };\n\n onChange = index => {\n this.setState({ index });\n };\n\n scrollTo(index) {\n this.setState({\n index,\n });\n }\n\n toggleFullscreenVideo = url => {\n if (typeof url !== 'string') url = '';\n this.setState({ showFullscreenVideo: url.length > 0, currentVideoUrl: url });\n };\n\n renderClose() {\n return (\n <TouchableOpacity style={styles.menuIconContainer} onPress={this.props.onClose} activeOpacity={0.6}>\n <Pl60Icon name=\"close\" style={[styles.menuIcon]} />\n </TouchableOpacity>\n );\n }\n\n renderImage = props => {\n const media = this.state.images.find(image => image.url === props.source.uri);\n const isVideo = !_.isNil(media) && media.isVideo;\n\n let dateText, timeText;\n if (!_.isNil(media.date)) {\n const imageDate = moment(media.date);\n dateText = imageDate.format('MMMM D, YYYY');\n timeText = imageDate.format('hh:mm A');\n }\n\n return (\n <View>\n <ImageBackground {...props}>\n {isVideo && (\n <View style={styles.videoOverlay}>\n <TouchableOpacity onPress={this.toggleFullscreenVideo.bind(this, media.original)}>\n <Icon name=\"play\" type=\"font-awesome\" iconStyle={styles.videoPlayIcon} />\n </TouchableOpacity>\n </View>\n )}\n </ImageBackground>\n {(!_.isNil(media.user) || !_.isNil(media.date)) && (\n <View style={styles.imageInfoContainer}>\n <ProfilePic Diameter={42} ProfilePic={media.user.profilePic} />\n <View style={styles.imageTextContainer}>\n <Text style={styles.imageTextName}>{media.user.displayName}</Text>\n <Text numberOfLines={2} style={styles.iamgeTextDate}>{`Uploaded ${dateText} • ${timeText}`}</Text>\n </View>\n </View>\n )}\n </View>\n );\n };\n\n renderVideoPlayerPopup() {\n const { showFullscreenVideo, currentVideoUrl } = this.state;\n if (!currentVideoUrl) return;\n\n return <VideoPopup uri={currentVideoUrl} visible={showFullscreenVideo} onClose={this.toggleFullscreenVideo} />;\n }\n\n render() {\n const { visible, onClose } = this.props;\n const { index, images } = this.state;\n\n if (_.isEmpty(images)) {\n return null;\n }\n return (\n <Modal visible={visible} animationType=\"slide\" onRequestClose={onClose} style={styles.modal}>\n <ImageViewer\n style={styles.scrollable}\n index={index}\n onChange={this.onChange}\n onSwipeDown={onClose}\n enableSwipeDown\n imageUrls={images}\n saveToLocalByLongPress={false}\n renderImage={this.renderImage}\n />\n {this.renderClose()}\n <SharingTools uri={images[index].original} />\n {this.renderVideoPlayerPopup()}\n </Modal>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n modal: {\n backgroundColor: '#000',\n },\n scrollable: {\n width: SCREEN_WIDTH,\n height: SCREEN_HEIGHT,\n backgroundColor: '#000',\n },\n image: {\n width: SCREEN_WIDTH,\n height: SCREEN_HEIGHT,\n backgroundColor: '#000',\n },\n menuIconContainer: {\n position: 'absolute',\n top: StatusBarHeight(0),\n right: 0,\n width: 55,\n height: 55,\n zIndex: 3,\n },\n menuIcon: {\n fontSize: 25,\n padding: 15,\n width: 55,\n textAlign: 'center',\n color: '#fff',\n zIndex: 3,\n },\n videoOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n },\n videoPlayIcon: {\n color: '#fff',\n fontSize: 30,\n textShadowColor: 'rgba(0,0,0,0.3)',\n textShadowOffset: { width: 2, height: 2 },\n },\n imageInfoContainer: {\n flexDirection: 'row',\n paddingHorizontal: 12,\n height: 70,\n backgroundColor: '#fff',\n alignItems: 'center',\n },\n imageTextContainer: {\n marginLeft: 12,\n flexDirection: 'column',\n flex: 1,\n height: 42,\n justifyContent: 'space-around',\n },\n imageTextName: {\n fontFamily: 'sf-semibold',\n fontSize: 14,\n color: TEXT_DARK,\n },\n iamgeTextDate: {\n fontFamily: 'sf-regular',\n fontSize: 12,\n color: TEXT_DARK,\n },\n});\n\nexport { ImagePopup };\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
+
import { InlineButton } from './InlineButton';
|
|
6
|
+
import { Spinner } from './Spinner';
|
|
7
|
+
|
|
8
|
+
class ImageUploadProgress extends Component {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
|
|
12
|
+
_defineProperty(this, "onRetryUpload", (imageUri, uploadUri) => {
|
|
13
|
+
this.props.uploader.retryUpload(imageUri, uploadUri);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
const {
|
|
19
|
+
color,
|
|
20
|
+
image,
|
|
21
|
+
style,
|
|
22
|
+
progressTextStyle,
|
|
23
|
+
retryTextStyle
|
|
24
|
+
} = this.props;
|
|
25
|
+
const {
|
|
26
|
+
imageUri,
|
|
27
|
+
uploadUri,
|
|
28
|
+
uploadProgress,
|
|
29
|
+
allowRetry
|
|
30
|
+
} = image;
|
|
31
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
style: [styles.container, style]
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
34
|
+
style: styles.spinner
|
|
35
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
36
|
+
style: [styles.uploadProgressText, progressTextStyle, {
|
|
37
|
+
color
|
|
38
|
+
}]
|
|
39
|
+
}, uploadProgress), allowRetry && /*#__PURE__*/React.createElement(InlineButton, {
|
|
40
|
+
color: color,
|
|
41
|
+
onPress: () => this.onRetryUpload(imageUri, uploadUri),
|
|
42
|
+
touchableStyle: styles.retryButton
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
44
|
+
style: [styles.retryText, retryTextStyle]
|
|
45
|
+
}, "Retry")));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
container: {
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center'
|
|
54
|
+
},
|
|
55
|
+
spinner: {
|
|
56
|
+
flex: 0
|
|
57
|
+
},
|
|
58
|
+
uploadProgressText: {
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
fontFamily: 'sf-semibold',
|
|
61
|
+
fontSize: 12
|
|
62
|
+
},
|
|
63
|
+
retryButton: {
|
|
64
|
+
marginTop: 10
|
|
65
|
+
},
|
|
66
|
+
retryText: {
|
|
67
|
+
fontFamily: 'sf-semibold',
|
|
68
|
+
fontSize: 12
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export default ImageUploadProgress;
|
|
72
|
+
//# sourceMappingURL=ImageUploadProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ImageUploadProgress.js"],"names":["React","Component","View","Text","StyleSheet","InlineButton","Spinner","ImageUploadProgress","imageUri","uploadUri","props","uploader","retryUpload","render","color","image","style","progressTextStyle","retryTextStyle","uploadProgress","allowRetry","styles","container","spinner","uploadProgressText","onRetryUpload","retryButton","retryText","create","alignItems","justifyContent","flex","textAlign","fontFamily","fontSize","marginTop"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,OAAT,QAAwB,WAAxB;;AAEA,MAAMC,mBAAN,SAAkCN,SAAlC,CAA4C;AAAA;AAAA;;AAAA,2CAC1B,CAACO,QAAD,EAAWC,SAAX,KAAyB;AACvC,WAAKC,KAAL,CAAWC,QAAX,CAAoBC,WAApB,CAAgCJ,QAAhC,EAA0CC,SAA1C;AACD,KAHyC;AAAA;;AAK1CI,EAAAA,MAAM,GAAG;AACP,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA,KAAT;AAAgBC,MAAAA,KAAhB;AAAuBC,MAAAA,iBAAvB;AAA0CC,MAAAA;AAA1C,QAA6D,KAAKR,KAAxE;AACA,UAAM;AAAEF,MAAAA,QAAF;AAAYC,MAAAA,SAAZ;AAAuBU,MAAAA,cAAvB;AAAuCC,MAAAA;AAAvC,QAAsDL,KAA5D;AAEA,wBACE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmBN,KAAnB;AAAb,oBACE,oBAAC,OAAD;AAAS,MAAA,KAAK,EAAEK,MAAM,CAACE;AAAvB,MADF,eAEE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAE,CAACF,MAAM,CAACG,kBAAR,EAA4BP,iBAA5B,EAA+C;AAAEH,QAAAA;AAAF,OAA/C;AAAb,OAAyEK,cAAzE,CAFF,EAGGC,UAAU,iBACT,oBAAC,YAAD;AAAc,MAAA,KAAK,EAAEN,KAArB;AAA4B,MAAA,OAAO,EAAE,MAAM,KAAKW,aAAL,CAAmBjB,QAAnB,EAA6BC,SAA7B,CAA3C;AAAoF,MAAA,cAAc,EAAEY,MAAM,CAACK;AAA3G,oBACE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAE,CAACL,MAAM,CAACM,SAAR,EAAmBT,cAAnB;AAAb,eADF,CAJJ,CADF;AAWD;;AApByC;;AAuB5C,MAAMG,MAAM,GAAGjB,UAAU,CAACwB,MAAX,CAAkB;AAC/BN,EAAAA,SAAS,EAAE;AACTO,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,cAAc,EAAE;AAFP,GADoB;AAK/BP,EAAAA,OAAO,EAAE;AACPQ,IAAAA,IAAI,EAAE;AADC,GALsB;AAQ/BP,EAAAA,kBAAkB,EAAE;AAClBQ,IAAAA,SAAS,EAAE,QADO;AAElBC,IAAAA,UAAU,EAAE,aAFM;AAGlBC,IAAAA,QAAQ,EAAE;AAHQ,GARW;AAa/BR,EAAAA,WAAW,EAAE;AACXS,IAAAA,SAAS,EAAE;AADA,GAbkB;AAgB/BR,EAAAA,SAAS,EAAE;AACTM,IAAAA,UAAU,EAAE,aADH;AAETC,IAAAA,QAAQ,EAAE;AAFD;AAhBoB,CAAlB,CAAf;AAsBA,eAAe3B,mBAAf","sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport { InlineButton } from './InlineButton';\nimport { Spinner } from './Spinner';\n\nclass ImageUploadProgress extends Component {\n onRetryUpload = (imageUri, uploadUri) => {\n this.props.uploader.retryUpload(imageUri, uploadUri);\n };\n\n render() {\n const { color, image, style, progressTextStyle, retryTextStyle } = this.props;\n const { imageUri, uploadUri, uploadProgress, allowRetry } = image;\n\n return (\n <View style={[styles.container, style]}>\n <Spinner style={styles.spinner} />\n <Text style={[styles.uploadProgressText, progressTextStyle, { color }]}>{uploadProgress}</Text>\n {allowRetry && (\n <InlineButton color={color} onPress={() => this.onRetryUpload(imageUri, uploadUri)} touchableStyle={styles.retryButton}>\n <Text style={[styles.retryText, retryTextStyle]}>Retry</Text>\n </InlineButton>\n )}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n spinner: {\n flex: 0,\n },\n uploadProgressText: {\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 12,\n },\n retryButton: {\n marginTop: 10,\n },\n retryText: {\n fontFamily: 'sf-semibold',\n fontSize: 12,\n },\n});\n\nexport default ImageUploadProgress;\n"]}
|