@plusscommunities/pluss-core-app 8.0.0 → 8.0.1-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 +4 -4
- package/dist/module/actions/FollowerActions.js.map +1 -1
- package/dist/module/actions/MediaActions.js +1 -1
- package/dist/module/actions/MediaActions.js.map +1 -1
- package/dist/module/actions/ResidentActions.js +1 -1
- package/dist/module/actions/ResidentActions.js.map +1 -1
- package/dist/module/actions/UserActions.js +1 -1
- package/dist/module/actions/UserActions.js.map +1 -1
- package/dist/module/actions/UserSettingsActions.js +1 -1
- package/dist/module/actions/UserSettingsActions.js.map +1 -1
- package/dist/module/actions/index.js +5 -5
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +16 -16
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/analyticsActions.js +5 -5
- package/dist/module/apis/analyticsActions.js.map +1 -1
- package/dist/module/apis/contactActions.js +6 -6
- package/dist/module/apis/contactActions.js.map +1 -1
- package/dist/module/apis/eventActions.js +28 -28
- package/dist/module/apis/eventActions.js.map +1 -1
- package/dist/module/apis/fileActions.js +15 -15
- package/dist/module/apis/fileActions.js.map +1 -1
- package/dist/module/apis/followerActions.js +8 -8
- package/dist/module/apis/followerActions.js.map +1 -1
- package/dist/module/apis/index.js +12 -12
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/notificationActions.js +17 -17
- package/dist/module/apis/notificationActions.js.map +1 -1
- package/dist/module/apis/profileActions.js +4 -4
- package/dist/module/apis/profileActions.js.map +1 -1
- package/dist/module/apis/reactionActions.js +15 -15
- package/dist/module/apis/reactionActions.js.map +1 -1
- package/dist/module/apis/settingActions.js +6 -6
- package/dist/module/apis/settingActions.js.map +1 -1
- package/dist/module/apis/stringActions.js +8 -8
- package/dist/module/apis/stringActions.js.map +1 -1
- package/dist/module/apis/typeActions.js +4 -4
- package/dist/module/apis/typeActions.js.map +1 -1
- package/dist/module/apis/userActions.js +8 -8
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/dist/module/colours.js +26 -29
- package/dist/module/colours.js.map +1 -1
- package/dist/module/components/AddButton.js +8 -8
- package/dist/module/components/AddButton.js.map +1 -1
- package/dist/module/components/AddToCalendarButton.js +30 -29
- package/dist/module/components/AddToCalendarButton.js.map +1 -1
- package/dist/module/components/Attachment.js +10 -9
- package/dist/module/components/Attachment.js.map +1 -1
- package/dist/module/components/AudienceSelectorLauncher.js +11 -11
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -1
- package/dist/module/components/AudienceSelectorPage.js +45 -44
- package/dist/module/components/AudienceSelectorPage.js.map +1 -1
- package/dist/module/components/AutoOffsetImage.js +13 -13
- package/dist/module/components/AutoOffsetImage.js.map +1 -1
- package/dist/module/components/BackButton.js +10 -10
- package/dist/module/components/BackButton.js.map +1 -1
- package/dist/module/components/CalendarPopup.js +21 -21
- package/dist/module/components/CalendarPopup.js.map +1 -1
- package/dist/module/components/CategoryTabs.js +30 -29
- package/dist/module/components/CategoryTabs.js.map +1 -1
- package/dist/module/components/CommentReply.js +43 -37
- package/dist/module/components/CommentReply.js.map +1 -1
- package/dist/module/components/CommentSection.js +74 -74
- package/dist/module/components/CommentSection.js.map +1 -1
- package/dist/module/components/ConfirmPopup.js +21 -20
- package/dist/module/components/ConfirmPopup.js.map +1 -1
- package/dist/module/components/ConfirmationPopup.js +11 -11
- package/dist/module/components/ConfirmationPopup.js.map +1 -1
- package/dist/module/components/DocumentUploader.js +50 -50
- package/dist/module/components/DocumentUploader.js.map +1 -1
- package/dist/module/components/DropDownItem.js +14 -13
- package/dist/module/components/DropDownItem.js.map +1 -1
- package/dist/module/components/DropDownMenu.js +5 -5
- package/dist/module/components/DropDownMenu.js.map +1 -1
- package/dist/module/components/EmptyStateMain.js +10 -9
- package/dist/module/components/EmptyStateMain.js.map +1 -1
- package/dist/module/components/EmptyStateWidget.js +7 -6
- package/dist/module/components/EmptyStateWidget.js.map +1 -1
- package/dist/module/components/FontScaleButton.js +5 -4
- package/dist/module/components/FontScaleButton.js.map +1 -1
- package/dist/module/components/FontScalePopup.js +11 -10
- package/dist/module/components/FontScalePopup.js.map +1 -1
- package/dist/module/components/Forbidden.js +13 -13
- package/dist/module/components/Forbidden.js.map +1 -1
- package/dist/module/components/FormCard.js +4 -4
- package/dist/module/components/FormCard.js.map +1 -1
- package/dist/module/components/FormCardSection.js +20 -18
- package/dist/module/components/FormCardSection.js.map +1 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +13 -12
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -1
- package/dist/module/components/FormattedText.js +18 -16
- package/dist/module/components/FormattedText.js.map +1 -1
- package/dist/module/components/GenericInput.js +24 -21
- package/dist/module/components/GenericInput.js.map +1 -1
- package/dist/module/components/GenericInputSection.js +27 -26
- package/dist/module/components/GenericInputSection.js.map +1 -1
- package/dist/module/components/Header.js +70 -69
- package/dist/module/components/Header.js.map +1 -1
- package/dist/module/components/Icon.js +109 -0
- package/dist/module/components/Icon.js.map +1 -0
- package/dist/module/components/ImagePopup.js +211 -73
- package/dist/module/components/ImagePopup.js.map +1 -1
- package/dist/module/components/ImageUploadProgress.js +10 -9
- package/dist/module/components/ImageUploadProgress.js.map +1 -1
- package/dist/module/components/ImageUploader.js +116 -96
- package/dist/module/components/ImageUploader.js.map +1 -1
- package/dist/module/components/InlineButton.js +9 -8
- package/dist/module/components/InlineButton.js.map +1 -1
- package/dist/module/components/Input.js +28 -26
- package/dist/module/components/Input.js.map +1 -1
- package/dist/module/components/LoadingCircles.js +20 -20
- package/dist/module/components/LoadingCircles.js.map +1 -1
- package/dist/module/components/LoadingIndicator.js +11 -11
- package/dist/module/components/LoadingIndicator.js.map +1 -1
- package/dist/module/components/LoadingStateWidget.js +5 -5
- package/dist/module/components/LoadingStateWidget.js.map +1 -1
- package/dist/module/components/MediaPlayer.js +31 -31
- package/dist/module/components/MediaPlayer.js.map +1 -1
- package/dist/module/components/MiddlePopup.js +17 -11
- package/dist/module/components/MiddlePopup.js.map +1 -1
- package/dist/module/components/PDFPopup.js +52 -39
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/PlussChat.js +168 -149
- package/dist/module/components/PlussChat.js.map +1 -1
- package/dist/module/components/PlussChatMessage.js +42 -42
- package/dist/module/components/PlussChatMessage.js.map +1 -1
- package/dist/module/components/PlussChatTime.js +18 -17
- package/dist/module/components/PlussChatTime.js.map +1 -1
- package/dist/module/components/Popup.js +20 -19
- package/dist/module/components/Popup.js.map +1 -1
- package/dist/module/components/PopupMenu.js +15 -14
- package/dist/module/components/PopupMenu.js.map +1 -1
- package/dist/module/components/PositionedImage.js +20 -20
- package/dist/module/components/PositionedImage.js.map +1 -1
- package/dist/module/components/ProfilePic.js +10 -10
- package/dist/module/components/ProfilePic.js.map +1 -1
- package/dist/module/components/RadioButton.js +10 -9
- package/dist/module/components/RadioButton.js.map +1 -1
- package/dist/module/components/Reaction.js +18 -17
- package/dist/module/components/Reaction.js.map +1 -1
- package/dist/module/components/Reactions.js +7 -7
- package/dist/module/components/Reactions.js.map +1 -1
- package/dist/module/components/SharingTools.js +78 -43
- package/dist/module/components/SharingTools.js.map +1 -1
- package/dist/module/components/Spinner.js +5 -5
- package/dist/module/components/Spinner.js.map +1 -1
- package/dist/module/components/StickyFooter.js +6 -6
- package/dist/module/components/StickyFooter.js.map +1 -1
- package/dist/module/components/Text.js +57 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +6 -6
- package/dist/module/components/TickIcon.js.map +1 -1
- package/dist/module/components/Toggle.js +10 -9
- package/dist/module/components/Toggle.js.map +1 -1
- package/dist/module/components/TouchableSearchBar.js +18 -17
- package/dist/module/components/TouchableSearchBar.js.map +1 -1
- package/dist/module/components/UserListPopup.js +20 -19
- package/dist/module/components/UserListPopup.js.map +1 -1
- package/dist/module/components/UserListing.js +41 -40
- package/dist/module/components/UserListing.js.map +1 -1
- package/dist/module/components/VideoPopup.js +20 -20
- package/dist/module/components/VideoPopup.js.map +1 -1
- package/dist/module/components/WarningPopup.js +21 -20
- package/dist/module/components/WarningPopup.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +13 -13
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -1
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +24 -23
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -1
- package/dist/module/components/index.js +59 -58
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +94 -64
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +64 -64
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -1
- package/dist/module/config.js +15 -10
- package/dist/module/config.js.map +1 -1
- package/dist/module/constants.js +3 -4
- package/dist/module/constants.js.map +1 -1
- package/dist/module/helper.js +83 -82
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +12 -12
- package/dist/module/index.js.map +1 -1
- package/dist/module/js/images/detectFaces.js +11 -10
- package/dist/module/js/images/detectFaces.js.map +1 -1
- package/dist/module/js/images/findLandmarkRange.js +8 -8
- package/dist/module/js/images/findLandmarkRange.js.map +1 -1
- package/dist/module/js/images/getScaledOffset.js.map +1 -1
- package/dist/module/js/site/getSiteLevelFromState.js +2 -2
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -1
- package/dist/module/js/site/isTVEnabled.js +2 -2
- package/dist/module/js/site/isTVEnabled.js.map +1 -1
- package/dist/module/session.js +6 -6
- package/dist/module/session.js.map +1 -1
- package/dist/module/styles.js +17 -17
- package/dist/module/styles.js.map +1 -1
- package/dist/module/withNavigationFocus.js +30 -0
- package/dist/module/withNavigationFocus.js.map +1 -0
- package/package.json +71 -68
- package/src/actions/FollowerActions.js +36 -32
- package/src/actions/MediaActions.js +25 -20
- package/src/actions/ResidentActions.js +26 -21
- package/src/actions/UserActions.js +22 -22
- package/src/actions/UserSettingsActions.js +11 -11
- package/src/actions/index.js +5 -5
- package/src/actions/types.js +16 -16
- package/src/apis/analyticsActions.js +17 -17
- package/src/apis/contactActions.js +20 -20
- package/src/apis/eventActions.js +153 -144
- package/src/apis/fileActions.js +96 -86
- package/src/apis/followerActions.js +29 -29
- package/src/apis/index.js +12 -12
- package/src/apis/notificationActions.js +44 -44
- package/src/apis/profileActions.js +8 -8
- package/src/apis/reactionActions.js +81 -73
- package/src/apis/settingActions.js +15 -15
- package/src/apis/stringActions.js +29 -25
- package/src/apis/typeActions.js +10 -10
- package/src/apis/userActions.js +93 -93
- package/src/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/src/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/src/assets/icons/fontawesome/fa7-glyphmap.json +4205 -0
- package/src/colours.js +116 -96
- package/src/components/AddButton.js +32 -27
- package/src/components/AddToCalendarButton.js +236 -202
- package/src/components/Attachment.js +59 -36
- package/src/components/AudienceSelectorLauncher.js +52 -48
- package/src/components/AudienceSelectorPage.js +353 -311
- package/src/components/AutoOffsetImage.js +237 -196
- package/src/components/BackButton.js +57 -41
- package/src/components/CalendarPopup.js +127 -97
- package/src/components/CategoryTabs.js +208 -163
- package/src/components/CommentReply.js +370 -309
- package/src/components/CommentSection.js +974 -781
- package/src/components/ConfirmPopup.js +141 -110
- package/src/components/ConfirmationPopup.js +80 -69
- package/src/components/DocumentUploader.js +245 -215
- package/src/components/DropDownItem.js +70 -60
- package/src/components/DropDownMenu.js +31 -27
- package/src/components/EmptyStateMain.js +51 -44
- package/src/components/EmptyStateWidget.js +47 -38
- package/src/components/FontScaleButton.js +29 -25
- package/src/components/FontScalePopup.js +67 -56
- package/src/components/Forbidden.js +48 -46
- package/src/components/FormCard.js +21 -17
- package/src/components/FormCardSection.js +284 -233
- package/src/components/FormCardSectionOptionLauncher.js +72 -46
- package/src/components/FormattedText.js +128 -111
- package/src/components/GenericInput.js +168 -136
- package/src/components/GenericInputSection.js +209 -161
- package/src/components/Header.js +620 -474
- package/src/components/Icon.js +119 -0
- package/src/components/ImagePopup.js +425 -221
- package/src/components/ImageUploadProgress.js +49 -41
- package/src/components/ImageUploader.js +968 -797
- package/src/components/InlineButton.js +79 -69
- package/src/components/Input.js +190 -156
- package/src/components/LoadingCircles.js +233 -233
- package/src/components/LoadingIndicator.js +87 -76
- package/src/components/LoadingStateWidget.js +47 -37
- package/src/components/MediaPlayer.js +416 -387
- package/src/components/MiddlePopup.js +62 -33
- package/src/components/PDFPopup.js +212 -159
- package/src/components/PlussChat.js +1224 -1025
- package/src/components/PlussChatMessage.js +329 -298
- package/src/components/PlussChatTime.js +57 -53
- package/src/components/Popup.js +138 -116
- package/src/components/PopupMenu.js +140 -110
- package/src/components/PositionedImage.js +281 -237
- package/src/components/ProfilePic.js +122 -113
- package/src/components/RadioButton.js +76 -52
- package/src/components/Reaction.js +134 -96
- package/src/components/Reactions.js +65 -63
- package/src/components/SharingTools.js +185 -134
- package/src/components/Spinner.js +13 -13
- package/src/components/StickyFooter.js +36 -26
- package/src/components/Text.js +62 -0
- package/src/components/TickIcon.js +20 -20
- package/src/components/Toggle.js +74 -73
- package/src/components/TouchableSearchBar.js +68 -50
- package/src/components/UserListPopup.js +161 -124
- package/src/components/UserListing.js +273 -238
- package/src/components/VideoPopup.js +110 -96
- package/src/components/WarningPopup.js +92 -71
- package/src/components/expo-image-picker-multiple/ImageBrowser.js +288 -256
- package/src/components/expo-image-picker-multiple/ImageTile.js +108 -84
- package/src/components/index.js +59 -58
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +444 -359
- package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
- package/src/config.js +26 -21
- package/src/constants.js +8 -10
- package/src/helper.js +469 -438
- package/src/index.js +24 -12
- package/src/js/images/detectFaces.js +28 -21
- package/src/js/images/findLandmarkRange.js +97 -90
- package/src/js/images/getScaledOffset.js +80 -75
- package/src/js/site/getSiteLevelFromState.js +26 -26
- package/src/js/site/isTVEnabled.js +10 -10
- package/src/session.js +32 -32
- package/src/styles.js +61 -61
- package/src/withNavigationFocus.js +28 -0
- package/dist/module/components/TextStyle.js +0 -45
- package/dist/module/components/TextStyle.js.map +0 -1
- package/dist/module/fonts/index.js +0 -2
- package/dist/module/fonts/index.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.js +0 -5
- package/dist/module/fonts/pluss60-icons.js.map +0 -1
- package/dist/module/fonts/pluss60-icons.json +0 -1097
- package/src/components/TextStyle.js +0 -48
- package/src/fonts/index.js +0 -1
- package/src/fonts/pluss60-icons.js +0 -7
- package/src/fonts/pluss60-icons.json +0 -1097
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import React, { Component } from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
const SCREEN_WIDTH = Dimensions.get(
|
|
18
|
-
const SCREEN_HEIGHT = Dimensions.get(
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { Text } from "@plusscommunities/pluss-core-app/components";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
import moment from "moment";
|
|
8
|
+
import { Dimensions, Modal, TouchableOpacity, StyleSheet, View, Image } from "react-native";
|
|
9
|
+
import ImageViewer from "react-native-image-zoom-viewer";
|
|
10
|
+
import { Icon } from "@rneui/themed";
|
|
11
|
+
import { StatusBarHeight, isVideo, get1400 } from "../helper";
|
|
12
|
+
import { FontAwesome } from "./Icon";
|
|
13
|
+
import { SharingTools } from "./SharingTools";
|
|
14
|
+
import { VideoPopup } from "./VideoPopup";
|
|
15
|
+
import { ProfilePic } from "./ProfilePic";
|
|
16
|
+
import { LoadingIndicator } from "./";
|
|
17
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
18
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
19
|
+
const MAX_IMAGE_HEIGHT = SCREEN_HEIGHT * 0.65;
|
|
19
20
|
class ImagePopup extends Component {
|
|
20
21
|
constructor(_props) {
|
|
21
22
|
super(_props);
|
|
22
|
-
_defineProperty(this, "setupUrls", () => {
|
|
23
|
+
_defineProperty(this, "setupUrls", async () => {
|
|
23
24
|
if (!this.props.images) return;
|
|
24
25
|
const images = this.props.images.map(image => {
|
|
25
|
-
if (typeof image ===
|
|
26
|
+
if (typeof image === "string") {
|
|
26
27
|
return {
|
|
27
28
|
url: get1400(image),
|
|
28
29
|
original: image,
|
|
@@ -34,12 +35,43 @@ class ImagePopup extends Component {
|
|
|
34
35
|
original: image === null || image === void 0 ? void 0 : image.uri,
|
|
35
36
|
isVideo: isVideo(image === null || image === void 0 ? void 0 : image.uri),
|
|
36
37
|
date: image === null || image === void 0 ? void 0 : image.date,
|
|
37
|
-
user: image === null || image === void 0 ? void 0 : image.user
|
|
38
|
+
user: image === null || image === void 0 ? void 0 : image.user,
|
|
39
|
+
caption: image === null || image === void 0 ? void 0 : image.caption
|
|
38
40
|
};
|
|
39
41
|
});
|
|
42
|
+
this.setState({
|
|
43
|
+
isLoadingDimensions: true
|
|
44
|
+
});
|
|
45
|
+
const dimensions = {};
|
|
46
|
+
await Promise.all(images.map(async image => {
|
|
47
|
+
if (!image.url) return;
|
|
48
|
+
try {
|
|
49
|
+
const {
|
|
50
|
+
width,
|
|
51
|
+
height
|
|
52
|
+
} = await new Promise((resolve, reject) => {
|
|
53
|
+
Image.getSize(image.url, (w, h) => resolve({
|
|
54
|
+
width: w,
|
|
55
|
+
height: h
|
|
56
|
+
}), reject);
|
|
57
|
+
});
|
|
58
|
+
dimensions[image.url] = {
|
|
59
|
+
width,
|
|
60
|
+
height
|
|
61
|
+
};
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.log("Failed to get dimensions for", image.url, err);
|
|
64
|
+
dimensions[image.url] = {
|
|
65
|
+
width: SCREEN_WIDTH,
|
|
66
|
+
height: SCREEN_HEIGHT
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
40
70
|
this.setState({
|
|
41
71
|
images,
|
|
42
|
-
index: this.state.index || this.props.index || 0
|
|
72
|
+
index: this.state.index || this.props.index || 0,
|
|
73
|
+
imageDimensions: dimensions,
|
|
74
|
+
isLoadingDimensions: false
|
|
43
75
|
});
|
|
44
76
|
});
|
|
45
77
|
_defineProperty(this, "onChange", index => {
|
|
@@ -48,25 +80,25 @@ class ImagePopup extends Component {
|
|
|
48
80
|
});
|
|
49
81
|
});
|
|
50
82
|
_defineProperty(this, "toggleFullscreenVideo", url => {
|
|
51
|
-
if (typeof url !==
|
|
83
|
+
if (typeof url !== "string") url = "";
|
|
52
84
|
this.setState({
|
|
53
85
|
showFullscreenVideo: url.length > 0,
|
|
54
86
|
currentVideoUrl: url
|
|
55
87
|
});
|
|
56
88
|
});
|
|
57
|
-
_defineProperty(this, "renderImageFooter",
|
|
89
|
+
_defineProperty(this, "renderImageFooter", media => {
|
|
58
90
|
var _media$user, _media$user2;
|
|
59
91
|
if (!media.user || !media.date) return null;
|
|
60
92
|
let dateText, timeText;
|
|
61
93
|
if (!_.isNil(media.date)) {
|
|
62
94
|
const imageDate = moment(media.date);
|
|
63
|
-
dateText = imageDate.format(
|
|
64
|
-
timeText = imageDate.format(
|
|
95
|
+
dateText = imageDate.format("MMMM D, YYYY");
|
|
96
|
+
timeText = imageDate.format("hh:mm A");
|
|
65
97
|
}
|
|
66
98
|
return /*#__PURE__*/React.createElement(View, {
|
|
67
|
-
style:
|
|
99
|
+
style: styles.imageInfoContainer
|
|
68
100
|
}, /*#__PURE__*/React.createElement(ProfilePic, {
|
|
69
|
-
Diameter:
|
|
101
|
+
Diameter: 36,
|
|
70
102
|
ProfilePic: media === null || media === void 0 || (_media$user = media.user) === null || _media$user === void 0 ? void 0 : _media$user.profilePic
|
|
71
103
|
}), /*#__PURE__*/React.createElement(View, {
|
|
72
104
|
style: styles.imageTextContainer
|
|
@@ -77,32 +109,98 @@ class ImagePopup extends Component {
|
|
|
77
109
|
style: styles.iamgeTextDate
|
|
78
110
|
}, `Uploaded ${dateText} • ${timeText}`)));
|
|
79
111
|
});
|
|
112
|
+
_defineProperty(this, "renderCaption", media => {
|
|
113
|
+
if (!media.caption) return null;
|
|
114
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
115
|
+
style: styles.captionContainer
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
117
|
+
numberOfLines: 3,
|
|
118
|
+
style: styles.captionText
|
|
119
|
+
}, media.caption));
|
|
120
|
+
});
|
|
121
|
+
_defineProperty(this, "getImageDimensions", media => {
|
|
122
|
+
const cachedDimensions = this.state.imageDimensions[media === null || media === void 0 ? void 0 : media.url] || {
|
|
123
|
+
width: SCREEN_WIDTH,
|
|
124
|
+
height: SCREEN_HEIGHT
|
|
125
|
+
};
|
|
126
|
+
const aspectRatio = cachedDimensions.width / cachedDimensions.height;
|
|
127
|
+
let imageWidth = SCREEN_WIDTH;
|
|
128
|
+
let imageHeight = imageWidth / aspectRatio;
|
|
129
|
+
|
|
130
|
+
// Cap at 70% of screen height
|
|
131
|
+
if (imageHeight > MAX_IMAGE_HEIGHT) {
|
|
132
|
+
imageHeight = MAX_IMAGE_HEIGHT;
|
|
133
|
+
imageWidth = imageHeight * aspectRatio;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
imageWidth,
|
|
137
|
+
imageHeight
|
|
138
|
+
};
|
|
139
|
+
});
|
|
80
140
|
_defineProperty(this, "renderImage", props => {
|
|
81
141
|
const media = this.state.images.find(image => image.url === props.source.uri);
|
|
82
|
-
const
|
|
142
|
+
const isVideoMedia = !_.isNil(media) && media.isVideo;
|
|
143
|
+
const {
|
|
144
|
+
imageWidth,
|
|
145
|
+
imageHeight
|
|
146
|
+
} = this.getImageDimensions(media);
|
|
83
147
|
return /*#__PURE__*/React.createElement(View, {
|
|
84
148
|
style: styles.imageContainer
|
|
85
|
-
}, /*#__PURE__*/React.createElement(
|
|
149
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
86
150
|
source: {
|
|
87
|
-
uri: media.url
|
|
151
|
+
uri: media === null || media === void 0 ? void 0 : media.url
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
width: imageWidth,
|
|
155
|
+
height: imageHeight
|
|
88
156
|
},
|
|
89
|
-
width: SCREEN_WIDTH,
|
|
90
157
|
resizeMode: "contain"
|
|
91
|
-
}),
|
|
92
|
-
style: styles.videoOverlay
|
|
158
|
+
}), isVideoMedia && /*#__PURE__*/React.createElement(View, {
|
|
159
|
+
style: [styles.videoOverlay, {
|
|
160
|
+
width: imageWidth,
|
|
161
|
+
height: imageHeight
|
|
162
|
+
}]
|
|
93
163
|
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
94
164
|
onPress: this.toggleFullscreenVideo.bind(this, media.original)
|
|
95
165
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
166
|
name: "play",
|
|
97
167
|
type: "font-awesome",
|
|
98
168
|
iconStyle: styles.videoPlayIcon
|
|
99
|
-
})))
|
|
169
|
+
}))));
|
|
170
|
+
});
|
|
171
|
+
_defineProperty(this, "renderBottomContent", () => {
|
|
172
|
+
const {
|
|
173
|
+
index,
|
|
174
|
+
images
|
|
175
|
+
} = this.state;
|
|
176
|
+
const media = images[index];
|
|
177
|
+
if (!media) return null;
|
|
178
|
+
const hasCaption = !_.isNil(media.caption);
|
|
179
|
+
const hasUserInfo = !_.isNil(media.user) || !_.isNil(media.date);
|
|
180
|
+
if (!hasCaption && !hasUserInfo) return null;
|
|
181
|
+
|
|
182
|
+
// Calculate where the image ends (for caption positioning)
|
|
183
|
+
const {
|
|
184
|
+
imageHeight
|
|
185
|
+
} = this.getImageDimensions(media);
|
|
186
|
+
const imageTop = (SCREEN_HEIGHT - imageHeight) / 2;
|
|
187
|
+
const imageBottom = imageTop + imageHeight;
|
|
188
|
+
const captionTop = imageBottom + 16;
|
|
189
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, hasCaption && /*#__PURE__*/React.createElement(View, {
|
|
190
|
+
style: [styles.captionWrapper, {
|
|
191
|
+
top: captionTop
|
|
192
|
+
}]
|
|
193
|
+
}, this.renderCaption(media)), hasUserInfo && /*#__PURE__*/React.createElement(View, {
|
|
194
|
+
style: styles.userInfoWrapper
|
|
195
|
+
}, this.renderImageFooter(media)));
|
|
100
196
|
});
|
|
101
197
|
this.state = {
|
|
102
198
|
index: 0,
|
|
103
199
|
images: [],
|
|
104
200
|
showFullscreenVideo: false,
|
|
105
|
-
currentVideoUrl:
|
|
201
|
+
currentVideoUrl: "",
|
|
202
|
+
imageDimensions: {},
|
|
203
|
+
isLoadingDimensions: false
|
|
106
204
|
};
|
|
107
205
|
}
|
|
108
206
|
componentDidMount() {
|
|
@@ -128,8 +226,8 @@ class ImagePopup extends Component {
|
|
|
128
226
|
style: styles.menuIconContainer,
|
|
129
227
|
onPress: this.props.onClose,
|
|
130
228
|
activeOpacity: 0.6
|
|
131
|
-
}, /*#__PURE__*/React.createElement(
|
|
132
|
-
name: "
|
|
229
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
230
|
+
name: "x",
|
|
133
231
|
style: [styles.menuIcon]
|
|
134
232
|
}));
|
|
135
233
|
}
|
|
@@ -146,19 +244,29 @@ class ImagePopup extends Component {
|
|
|
146
244
|
});
|
|
147
245
|
}
|
|
148
246
|
render() {
|
|
247
|
+
var _images$index;
|
|
149
248
|
const {
|
|
150
249
|
visible,
|
|
151
250
|
onClose
|
|
152
251
|
} = this.props;
|
|
153
252
|
const {
|
|
154
253
|
index,
|
|
155
|
-
images
|
|
254
|
+
images,
|
|
255
|
+
isLoadingDimensions
|
|
156
256
|
} = this.state;
|
|
157
257
|
if (_.isEmpty(images)) {
|
|
158
258
|
return null;
|
|
159
259
|
}
|
|
160
|
-
|
|
161
|
-
|
|
260
|
+
if (isLoadingDimensions) {
|
|
261
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
262
|
+
visible: visible,
|
|
263
|
+
animationType: "slide",
|
|
264
|
+
onRequestClose: onClose,
|
|
265
|
+
style: styles.modal
|
|
266
|
+
}, /*#__PURE__*/React.createElement(LoadingIndicator, {
|
|
267
|
+
visible: true
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
162
270
|
const imagesWithSizes = images.map(image => {
|
|
163
271
|
return {
|
|
164
272
|
...image,
|
|
@@ -171,36 +279,56 @@ class ImagePopup extends Component {
|
|
|
171
279
|
animationType: "slide",
|
|
172
280
|
onRequestClose: onClose,
|
|
173
281
|
style: styles.modal
|
|
282
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
283
|
+
style: styles.container
|
|
174
284
|
}, /*#__PURE__*/React.createElement(ImageViewer, {
|
|
175
|
-
style: styles.
|
|
285
|
+
style: styles.imageViewer,
|
|
176
286
|
index: index,
|
|
177
287
|
onChange: this.onChange,
|
|
178
288
|
onSwipeDown: onClose,
|
|
179
289
|
enableSwipeDown: true,
|
|
180
290
|
imageUrls: imagesWithSizes,
|
|
181
291
|
saveToLocalByLongPress: false,
|
|
182
|
-
renderImage: this.renderImage
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
292
|
+
renderImage: this.renderImage,
|
|
293
|
+
backgroundColor: "#000"
|
|
294
|
+
}), this.renderBottomContent(), this.renderClose(), /*#__PURE__*/React.createElement(SharingTools, {
|
|
295
|
+
uri: (_images$index = images[index]) === null || _images$index === void 0 ? void 0 : _images$index.original
|
|
296
|
+
})), this.renderVideoPlayerPopup());
|
|
186
297
|
}
|
|
187
298
|
}
|
|
188
299
|
const styles = StyleSheet.create({
|
|
189
300
|
modal: {
|
|
190
|
-
backgroundColor:
|
|
301
|
+
backgroundColor: "#000"
|
|
191
302
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
303
|
+
container: {
|
|
304
|
+
flex: 1,
|
|
305
|
+
backgroundColor: "#000"
|
|
306
|
+
},
|
|
307
|
+
imageViewer: {
|
|
308
|
+
flex: 1,
|
|
309
|
+
backgroundColor: "#000"
|
|
196
310
|
},
|
|
197
311
|
imageContainer: {
|
|
198
312
|
flex: 1,
|
|
199
|
-
justifyContent:
|
|
200
|
-
alignItems:
|
|
313
|
+
justifyContent: "center",
|
|
314
|
+
alignItems: "center"
|
|
315
|
+
},
|
|
316
|
+
captionWrapper: {
|
|
317
|
+
position: "absolute",
|
|
318
|
+
left: 16,
|
|
319
|
+
right: 16,
|
|
320
|
+
zIndex: 10
|
|
321
|
+
},
|
|
322
|
+
userInfoWrapper: {
|
|
323
|
+
position: "absolute",
|
|
324
|
+
bottom: 40,
|
|
325
|
+
// Safe area padding
|
|
326
|
+
left: 16,
|
|
327
|
+
right: 16,
|
|
328
|
+
zIndex: 10
|
|
201
329
|
},
|
|
202
330
|
menuIconContainer: {
|
|
203
|
-
position:
|
|
331
|
+
position: "absolute",
|
|
204
332
|
top: StatusBarHeight(0),
|
|
205
333
|
right: 0,
|
|
206
334
|
width: 55,
|
|
@@ -211,51 +339,61 @@ const styles = StyleSheet.create({
|
|
|
211
339
|
fontSize: 25,
|
|
212
340
|
padding: 15,
|
|
213
341
|
width: 55,
|
|
214
|
-
textAlign:
|
|
215
|
-
color:
|
|
342
|
+
textAlign: "center",
|
|
343
|
+
color: "#fff",
|
|
216
344
|
zIndex: 3
|
|
217
345
|
},
|
|
218
346
|
videoOverlay: {
|
|
219
|
-
position:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
right: 0,
|
|
223
|
-
bottom: 0,
|
|
224
|
-
alignItems: 'center',
|
|
225
|
-
justifyContent: 'center'
|
|
347
|
+
position: "absolute",
|
|
348
|
+
alignItems: "center",
|
|
349
|
+
justifyContent: "center"
|
|
226
350
|
},
|
|
227
351
|
videoPlayIcon: {
|
|
228
|
-
color:
|
|
352
|
+
color: "#fff",
|
|
229
353
|
fontSize: 30,
|
|
230
|
-
textShadowColor:
|
|
354
|
+
textShadowColor: "rgba(0,0,0,0.3)",
|
|
231
355
|
textShadowOffset: {
|
|
232
356
|
width: 2,
|
|
233
357
|
height: 2
|
|
234
358
|
}
|
|
235
359
|
},
|
|
236
360
|
imageInfoContainer: {
|
|
237
|
-
flexDirection:
|
|
361
|
+
flexDirection: "row",
|
|
238
362
|
paddingHorizontal: 12,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
363
|
+
paddingVertical: 12,
|
|
364
|
+
gap: 4,
|
|
365
|
+
borderRadius: 8,
|
|
366
|
+
alignItems: "center"
|
|
242
367
|
},
|
|
243
368
|
imageTextContainer: {
|
|
244
369
|
marginLeft: 12,
|
|
245
|
-
flexDirection:
|
|
370
|
+
flexDirection: "column",
|
|
371
|
+
gap: 4,
|
|
246
372
|
flex: 1,
|
|
247
|
-
|
|
248
|
-
justifyContent: 'space-around'
|
|
373
|
+
justifyContent: "space-around"
|
|
249
374
|
},
|
|
250
375
|
imageTextName: {
|
|
251
|
-
fontFamily:
|
|
376
|
+
fontFamily: "sf-semibold",
|
|
252
377
|
fontSize: 14,
|
|
253
|
-
color:
|
|
378
|
+
color: "#fff"
|
|
254
379
|
},
|
|
255
380
|
iamgeTextDate: {
|
|
256
|
-
fontFamily:
|
|
381
|
+
fontFamily: "sf-regular",
|
|
257
382
|
fontSize: 12,
|
|
258
|
-
color:
|
|
383
|
+
color: "rgba(255, 255, 255, 0.8)"
|
|
384
|
+
},
|
|
385
|
+
captionContainer: {
|
|
386
|
+
borderRadius: 16,
|
|
387
|
+
padding: 0,
|
|
388
|
+
alignItems: "center",
|
|
389
|
+
justifyContent: "center"
|
|
390
|
+
},
|
|
391
|
+
captionText: {
|
|
392
|
+
fontFamily: "sf-regular",
|
|
393
|
+
fontSize: 15,
|
|
394
|
+
color: "#fff",
|
|
395
|
+
textAlign: "center",
|
|
396
|
+
lineHeight: 20
|
|
259
397
|
}
|
|
260
398
|
});
|
|
261
399
|
export { ImagePopup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","moment","Dimensions","Modal","TouchableOpacity","StyleSheet","View","Text","ImageViewer","Icon","AutoHeightImage","TEXT_DARK","StatusBarHeight","isVideo","get1400","Pl60Icon","SharingTools","VideoPopup","ProfilePic","SCREEN_WIDTH","get","width","SCREEN_HEIGHT","height","ImagePopup","constructor","props","_defineProperty","images","map","image","url","original","uri","date","user","setState","index","state","showFullscreenVideo","length","currentVideoUrl","media","style","_media$user","_media$user2","dateText","timeText","isNil","imageDate","format","createElement","styles","imageInfoContainer","Diameter","profilePic","imageTextContainer","imageTextName","displayName","numberOfLines","iamgeTextDate","find","source","imageContainer","resizeMode","videoOverlay","onPress","toggleFullscreenVideo","bind","name","type","iconStyle","videoPlayIcon","renderImageFooter","componentDidMount","setupUrls","componentDidUpdate","prevProps","visible","scrollTo","renderClose","menuIconContainer","onClose","activeOpacity","menuIcon","renderVideoPlayerPopup","render","isEmpty","imagesWithSizes","animationType","onRequestClose","modal","scrollable","onChange","onSwipeDown","enableSwipeDown","imageUrls","saveToLocalByLongPress","renderImage","create","backgroundColor","flex","justifyContent","alignItems","position","top","right","zIndex","fontSize","padding","textAlign","color","left","bottom","textShadowColor","textShadowOffset","flexDirection","paddingHorizontal","marginLeft","fontFamily"],"sources":["ImagePopup.js"],"sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport { Dimensions, Modal, TouchableOpacity, StyleSheet, View, Text } from 'react-native';\nimport ImageViewer from 'react-native-image-zoom-viewer';\nimport { Icon } from '@rneui/themed';\nimport AutoHeightImage from 'react-native-auto-height-image';\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 renderImageFooter = (media, style) => {\n if (!media.user || !media.date) return null;\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 style={[styles.imageInfoContainer, style]}>\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 };\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 return (\n <View style={styles.imageContainer}>\n <AutoHeightImage source={{ uri: media.url }} width={SCREEN_WIDTH} resizeMode=\"contain\" />\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 {this.renderImageFooter(media)}\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\n // This is required for the ImageViewer to render the image info section properly\n const imagesWithSizes = images.map(image => {\n return {\n ...image,\n width: SCREEN_WIDTH,\n height: SCREEN_HEIGHT,\n };\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={imagesWithSizes}\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 imageContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\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 { ImageP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AQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNO,IAAI,EAAE,CAAC;IACPN,KAAK,EAAE,CAAC;IACRO,MAAM,EAAE,CAAC;IACTV,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACD9B,aAAa,EAAE;IACbuC,KAAK,EAAE,MAAM;IACbH,QAAQ,EAAE,EAAE;IACZM,eAAe,EAAE,iBAAiB;IAClCC,gBAAgB,EAAE;MAAE9F,KAAK,EAAE,CAAC;MAAEE,MAAM,EAAE;IAAE;EAC1C,CAAC;EACD8B,kBAAkB,EAAE;IAClB+D,aAAa,EAAE,KAAK;IACpBC,iBAAiB,EAAE,EAAE;IACrB9F,MAAM,EAAE,EAAE;IACV6E,eAAe,EAAE,MAAM;IACvBG,UAAU,EAAE;EACd,CAAC;EACD/C,kBAAkB,EAAE;IAClB8D,UAAU,EAAE,EAAE;IACdF,aAAa,EAAE,QAAQ;IACvBf,IAAI,EAAE,CAAC;IACP9E,MAAM,EAAE,EAAE;IACV+E,cAAc,EAAE;EAClB,CAAC;EACD7C,aAAa,EAAE;IACb8D,UAAU,EAAE,aAAa;IACzBX,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAEpG;EACT,CAAC;EACDiD,aAAa,EAAE;IACb2D,UAAU,EAAE,YAAY;IACxBX,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAEpG;EACT;AACF,CAAC,CAAC;AAEF,SAASa,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","Text","_","moment","Dimensions","Modal","TouchableOpacity","StyleSheet","View","Image","ImageViewer","Icon","StatusBarHeight","isVideo","get1400","FontAwesome","SharingTools","VideoPopup","ProfilePic","LoadingIndicator","SCREEN_WIDTH","get","width","SCREEN_HEIGHT","height","MAX_IMAGE_HEIGHT","ImagePopup","constructor","props","_defineProperty","images","map","image","url","original","uri","date","user","caption","setState","isLoadingDimensions","dimensions","Promise","all","resolve","reject","getSize","w","h","err","console","log","index","state","imageDimensions","showFullscreenVideo","length","currentVideoUrl","media","_media$user","_media$user2","dateText","timeText","isNil","imageDate","format","createElement","style","styles","imageInfoContainer","Diameter","profilePic","imageTextContainer","imageTextName","displayName","numberOfLines","iamgeTextDate","captionContainer","captionText","cachedDimensions","aspectRatio","imageWidth","imageHeight","find","source","isVideoMedia","getImageDimensions","imageContainer","resizeMode","videoOverlay","onPress","toggleFullscreenVideo","bind","name","type","iconStyle","videoPlayIcon","hasCaption","hasUserInfo","imageTop","imageBottom","captionTop","Fragment","captionWrapper","top","renderCaption","userInfoWrapper","renderImageFooter","componentDidMount","setupUrls","componentDidUpdate","prevProps","visible","scrollTo","renderClose","menuIconContainer","onClose","activeOpacity","menuIcon","renderVideoPlayerPopup","render","_images$index","isEmpty","animationType","onRequestClose","modal","imagesWithSizes","container","imageViewer","onChange","onSwipeDown","enableSwipeDown","imageUrls","saveToLocalByLongPress","renderImage","backgroundColor","renderBottomContent","create","flex","justifyContent","alignItems","position","left","right","zIndex","bottom","fontSize","padding","textAlign","color","textShadowColor","textShadowOffset","flexDirection","paddingHorizontal","paddingVertical","gap","borderRadius","marginLeft","fontFamily","lineHeight"],"sources":["ImagePopup.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\nimport {\n\tDimensions,\n\tModal,\n\tTouchableOpacity,\n\tStyleSheet,\n\tView,\n\tImage,\n} from \"react-native\";\nimport ImageViewer from \"react-native-image-zoom-viewer\";\nimport { Icon } from \"@rneui/themed\";\nimport { StatusBarHeight, isVideo, get1400 } from \"../helper\";\nimport { FontAwesome } from \"./Icon\";\nimport { SharingTools } from \"./SharingTools\";\nimport { VideoPopup } from \"./VideoPopup\";\nimport { ProfilePic } from \"./ProfilePic\";\nimport { LoadingIndicator } from \"./\";\n\nconst SCREEN_WIDTH = Dimensions.get(\"window\").width;\nconst SCREEN_HEIGHT = Dimensions.get(\"window\").height;\nconst MAX_IMAGE_HEIGHT = SCREEN_HEIGHT * 0.65;\n\nclass ImagePopup extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tindex: 0,\n\t\t\timages: [],\n\t\t\tshowFullscreenVideo: false,\n\t\t\tcurrentVideoUrl: \"\",\n\t\t\timageDimensions: {},\n\t\t\tisLoadingDimensions: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.setupUrls();\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tconst { visible, index } = this.props;\n\t\tif (!prevProps.visible && visible) this.setupUrls();\n\t\tif (prevProps.index !== index) this.setState({ index });\n\t}\n\n\tsetupUrls = async () => {\n\t\tif (!this.props.images) return;\n\n\t\tconst images = this.props.images.map((image) => {\n\t\t\tif (typeof image === \"string\") {\n\t\t\t\treturn {\n\t\t\t\t\turl: get1400(image),\n\t\t\t\t\toriginal: image,\n\t\t\t\t\tisVideo: isVideo(image),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\turl: get1400(image?.uri),\n\t\t\t\toriginal: image?.uri,\n\t\t\t\tisVideo: isVideo(image?.uri),\n\t\t\t\tdate: image?.date,\n\t\t\t\tuser: image?.user,\n\t\t\t\tcaption: image?.caption,\n\t\t\t};\n\t\t});\n\n\t\tthis.setState({ isLoadingDimensions: true });\n\n\t\tconst dimensions = {};\n\t\tawait Promise.all(\n\t\t\timages.map(async (image) => {\n\t\t\t\tif (!image.url) return;\n\t\t\t\ttry {\n\t\t\t\t\tconst { width, height } = await new Promise((resolve, reject) => {\n\t\t\t\t\t\tImage.getSize(\n\t\t\t\t\t\t\timage.url,\n\t\t\t\t\t\t\t(w, h) => resolve({ width: w, height: h }),\n\t\t\t\t\t\t\treject,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t\tdimensions[image.url] = { width, height };\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.log(\"Failed to get dimensions for\", image.url, err);\n\t\t\t\t\tdimensions[image.url] = {\n\t\t\t\t\t\twidth: SCREEN_WIDTH,\n\t\t\t\t\t\theight: SCREEN_HEIGHT,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tthis.setState({\n\t\t\timages,\n\t\t\tindex: this.state.index || this.props.index || 0,\n\t\t\timageDimensions: dimensions,\n\t\t\tisLoadingDimensions: false,\n\t\t});\n\t};\n\n\tonChange = (index) => {\n\t\tthis.setState({ index });\n\t};\n\n\tscrollTo(index) {\n\t\tthis.setState({\n\t\t\tindex,\n\t\t});\n\t}\n\n\ttoggleFullscreenVideo = (url) => {\n\t\tif (typeof url !== \"string\") url = \"\";\n\t\tthis.setState({\n\t\t\tshowFullscreenVideo: url.length > 0,\n\t\t\tcurrentVideoUrl: url,\n\t\t});\n\t};\n\n\trenderClose() {\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={styles.menuIconContainer}\n\t\t\t\tonPress={this.props.onClose}\n\t\t\t\tactiveOpacity={0.6}\n\t\t\t>\n\t\t\t\t<FontAwesome name=\"x\" style={[styles.menuIcon]} />\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n\n\trenderImageFooter = (media) => {\n\t\tif (!media.user || !media.date) return null;\n\n\t\tlet dateText, timeText;\n\t\tif (!_.isNil(media.date)) {\n\t\t\tconst imageDate = moment(media.date);\n\t\t\tdateText = imageDate.format(\"MMMM D, YYYY\");\n\t\t\ttimeText = imageDate.format(\"hh:mm A\");\n\t\t}\n\n\t\treturn (\n\t\t\t<View style={styles.imageInfoContainer}>\n\t\t\t\t<ProfilePic Diameter={36} ProfilePic={media?.user?.profilePic} />\n\t\t\t\t<View style={styles.imageTextContainer}>\n\t\t\t\t\t<Text style={styles.imageTextName}>{media?.user?.displayName}</Text>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tnumberOfLines={2}\n\t\t\t\t\t\tstyle={styles.iamgeTextDate}\n\t\t\t\t\t>{`Uploaded ${dateText} • ${timeText}`}</Text>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t);\n\t};\n\n\trenderCaption = (media) => {\n\t\tif (!media.caption) return null;\n\n\t\treturn (\n\t\t\t<View style={styles.captionContainer}>\n\t\t\t\t<Text numberOfLines={3} style={styles.captionText}>\n\t\t\t\t\t{media.caption}\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t);\n\t};\n\n\tgetImageDimensions = (media) => {\n\t\tconst cachedDimensions = this.state.imageDimensions[media?.url] || {\n\t\t\twidth: SCREEN_WIDTH,\n\t\t\theight: SCREEN_HEIGHT,\n\t\t};\n\n\t\tconst aspectRatio = cachedDimensions.width / cachedDimensions.height;\n\t\tlet imageWidth = SCREEN_WIDTH;\n\t\tlet imageHeight = imageWidth / aspectRatio;\n\n\t\t// Cap at 70% of screen height\n\t\tif (imageHeight > MAX_IMAGE_HEIGHT) {\n\t\t\timageHeight = MAX_IMAGE_HEIGHT;\n\t\t\timageWidth = imageHeight * aspectRatio;\n\t\t}\n\n\t\treturn { imageWidth, imageHeight };\n\t};\n\n\trenderImage = (props) => {\n\t\tconst media = this.state.images.find(\n\t\t\t(image) => image.url === props.source.uri,\n\t\t);\n\t\tconst isVideoMedia = !_.isNil(media) && media.isVideo;\n\t\tconst { imageWidth, imageHeight } = this.getImageDimensions(media);\n\n\t\treturn (\n\t\t\t<View style={styles.imageContainer}>\n\t\t\t\t<Image\n\t\t\t\t\tsource={{ uri: media?.url }}\n\t\t\t\t\tstyle={{ width: imageWidth, height: imageHeight }}\n\t\t\t\t\tresizeMode=\"contain\"\n\t\t\t\t/>\n\t\t\t\t{isVideoMedia && (\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.videoOverlay,\n\t\t\t\t\t\t\t{ width: imageWidth, height: imageHeight },\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\tonPress={this.toggleFullscreenVideo.bind(this, media.original)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tname=\"play\"\n\t\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\t\ticonStyle={styles.videoPlayIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t</View>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t};\n\n\trenderVideoPlayerPopup() {\n\t\tconst { showFullscreenVideo, currentVideoUrl } = this.state;\n\t\tif (!currentVideoUrl) return;\n\n\t\treturn (\n\t\t\t<VideoPopup\n\t\t\t\turi={currentVideoUrl}\n\t\t\t\tvisible={showFullscreenVideo}\n\t\t\t\tonClose={this.toggleFullscreenVideo}\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderBottomContent = () => {\n\t\tconst { index, images } = this.state;\n\t\tconst media = images[index];\n\n\t\tif (!media) return null;\n\n\t\tconst hasCaption = !_.isNil(media.caption);\n\t\tconst hasUserInfo = !_.isNil(media.user) || !_.isNil(media.date);\n\n\t\tif (!hasCaption && !hasUserInfo) return null;\n\n\t\t// Calculate where the image ends (for caption positioning)\n\t\tconst { imageHeight } = this.getImageDimensions(media);\n\t\tconst imageTop = (SCREEN_HEIGHT - imageHeight) / 2;\n\t\tconst imageBottom = imageTop + imageHeight;\n\t\tconst captionTop = imageBottom + 16;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{/* Caption positioned below the image */}\n\t\t\t\t{hasCaption && (\n\t\t\t\t\t<View style={[styles.captionWrapper, { top: captionTop }]}>\n\t\t\t\t\t\t{this.renderCaption(media)}\n\t\t\t\t\t</View>\n\t\t\t\t)}\n\n\t\t\t\t{/* User info anchored to bottom of screen */}\n\t\t\t\t{hasUserInfo && (\n\t\t\t\t\t<View style={styles.userInfoWrapper}>\n\t\t\t\t\t\t{this.renderImageFooter(media)}\n\t\t\t\t\t</View>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\trender() {\n\t\tconst { visible, onClose } = this.props;\n\t\tconst { index, images, isLoadingDimensions } = this.state;\n\n\t\tif (_.isEmpty(images)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (isLoadingDimensions) {\n\t\t\treturn (\n\t\t\t\t<Modal\n\t\t\t\t\tvisible={visible}\n\t\t\t\t\tanimationType=\"slide\"\n\t\t\t\t\tonRequestClose={onClose}\n\t\t\t\t\tstyle={styles.modal}\n\t\t\t\t>\n\t\t\t\t\t<LoadingIndicator visible={true} />\n\t\t\t\t</Modal>\n\t\t\t);\n\t\t}\n\n\t\tconst imagesWithSizes = images.map((image) => {\n\t\t\treturn {\n\t\t\t\t...image,\n\t\t\t\twidth: SCREEN_WIDTH,\n\t\t\t\theight: SCREEN_HEIGHT,\n\t\t\t};\n\t\t});\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tvisible={visible}\n\t\t\t\tanimationType=\"slide\"\n\t\t\t\tonRequestClose={onClose}\n\t\t\t\tstyle={styles.modal}\n\t\t\t>\n\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t{/* Full screen image viewer */}\n\t\t\t\t\t<ImageViewer\n\t\t\t\t\t\tstyle={styles.imageViewer}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\t\tonSwipeDown={onClose}\n\t\t\t\t\t\tenableSwipeDown\n\t\t\t\t\t\timageUrls={imagesWithSizes}\n\t\t\t\t\t\tsaveToLocalByLongPress={false}\n\t\t\t\t\t\trenderImage={this.renderImage}\n\t\t\t\t\t\tbackgroundColor=\"#000\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{/* Absolutely positioned bottom content */}\n\t\t\t\t\t{this.renderBottomContent()}\n\n\t\t\t\t\t{/* Overlay controls */}\n\t\t\t\t\t{this.renderClose()}\n\t\t\t\t\t<SharingTools uri={images[index]?.original} />\n\t\t\t\t</View>\n\t\t\t\t{this.renderVideoPlayerPopup()}\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tmodal: {\n\t\tbackgroundColor: \"#000\",\n\t},\n\tcontainer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"#000\",\n\t},\n\timageViewer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"#000\",\n\t},\n\timageContainer: {\n\t\tflex: 1,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n\tcaptionWrapper: {\n\t\tposition: \"absolute\",\n\t\tleft: 16,\n\t\tright: 16,\n\t\tzIndex: 10,\n\t},\n\tuserInfoWrapper: {\n\t\tposition: \"absolute\",\n\t\tbottom: 40, // Safe area padding\n\t\tleft: 16,\n\t\tright: 16,\n\t\tzIndex: 10,\n\t},\n\tmenuIconContainer: {\n\t\tposition: \"absolute\",\n\t\ttop: StatusBarHeight(0),\n\t\tright: 0,\n\t\twidth: 55,\n\t\theight: 55,\n\t\tzIndex: 3,\n\t},\n\tmenuIcon: {\n\t\tfontSize: 25,\n\t\tpadding: 15,\n\t\twidth: 55,\n\t\ttextAlign: \"center\",\n\t\tcolor: \"#fff\",\n\t\tzIndex: 3,\n\t},\n\tvideoOverlay: {\n\t\tposition: \"absolute\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tvideoPlayIcon: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 30,\n\t\ttextShadowColor: \"rgba(0,0,0,0.3)\",\n\t\ttextShadowOffset: { width: 2, height: 2 },\n\t},\n\timageInfoContainer: {\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 12,\n\t\tpaddingVertical: 12,\n\t\tgap: 4,\n\t\tborderRadius: 8,\n\t\talignItems: \"center\",\n\t},\n\timageTextContainer: {\n\t\tmarginLeft: 12,\n\t\tflexDirection: \"column\",\n\t\tgap: 4,\n\t\tflex: 1,\n\t\tjustifyContent: \"space-around\",\n\t},\n\timageTextName: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 14,\n\t\tcolor: \"#fff\",\n\t},\n\tiamgeTextDate: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 12,\n\t\tcolor: \"rgba(255, 255, 255, 0.8)\",\n\t},\n\tcaptionContainer: {\n\t\tborderRadius: 16,\n\t\tpadding: 0,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tcaptionText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 15,\n\t\tcolor: \"#fff\",\n\t\ttextAlign: \"center\",\n\t\tlineHeight: 20,\n\t},\n});\n\nexport { ImagePopup };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,6CAA6C;AAClE,OAAOC,CAAC,MAAM,QAAQ;AACtB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SACCC,UAAU,EACVC,KAAK,EACLC,gBAAgB,EAChBC,UAAU,EACVC,IAAI,EACJC,KAAK,QACC,cAAc;AACrB,OAAOC,WAAW,MAAM,gCAAgC;AACxD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,eAAe,EAAEC,OAAO,EAAEC,OAAO,QAAQ,WAAW;AAC7D,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,gBAAgB,QAAQ,IAAI;AAErC,MAAMC,YAAY,GAAGhB,UAAU,CAACiB,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;AACnD,MAAMC,aAAa,GAAGnB,UAAU,CAACiB,GAAG,CAAC,QAAQ,CAAC,CAACG,MAAM;AACrD,MAAMC,gBAAgB,GAAGF,aAAa,GAAG,IAAI;AAE7C,MAAMG,UAAU,SAAS1B,SAAS,CAAC;EAClC2B,WAAWA,CAACC,MAAK,EAAE;IAClB,KAAK,CAACA,MAAK,CAAC;IAACC,eAAA,oBAqBF,YAAY;MACvB,IAAI,C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C,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,GAAG,EAAE,CAAC;IACNC,YAAY,EAAE,CAAC;IACfhB,UAAU,EAAE;EACb,CAAC;EACDpE,kBAAkB,EAAE;IACnBqF,UAAU,EAAE,EAAE;IACdL,aAAa,EAAE,QAAQ;IACvBG,GAAG,EAAE,CAAC;IACNjB,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EACjB,CAAC;EACDlE,aAAa,EAAE;IACdqF,UAAU,EAAE,aAAa;IACzBZ,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE;EACR,CAAC;EACDzE,aAAa,EAAE;IACdkF,UAAU,EAAE,YAAY;IACxBZ,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE;EACR,CAAC;EACDxE,gBAAgB,EAAE;IACjB+E,YAAY,EAAE,EAAE;IAChBT,OAAO,EAAE,CAAC;IACVP,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EACjB,CAAC;EACD7D,WAAW,EAAE;IACZgF,UAAU,EAAE,YAAY;IACxBZ,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE,MAAM;IACbD,SAAS,EAAE,QAAQ;IACnBW,UAAU,EAAE;EACb;AACD,CAAC,CAAC;AAEF,SAASrI,UAAU","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import React, { Component } from
|
|
5
|
-
import { View,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View, StyleSheet } from "react-native";
|
|
6
|
+
import { Text } from "./Text";
|
|
7
|
+
import { InlineButton } from "./InlineButton";
|
|
8
|
+
import { Spinner } from "./Spinner";
|
|
8
9
|
class ImageUploadProgress extends Component {
|
|
9
10
|
constructor(...args) {
|
|
10
11
|
super(...args);
|
|
@@ -45,22 +46,22 @@ class ImageUploadProgress extends Component {
|
|
|
45
46
|
}
|
|
46
47
|
const styles = StyleSheet.create({
|
|
47
48
|
container: {
|
|
48
|
-
alignItems:
|
|
49
|
-
justifyContent:
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center"
|
|
50
51
|
},
|
|
51
52
|
spinner: {
|
|
52
53
|
flex: 0
|
|
53
54
|
},
|
|
54
55
|
uploadProgressText: {
|
|
55
|
-
textAlign:
|
|
56
|
-
fontFamily:
|
|
56
|
+
textAlign: "center",
|
|
57
|
+
fontFamily: "sf-semibold",
|
|
57
58
|
fontSize: 12
|
|
58
59
|
},
|
|
59
60
|
retryButton: {
|
|
60
61
|
marginTop: 10
|
|
61
62
|
},
|
|
62
63
|
retryText: {
|
|
63
|
-
fontFamily:
|
|
64
|
+
fontFamily: "sf-semibold",
|
|
64
65
|
fontSize: 12
|
|
65
66
|
}
|
|
66
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","
|
|
1
|
+
{"version":3,"names":["React","Component","View","StyleSheet","Text","InlineButton","Spinner","ImageUploadProgress","constructor","args","_defineProperty","imageUri","uploadUri","props","uploader","retryUpload","render","color","image","style","progressTextStyle","retryTextStyle","uploadProgress","allowRetry","createElement","styles","container","spinner","uploadProgressText","onPress","onRetryUpload","touchableStyle","retryButton","retryText","create","alignItems","justifyContent","flex","textAlign","fontFamily","fontSize","marginTop"],"sources":["ImageUploadProgress.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, StyleSheet } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { InlineButton } from \"./InlineButton\";\nimport { Spinner } from \"./Spinner\";\n\nclass ImageUploadProgress extends Component {\n\tonRetryUpload = (imageUri, uploadUri) => {\n\t\tthis.props.uploader.retryUpload(imageUri, uploadUri);\n\t};\n\n\trender() {\n\t\tconst { color, image, style, progressTextStyle, retryTextStyle } =\n\t\t\tthis.props;\n\t\tconst { imageUri, uploadUri, uploadProgress, allowRetry } = image;\n\n\t\treturn (\n\t\t\t<View style={[styles.container, style]}>\n\t\t\t\t<Spinner style={styles.spinner} />\n\t\t\t\t<Text style={[styles.uploadProgressText, progressTextStyle, { color }]}>\n\t\t\t\t\t{uploadProgress}\n\t\t\t\t</Text>\n\t\t\t\t{allowRetry && (\n\t\t\t\t\t<InlineButton\n\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\tonPress={() => this.onRetryUpload(imageUri, uploadUri)}\n\t\t\t\t\t\ttouchableStyle={styles.retryButton}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Text style={[styles.retryText, retryTextStyle]}>Retry</Text>\n\t\t\t\t\t</InlineButton>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tspinner: {\n\t\tflex: 0,\n\t},\n\tuploadProgressText: {\n\t\ttextAlign: \"center\",\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 12,\n\t},\n\tretryButton: {\n\t\tmarginTop: 10,\n\t},\n\tretryText: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 12,\n\t},\n});\n\nexport default ImageUploadProgress;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,YAAY,QAAQ,gBAAgB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