@plusscommunities/pluss-core-app 6.1.7 → 6.1.8-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 +21 -28
- 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 +36 -34
- 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 +253 -0
- package/dist/module/components/DocumentUploader.js.map +1 -0
- 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 +237 -77
- 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 +22 -13
- 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 +32 -32
- package/dist/module/components/MediaPlayer.js.map +1 -1
- package/dist/module/components/MiddlePopup.js +9 -9
- package/dist/module/components/MiddlePopup.js.map +1 -1
- package/dist/module/components/PDFPopup.js +36 -36
- package/dist/module/components/PDFPopup.js.map +1 -1
- package/dist/module/components/PlussChat.js +234 -146
- package/dist/module/components/PlussChat.js.map +1 -1
- package/dist/module/components/PlussChatMessage.js +75 -38
- 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 +29 -28
- 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 -57
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +90 -58
- 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 +6 -1
- package/dist/module/config.js.map +1 -1
- package/dist/module/constants.js +3 -3
- 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 +6 -6
- 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 +2 -2
- 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 +4 -1
- 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 +19 -27
- 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 +363 -309
- package/src/components/CommentSection.js +974 -782
- package/src/components/ConfirmPopup.js +141 -110
- package/src/components/ConfirmationPopup.js +80 -69
- package/src/components/DocumentUploader.js +255 -0
- 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 -206
- package/src/components/ImageUploadProgress.js +49 -41
- package/src/components/ImageUploader.js +23 -13
- 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 +50 -32
- package/src/components/PDFPopup.js +198 -159
- package/src/components/PlussChat.js +1271 -986
- package/src/components/PlussChatMessage.js +330 -262
- 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 +136 -122
- 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 -57
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +442 -358
- package/src/components/react-native-expo-image-cropper/ImageCropOverlay.js +420 -324
- package/src/config.js +5 -0
- package/src/constants.js +8 -8
- package/src/helper.js +469 -438
- package/src/index.js +24 -12
- package/src/js/images/detectFaces.js +27 -20
- 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 +2 -2
- 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 -6
- package/src/fonts/pluss60-icons.json +0 -1097
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import _ from
|
|
3
|
-
import { TouchableOpacity,
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { TouchableOpacity, View } from "react-native";
|
|
4
|
+
import { Text } from "./Text";
|
|
5
|
+
import { connect } from "react-redux";
|
|
6
|
+
import moment from "moment";
|
|
7
|
+
import { COLOUR_GREEN, TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState, getLightBrandingColourFromState } from "../colours";
|
|
8
|
+
import { Services } from "../config";
|
|
9
|
+
import { ProfilePic } from "./ProfilePic";
|
|
10
|
+
import { InlineButton } from "./InlineButton";
|
|
11
|
+
import { Spinner } from "./Spinner";
|
|
12
|
+
import { followerActions } from "../apis";
|
|
13
|
+
import { addFollower } from "../actions";
|
|
13
14
|
class UserListing extends Component {
|
|
14
15
|
constructor(props) {
|
|
15
16
|
super(props);
|
|
@@ -21,7 +22,7 @@ class UserListing extends Component {
|
|
|
21
22
|
const {
|
|
22
23
|
hidden
|
|
23
24
|
} = this.props.me;
|
|
24
|
-
if (hidden && _.includes(hidden,
|
|
25
|
+
if (hidden && _.includes(hidden, "people")) return;
|
|
25
26
|
if (this.props.onPress) {
|
|
26
27
|
this.props.onPress();
|
|
27
28
|
return;
|
|
@@ -35,7 +36,7 @@ class UserListing extends Component {
|
|
|
35
36
|
if (_.isUndefined(user.id)) {
|
|
36
37
|
user.id = user.userId;
|
|
37
38
|
}
|
|
38
|
-
Services.navigation.navigate(
|
|
39
|
+
Services.navigation.navigate("profile", {
|
|
39
40
|
user
|
|
40
41
|
});
|
|
41
42
|
}
|
|
@@ -58,23 +59,23 @@ class UserListing extends Component {
|
|
|
58
59
|
}
|
|
59
60
|
getTimeText(input) {
|
|
60
61
|
const gug = moment.unix(input);
|
|
61
|
-
if (gug.isBefore(moment().local().startOf(
|
|
62
|
-
return gug.format(
|
|
62
|
+
if (gug.isBefore(moment().local().startOf("d"))) {
|
|
63
|
+
return gug.format("D MMM");
|
|
63
64
|
}
|
|
64
|
-
return gug.format(
|
|
65
|
+
return gug.format("h:mma");
|
|
65
66
|
}
|
|
66
67
|
getProfilePic() {
|
|
67
68
|
if (this.props.user.profilePic == null) return null;
|
|
68
69
|
let profilePic = this.props.user.profilePic;
|
|
69
70
|
if (!_.isUndefined(this.props.user.profilePicThumb) && !_.isEmpty(this.props.user.profilePicThumb)) {
|
|
70
71
|
profilePic = this.props.user.profilePicThumb;
|
|
71
|
-
} else if (this.props.user.profilePic.indexOf(
|
|
72
|
-
profilePic = profilePic.replace(
|
|
72
|
+
} else if (this.props.user.profilePic.indexOf(".amazonaws.com/1400/") > -1) {
|
|
73
|
+
profilePic = profilePic.replace("/1400/", "/300/");
|
|
73
74
|
}
|
|
74
75
|
return profilePic;
|
|
75
76
|
}
|
|
76
77
|
getLastMessage(chat) {
|
|
77
|
-
if (typeof chat.lastMessage ===
|
|
78
|
+
if (typeof chat.lastMessage === "string") {
|
|
78
79
|
return chat.lastMessage;
|
|
79
80
|
}
|
|
80
81
|
// TODO recognise user name of last message
|
|
@@ -84,16 +85,16 @@ class UserListing extends Component {
|
|
|
84
85
|
if (this.props.user.privateChat) {
|
|
85
86
|
return /*#__PURE__*/React.createElement(View, {
|
|
86
87
|
style: {
|
|
87
|
-
justifyContent:
|
|
88
|
+
justifyContent: "flex-start"
|
|
88
89
|
}
|
|
89
90
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
90
91
|
style: [styles.chatTimeStamp, this.props.user.unread > 0 && {
|
|
91
92
|
color: TEXT_DARK,
|
|
92
|
-
fontFamily:
|
|
93
|
+
fontFamily: "sf-bold"
|
|
93
94
|
}]
|
|
94
95
|
}, this.getTimeText(this.props.user.Changed)), /*#__PURE__*/React.createElement(View, {
|
|
95
96
|
style: [{
|
|
96
|
-
flexDirection:
|
|
97
|
+
flexDirection: "row-reverse",
|
|
97
98
|
marginTop: 2
|
|
98
99
|
}, this.props.user.unread === 0 && {
|
|
99
100
|
opacity: 0
|
|
@@ -192,27 +193,27 @@ const styles = {
|
|
|
192
193
|
listItem: {
|
|
193
194
|
paddingVertical: 8,
|
|
194
195
|
paddingHorizontal: 16,
|
|
195
|
-
justifyContent:
|
|
196
|
-
flexDirection:
|
|
197
|
-
position:
|
|
196
|
+
justifyContent: "flex-start",
|
|
197
|
+
flexDirection: "row",
|
|
198
|
+
position: "relative"
|
|
198
199
|
},
|
|
199
200
|
listItemTextContainer: {
|
|
200
201
|
flex: 1,
|
|
201
|
-
flexDirection:
|
|
202
|
-
justifyContent:
|
|
202
|
+
flexDirection: "column",
|
|
203
|
+
justifyContent: "space-around",
|
|
203
204
|
paddingLeft: 16
|
|
204
205
|
},
|
|
205
206
|
contactName: {
|
|
206
207
|
fontSize: 15,
|
|
207
|
-
fontFamily:
|
|
208
|
-
backgroundColor:
|
|
208
|
+
fontFamily: "sf-semibold",
|
|
209
|
+
backgroundColor: "rgba(255,255,255,0)",
|
|
209
210
|
color: TEXT_DARK
|
|
210
211
|
},
|
|
211
212
|
statusText: {
|
|
212
|
-
position:
|
|
213
|
+
position: "absolute",
|
|
213
214
|
top: 0,
|
|
214
215
|
left: 82,
|
|
215
|
-
fontFamily:
|
|
216
|
+
fontFamily: "sf-semibold",
|
|
216
217
|
fontSize: 12,
|
|
217
218
|
color: TEXT_LIGHT
|
|
218
219
|
},
|
|
@@ -220,10 +221,10 @@ const styles = {
|
|
|
220
221
|
flex: 1
|
|
221
222
|
},
|
|
222
223
|
alignCenter: {
|
|
223
|
-
alignItems:
|
|
224
|
+
alignItems: "center"
|
|
224
225
|
},
|
|
225
226
|
flexRowReverse: {
|
|
226
|
-
flexDirection:
|
|
227
|
+
flexDirection: "row-reverse"
|
|
227
228
|
},
|
|
228
229
|
friendsButton: {
|
|
229
230
|
width: 100
|
|
@@ -231,25 +232,25 @@ const styles = {
|
|
|
231
232
|
counter: {
|
|
232
233
|
borderRadius: 10,
|
|
233
234
|
height: 20,
|
|
234
|
-
justifyContent:
|
|
235
|
+
justifyContent: "center",
|
|
235
236
|
minWidth: 20,
|
|
236
237
|
paddingHorizontal: 4,
|
|
237
238
|
backgroundColor: COLOUR_GREEN
|
|
238
239
|
},
|
|
239
240
|
counterText: {
|
|
240
|
-
color:
|
|
241
|
+
color: "#fff",
|
|
241
242
|
fontSize: 12,
|
|
242
|
-
fontFamily:
|
|
243
|
-
textAlign:
|
|
243
|
+
fontFamily: "sf-semibold",
|
|
244
|
+
textAlign: "center"
|
|
244
245
|
},
|
|
245
246
|
chatTimeStamp: {
|
|
246
247
|
fontSize: 10,
|
|
247
|
-
fontFamily:
|
|
248
|
+
fontFamily: "sf-semibold",
|
|
248
249
|
color: TEXT_LIGHT
|
|
249
250
|
},
|
|
250
251
|
chatLastMessage: {
|
|
251
252
|
fontSize: 13,
|
|
252
|
-
fontFamily:
|
|
253
|
+
fontFamily: "sf-medium",
|
|
253
254
|
color: TEXT_LIGHT,
|
|
254
255
|
marginRight: 5
|
|
255
256
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","TouchableOpacity","Text","View","connect","moment","COLOUR_GREEN","TEXT_DARK","TEXT_LIGHT","getMainBrandingColourFromState","getLightBrandingColourFromState","Services","ProfilePic","InlineButton","Spinner","followerActions","addFollower","UserListing","constructor","props","state","pending","onPress","hidden","me","includes","user","isUndefined","key","userId","id","navigation","navigate","onFollowUser","userToSave","profilePic","displayName","setState","myId","then","catch","getTimeText","input","gug","unix","isBefore","local","startOf","format","getProfilePic","profilePicThumb","isEmpty","indexOf","replace","getLastMessage","chat","lastMessage","text","renderFollowButton","privateChat","createElement","style","justifyContent","styles","chatTimeStamp","unread","color","fontFamily","Changed","flexDirection","marginTop","opacity","counter","counterText","showFriendsButton","isFollowing","colourBrandingLight","friendsButton","textStyle","colourBrandingMain","disabled","borderColor","borderWidth","noText","size","bind","renderStatusText","statusText","render","containerStyle","activeOpacity","onPressDisabled","listItem","listItemStyle","Diameter","fill","flexRowReverse","alignCenter","rightContent","listItemTextContainer","contactName","numberOfLines","chatLastMessage","subText","paddingVertical","paddingHorizontal","position","flex","paddingLeft","fontSize","backgroundColor","top","left","alignItems","width","borderRadius","height","minWidth","textAlign","marginRight","mapStateToProps"],"sources":["UserListing.js"],"sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport { TouchableOpacity, Text, View } from 'react-native';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\nimport { COLOUR_GREEN, TEXT_DARK, TEXT_LIGHT, getMainBrandingColourFromState, getLightBrandingColourFromState } from '../colours';\nimport { Services } from '../config';\nimport { ProfilePic } from './ProfilePic';\nimport { InlineButton } from './InlineButton';\nimport { Spinner } from './Spinner';\nimport { followerActions } from '../apis';\nimport { addFollower } from '../actions';\n\nclass UserListing extends Component {\n constructor(props) {\n super(props);\n this.state = { pending: false };\n }\n\n onPress() {\n const { hidden } = this.props.me;\n if (hidden && _.includes(hidden, 'people')) return;\n\n if (this.props.onPress) {\n this.props.onPress();\n return;\n }\n const user = { ...this.props.user };\n if (_.isUndefined(user.key)) {\n user.key = user.userId;\n }\n if (_.isUndefined(user.id)) {\n user.id = user.userId;\n }\n Services.navigation.navigate('profile', { user });\n }\n\n onFollowUser() {\n const userToSave = {\n profilePic: this.props.user.profilePic,\n displayName: this.props.user.displayName,\n id: this.props.user.id,\n };\n this.setState({ pending: true });\n followerActions\n .addFollower(userToSave, this.props.myId)\n .then(() => {\n this.props.addFollower(userToSave);\n })\n .catch(() => {\n this.setState({ pending: false });\n });\n }\n\n getTimeText(input) {\n const gug = moment.unix(input);\n if (\n gug.isBefore(\n moment()\n .local()\n .startOf('d'),\n )\n ) {\n return gug.format('D MMM');\n }\n return gug.format('h:mma');\n }\n\n getProfilePic() {\n if (this.props.user.profilePic == null) return null;\n let profilePic = this.props.user.profilePic;\n if (!_.isUndefined(this.props.user.profilePicThumb) && !_.isEmpty(this.props.user.profilePicThumb)) {\n profilePic = this.props.user.profilePicThumb;\n } else if (this.props.user.profilePic.indexOf('.amazonaws.com/1400/') > -1) {\n profilePic = profilePic.replace('/1400/', '/300/');\n }\n return profilePic;\n }\n\n getLastMessage(chat) {\n if (typeof chat.lastMessage === 'string') {\n return chat.lastMessage;\n }\n // TODO recognise user name of last message\n return chat.lastMessage.text;\n }\n\n renderFollowButton() {\n if (this.props.user.privateChat) {\n return (\n <View style={{ justifyContent: 'flex-start' }}>\n <Text style={[styles.chatTimeStamp, this.props.user.unread > 0 && { color: TEXT_DARK, fontFamily: 'sf-bold' }]}>\n {this.getTimeText(this.props.user.Changed)}\n </Text>\n <View style={[{ flexDirection: 'row-reverse', marginTop: 2 }, this.props.user.unread === 0 && { opacity: 0 }]}>\n <View style={styles.counter}>\n <Text style={styles.counterText}>{this.props.user.unread}</Text>\n </View>\n </View>\n </View>\n );\n }\n\n if (!this.props.showFriendsButton) {\n return null;\n }\n\n // self\n if (this.props.myId === this.props.user.id) {\n return null;\n }\n\n // already following\n if (this.props.isFollowing) {\n return (\n <InlineButton\n color={this.props.colourBrandingLight}\n style={styles.friendsButton}\n textStyle={{ color: this.props.colourBrandingMain }}\n disabled\n >\n Friends\n </InlineButton>\n );\n }\n\n // in process of following\n if (this.state.pending) {\n return (\n <InlineButton style={[styles.friendsButton, { borderColor: this.props.colourBrandingMain, borderWidth: 1 }]} disabled noText>\n <Spinner size=\"small\" color={this.props.colourBrandingMain} />\n </InlineButton>\n );\n }\n\n // not following yet\n return (\n <InlineButton\n onPress={this.onFollowUser.bind(this)}\n color=\"#fff\"\n style={[styles.friendsButton, { borderColor: this.props.colourBrandingMain, borderWidth: 1 }]}\n textStyle={{ color: this.props.colourBrandingMain }}\n >\n Add friend\n </InlineButton>\n );\n }\n\n renderStatusText() {\n if (!this.props.statusText) {\n return null;\n }\n return <Text style={styles.statusText}>{this.props.statusText}</Text>;\n }\n\n render() {\n return (\n <View style={this.props.containerStyle}>\n <TouchableOpacity activeOpacity={0.9} onPress={this.onPress.bind(this)} disabled={this.props.onPressDisabled}>\n <View style={[styles.listItem, this.props.listItemStyle]}>\n {this.renderStatusText()}\n <ProfilePic ProfilePic={this.getProfilePic()} Diameter={42} />\n <View style={[styles.fill, styles.flexRowReverse, styles.alignCenter]}>\n {this.props.rightContent}\n {this.renderFollowButton()}\n <View style={styles.fill}>\n <View style={styles.listItemTextContainer}>\n <Text style={styles.contactName} numberOfLines={1}>\n {this.props.user.displayName}\n </Text>\n {this.props.user.privateChat && (\n <Text style={styles.chatLastMessage} numberOfLines={1}>\n {this.getLastMessage(this.props.user)}\n </Text>\n )}\n {this.props.subText}\n </View>\n </View>\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n }\n}\n\nconst styles = {\n listItem: {\n paddingVertical: 8,\n paddingHorizontal: 16,\n justifyContent: 'flex-start',\n flexDirection: 'row',\n position: 'relative',\n },\n listItemTextContainer: {\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'space-around',\n paddingLeft: 16,\n },\n contactName: {\n fontSize: 15,\n fontFamily: 'sf-semibold',\n backgroundColor: 'rgba(255,255,255,0)',\n color: TEXT_DARK,\n },\n statusText: {\n position: 'absolute',\n top: 0,\n left: 82,\n fontFamily: 'sf-semibold',\n fontSize: 12,\n color: TEXT_LIGHT,\n },\n fill: {\n flex: 1,\n },\n alignCenter: {\n alignItems: 'center',\n },\n flexRowReverse: {\n flexDirection: 'row-reverse',\n },\n friendsButton: {\n width: 100,\n },\n counter: {\n borderRadius: 10,\n height: 20,\n justifyContent: 'center',\n minWidth: 20,\n paddingHorizontal: 4,\n backgroundColor: COLOUR_GREEN,\n },\n counterText: {\n color: '#fff',\n fontSize: 12,\n fontFamily: 'sf-semibold',\n textAlign: 'center',\n },\n chatTimeStamp: {\n fontSize: 10,\n fontFamily: 'sf-semibold',\n color: TEXT_LIGHT,\n },\n chatLastMessage: {\n fontSize: 13,\n fontFamily: 'sf-medium',\n color: TEXT_LIGHT,\n marginRight: 5,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n me: state.user,\n colourBrandingMain: getMainBrandingColourFromState(state),\n colourBrandingLight: getLightBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, { addFollower })(UserListing);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,gBAAgB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SA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8BAA8B,CAACW,KAAK,CAAC;IACzDwD,mBAAmB,EAAElE,+BAA+B,CAACU,KAAK;EAC5D,CAAC;AACH,CAAC;AAED,eAAehB,OAAO,CAACoH,eAAe,EAAE;EAAExG;AAAY,CAAC,CAAC,CAACC,WAAW,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","_","TouchableOpacity","View","Text","connect","moment","COLOUR_GREEN","TEXT_DARK","TEXT_LIGHT","getMainBrandingColourFromState","getLightBrandingColourFromState","Services","ProfilePic","InlineButton","Spinner","followerActions","addFollower","UserListing","constructor","props","state","pending","onPress","hidden","me","includes","user","isUndefined","key","userId","id","navigation","navigate","onFollowUser","userToSave","profilePic","displayName","setState","myId","then","catch","getTimeText","input","gug","unix","isBefore","local","startOf","format","getProfilePic","profilePicThumb","isEmpty","indexOf","replace","getLastMessage","chat","lastMessage","text","renderFollowButton","privateChat","createElement","style","justifyContent","styles","chatTimeStamp","unread","color","fontFamily","Changed","flexDirection","marginTop","opacity","counter","counterText","showFriendsButton","isFollowing","colourBrandingLight","friendsButton","textStyle","colourBrandingMain","disabled","borderColor","borderWidth","noText","size","bind","renderStatusText","statusText","render","containerStyle","activeOpacity","onPressDisabled","listItem","listItemStyle","Diameter","fill","flexRowReverse","alignCenter","rightContent","listItemTextContainer","contactName","numberOfLines","chatLastMessage","subText","paddingVertical","paddingHorizontal","position","flex","paddingLeft","fontSize","backgroundColor","top","left","alignItems","width","borderRadius","height","minWidth","textAlign","marginRight","mapStateToProps"],"sources":["UserListing.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TouchableOpacity, View } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport moment from \"moment\";\nimport {\n\tCOLOUR_GREEN,\n\tTEXT_DARK,\n\tTEXT_LIGHT,\n\tgetMainBrandingColourFromState,\n\tgetLightBrandingColourFromState,\n} from \"../colours\";\nimport { Services } from \"../config\";\nimport { ProfilePic } from \"./ProfilePic\";\nimport { InlineButton } from \"./InlineButton\";\nimport { Spinner } from \"./Spinner\";\nimport { followerActions } from \"../apis\";\nimport { addFollower } from \"../actions\";\n\nclass UserListing extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = { pending: false };\n\t}\n\n\tonPress() {\n\t\tconst { hidden } = this.props.me;\n\t\tif (hidden && _.includes(hidden, \"people\")) return;\n\n\t\tif (this.props.onPress) {\n\t\t\tthis.props.onPress();\n\t\t\treturn;\n\t\t}\n\t\tconst user = { ...this.props.user };\n\t\tif (_.isUndefined(user.key)) {\n\t\t\tuser.key = user.userId;\n\t\t}\n\t\tif (_.isUndefined(user.id)) {\n\t\t\tuser.id = user.userId;\n\t\t}\n\t\tServices.navigation.navigate(\"profile\", { user });\n\t}\n\n\tonFollowUser() {\n\t\tconst userToSave = {\n\t\t\tprofilePic: this.props.user.profilePic,\n\t\t\tdisplayName: this.props.user.displayName,\n\t\t\tid: this.props.user.id,\n\t\t};\n\t\tthis.setState({ pending: true });\n\t\tfollowerActions\n\t\t\t.addFollower(userToSave, this.props.myId)\n\t\t\t.then(() => {\n\t\t\t\tthis.props.addFollower(userToSave);\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tthis.setState({ pending: false });\n\t\t\t});\n\t}\n\n\tgetTimeText(input) {\n\t\tconst gug = moment.unix(input);\n\t\tif (gug.isBefore(moment().local().startOf(\"d\"))) {\n\t\t\treturn gug.format(\"D MMM\");\n\t\t}\n\t\treturn gug.format(\"h:mma\");\n\t}\n\n\tgetProfilePic() {\n\t\tif (this.props.user.profilePic == null) return null;\n\t\tlet profilePic = this.props.user.profilePic;\n\t\tif (\n\t\t\t!_.isUndefined(this.props.user.profilePicThumb) &&\n\t\t\t!_.isEmpty(this.props.user.profilePicThumb)\n\t\t) {\n\t\t\tprofilePic = this.props.user.profilePicThumb;\n\t\t} else if (\n\t\t\tthis.props.user.profilePic.indexOf(\".amazonaws.com/1400/\") > -1\n\t\t) {\n\t\t\tprofilePic = profilePic.replace(\"/1400/\", \"/300/\");\n\t\t}\n\t\treturn profilePic;\n\t}\n\n\tgetLastMessage(chat) {\n\t\tif (typeof chat.lastMessage === \"string\") {\n\t\t\treturn chat.lastMessage;\n\t\t}\n\t\t// TODO recognise user name of last message\n\t\treturn chat.lastMessage.text;\n\t}\n\n\trenderFollowButton() {\n\t\tif (this.props.user.privateChat) {\n\t\t\treturn (\n\t\t\t\t<View style={{ justifyContent: \"flex-start\" }}>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.chatTimeStamp,\n\t\t\t\t\t\t\tthis.props.user.unread > 0 && {\n\t\t\t\t\t\t\t\tcolor: TEXT_DARK,\n\t\t\t\t\t\t\t\tfontFamily: \"sf-bold\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.getTimeText(this.props.user.Changed)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t{ flexDirection: \"row-reverse\", marginTop: 2 },\n\t\t\t\t\t\t\tthis.props.user.unread === 0 && { opacity: 0 },\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={styles.counter}>\n\t\t\t\t\t\t\t<Text style={styles.counterText}>{this.props.user.unread}</Text>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t);\n\t\t}\n\n\t\tif (!this.props.showFriendsButton) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// self\n\t\tif (this.props.myId === this.props.user.id) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// already following\n\t\tif (this.props.isFollowing) {\n\t\t\treturn (\n\t\t\t\t<InlineButton\n\t\t\t\t\tcolor={this.props.colourBrandingLight}\n\t\t\t\t\tstyle={styles.friendsButton}\n\t\t\t\t\ttextStyle={{ color: this.props.colourBrandingMain }}\n\t\t\t\t\tdisabled\n\t\t\t\t>\n\t\t\t\t\tFriends\n\t\t\t\t</InlineButton>\n\t\t\t);\n\t\t}\n\n\t\t// in process of following\n\t\tif (this.state.pending) {\n\t\t\treturn (\n\t\t\t\t<InlineButton\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.friendsButton,\n\t\t\t\t\t\t{ borderColor: this.props.colourBrandingMain, borderWidth: 1 },\n\t\t\t\t\t]}\n\t\t\t\t\tdisabled\n\t\t\t\t\tnoText\n\t\t\t\t>\n\t\t\t\t\t<Spinner size=\"small\" color={this.props.colourBrandingMain} />\n\t\t\t\t</InlineButton>\n\t\t\t);\n\t\t}\n\n\t\t// not following yet\n\t\treturn (\n\t\t\t<InlineButton\n\t\t\t\tonPress={this.onFollowUser.bind(this)}\n\t\t\t\tcolor=\"#fff\"\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.friendsButton,\n\t\t\t\t\t{ borderColor: this.props.colourBrandingMain, borderWidth: 1 },\n\t\t\t\t]}\n\t\t\t\ttextStyle={{ color: this.props.colourBrandingMain }}\n\t\t\t>\n\t\t\t\tAdd friend\n\t\t\t</InlineButton>\n\t\t);\n\t}\n\n\trenderStatusText() {\n\t\tif (!this.props.statusText) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <Text style={styles.statusText}>{this.props.statusText}</Text>;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={this.props.containerStyle}>\n\t\t\t\t<TouchableOpacity\n\t\t\t\t\tactiveOpacity={0.9}\n\t\t\t\t\tonPress={this.onPress.bind(this)}\n\t\t\t\t\tdisabled={this.props.onPressDisabled}\n\t\t\t\t>\n\t\t\t\t\t<View style={[styles.listItem, this.props.listItemStyle]}>\n\t\t\t\t\t\t{this.renderStatusText()}\n\t\t\t\t\t\t<ProfilePic ProfilePic={this.getProfilePic()} Diameter={42} />\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={[styles.fill, styles.flexRowReverse, styles.alignCenter]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.rightContent}\n\t\t\t\t\t\t\t{this.renderFollowButton()}\n\t\t\t\t\t\t\t<View style={styles.fill}>\n\t\t\t\t\t\t\t\t<View style={styles.listItemTextContainer}>\n\t\t\t\t\t\t\t\t\t<Text style={styles.contactName} numberOfLines={1}>\n\t\t\t\t\t\t\t\t\t\t{this.props.user.displayName}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t{this.props.user.privateChat && (\n\t\t\t\t\t\t\t\t\t\t<Text style={styles.chatLastMessage} numberOfLines={1}>\n\t\t\t\t\t\t\t\t\t\t\t{this.getLastMessage(this.props.user)}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{this.props.subText}\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableOpacity>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tlistItem: {\n\t\tpaddingVertical: 8,\n\t\tpaddingHorizontal: 16,\n\t\tjustifyContent: \"flex-start\",\n\t\tflexDirection: \"row\",\n\t\tposition: \"relative\",\n\t},\n\tlistItemTextContainer: {\n\t\tflex: 1,\n\t\tflexDirection: \"column\",\n\t\tjustifyContent: \"space-around\",\n\t\tpaddingLeft: 16,\n\t},\n\tcontactName: {\n\t\tfontSize: 15,\n\t\tfontFamily: \"sf-semibold\",\n\t\tbackgroundColor: \"rgba(255,255,255,0)\",\n\t\tcolor: TEXT_DARK,\n\t},\n\tstatusText: {\n\t\tposition: \"absolute\",\n\t\ttop: 0,\n\t\tleft: 82,\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 12,\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tfill: {\n\t\tflex: 1,\n\t},\n\talignCenter: {\n\t\talignItems: \"center\",\n\t},\n\tflexRowReverse: {\n\t\tflexDirection: \"row-reverse\",\n\t},\n\tfriendsButton: {\n\t\twidth: 100,\n\t},\n\tcounter: {\n\t\tborderRadius: 10,\n\t\theight: 20,\n\t\tjustifyContent: \"center\",\n\t\tminWidth: 20,\n\t\tpaddingHorizontal: 4,\n\t\tbackgroundColor: COLOUR_GREEN,\n\t},\n\tcounterText: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 12,\n\t\tfontFamily: \"sf-semibold\",\n\t\ttextAlign: \"center\",\n\t},\n\tchatTimeStamp: {\n\t\tfontSize: 10,\n\t\tfontFamily: \"sf-semibold\",\n\t\tcolor: TEXT_LIGHT,\n\t},\n\tchatLastMessage: {\n\t\tfontSize: 13,\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 5,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tme: state.user,\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t\tcolourBrandingLight: getLightBrandingColourFromState(state),\n\t};\n};\n\nexport default connect(mapStateToProps, { addFollower })(UserListing);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SACCC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,8BAA8B,EAC9BC,+BAA+B,QACzB,YAAY;AACnB,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,eAAe,QAAQ,SAAS;AACzC,SAASC,WAAW,QAAQ,YAAY;AAExC,MAAMC,WAAW,SAASlB,SAAS,CAAC;EACnCmB,WAAWA,C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IACLY,IAAI,EAAE;EACP,CAAC;EACDV,WAAW,EAAE;IACZgB,UAAU,EAAE;EACb,CAAC;EACDjB,cAAc,EAAE;IACf3B,aAAa,EAAE;EAChB,CAAC;EACDQ,aAAa,EAAE;IACdqC,KAAK,EAAE;EACR,CAAC;EACD1C,OAAO,EAAE;IACR2C,YAAY,EAAE,EAAE;IAChBC,MAAM,EAAE,EAAE;IACVtD,cAAc,EAAE,QAAQ;IACxBuD,QAAQ,EAAE,EAAE;IACZZ,iBAAiB,EAAE,CAAC;IACpBK,eAAe,EAAExG;EAClB,CAAC;EACDmE,WAAW,EAAE;IACZP,KAAK,EAAE,MAAM;IACb2C,QAAQ,EAAE,EAAE;IACZ1C,UAAU,EAAE,aAAa;IACzBmD,SAAS,EAAE;EACZ,CAAC;EACDtD,aAAa,EAAE;IACd6C,QAAQ,EAAE,EAAE;IACZ1C,UAAU,EAAE,aAAa;IACzBD,KAAK,EAAE1D;EACR,CAAC;EACD8F,eAAe,EAAE;IAChBO,QAAQ,EAAE,EAAE;IACZ1C,UAAU,EAAE,WAAW;IACvBD,KAAK,EAAE1D,UAAU;IACjB+G,WAAW,EAAE;EACd;AACD,CAAC;AAED,MAAMC,eAAe,GAAIpG,KAAK,IAAK;EAClC,OAAO;IACNI,EAAE,EAAEJ,KAAK,CAACM,IAAI;IACdqD,kBAAkB,EAAEtE,8BAA8B,CAACW,KAAK,CAAC;IACzDwD,mBAAmB,EAAElE,+BAA+B,CAACU,KAAK;EAC3D,CAAC;AACF,CAAC;AAED,eAAehB,OAAO,CAACoH,eAAe,EAAE;EAAExG;AAAY,CAAC,CAAC,CAACC,WAAW,CAAC","ignoreList":[]}
|
|
@@ -1,19 +1,19 @@
|
|
|
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 { Platform, View, Modal, TouchableOpacity, StyleSheet } from
|
|
6
|
-
import * as ScreenOrientation from
|
|
7
|
-
import { StatusBarHeight, getCompressed, imageExists } from
|
|
8
|
-
import {
|
|
9
|
-
import { SharingTools } from
|
|
10
|
-
import MediaPlayer from
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { Platform, View, Modal, TouchableOpacity, StyleSheet } from "react-native";
|
|
6
|
+
import * as ScreenOrientation from "expo-screen-orientation";
|
|
7
|
+
import { StatusBarHeight, getCompressed, imageExists } from "../helper";
|
|
8
|
+
import { FontAwesome } from "./Icon";
|
|
9
|
+
import { SharingTools } from "./SharingTools";
|
|
10
|
+
import MediaPlayer from "./MediaPlayer";
|
|
11
11
|
class VideoPopup extends Component {
|
|
12
12
|
constructor(props) {
|
|
13
13
|
super(props);
|
|
14
14
|
_defineProperty(this, "UNSAFE_componentWillMount", async () => {
|
|
15
15
|
this.checkCompressed(this.props.uri);
|
|
16
|
-
await ScreenOrientation.lockAsync(Platform.OS ===
|
|
16
|
+
await ScreenOrientation.lockAsync(Platform.OS === "ios" ? ScreenOrientation.OrientationLock.DEFAULT : ScreenOrientation.OrientationLock.ALL);
|
|
17
17
|
});
|
|
18
18
|
_defineProperty(this, "componentWillUnmount", async () => {
|
|
19
19
|
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
|
|
@@ -27,7 +27,7 @@ class VideoPopup extends Component {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
this.state = {
|
|
30
|
-
uri:
|
|
30
|
+
uri: "",
|
|
31
31
|
isFullScreen: false
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -40,8 +40,8 @@ class VideoPopup extends Component {
|
|
|
40
40
|
style: styles.menuIconContainer,
|
|
41
41
|
onPress: this.props.onClose,
|
|
42
42
|
activeOpacity: 0.6
|
|
43
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
-
name: "
|
|
43
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
44
|
+
name: "x",
|
|
45
45
|
style: styles.menuIcon
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
@@ -73,10 +73,10 @@ class VideoPopup extends Component {
|
|
|
73
73
|
} = this.props;
|
|
74
74
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
75
75
|
visible: visible,
|
|
76
|
-
animationType: animationType ||
|
|
76
|
+
animationType: animationType || "fade",
|
|
77
77
|
onRequestClose: onClose,
|
|
78
78
|
style: [styles.container, style],
|
|
79
|
-
supportedOrientations: [
|
|
79
|
+
supportedOrientations: ["portrait", "landscape"]
|
|
80
80
|
}, this.renderPlayer(), !isFullScreen && this.renderClose(), !isFullScreen && /*#__PURE__*/React.createElement(SharingTools, {
|
|
81
81
|
uri: this.props.uri
|
|
82
82
|
}));
|
|
@@ -84,10 +84,10 @@ class VideoPopup extends Component {
|
|
|
84
84
|
}
|
|
85
85
|
const styles = StyleSheet.create({
|
|
86
86
|
container: {
|
|
87
|
-
backgroundColor:
|
|
87
|
+
backgroundColor: "#000"
|
|
88
88
|
},
|
|
89
89
|
menuIconContainer: {
|
|
90
|
-
position:
|
|
90
|
+
position: "absolute",
|
|
91
91
|
top: StatusBarHeight(0),
|
|
92
92
|
right: 0,
|
|
93
93
|
width: 55,
|
|
@@ -98,15 +98,15 @@ const styles = StyleSheet.create({
|
|
|
98
98
|
fontSize: 25,
|
|
99
99
|
padding: 15,
|
|
100
100
|
width: 55,
|
|
101
|
-
textAlign:
|
|
102
|
-
color:
|
|
101
|
+
textAlign: "center",
|
|
102
|
+
color: "#fff",
|
|
103
103
|
zIndex: 3
|
|
104
104
|
},
|
|
105
105
|
playerContainer: {
|
|
106
106
|
flex: 1,
|
|
107
|
-
backgroundColor:
|
|
108
|
-
alignItems:
|
|
109
|
-
justifyContent:
|
|
107
|
+
backgroundColor: "#000",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "center"
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
export { VideoPopup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","Platform","View","Modal","TouchableOpacity","StyleSheet","ScreenOrientation","StatusBarHeight","getCompressed","imageExists","
|
|
1
|
+
{"version":3,"names":["React","Component","Platform","View","Modal","TouchableOpacity","StyleSheet","ScreenOrientation","StatusBarHeight","getCompressed","imageExists","FontAwesome","SharingTools","MediaPlayer","VideoPopup","constructor","props","_defineProperty","checkCompressed","uri","lockAsync","OS","OrientationLock","DEFAULT","ALL","PORTRAIT_UP","url","compressedUri","then","compressedExists","setState","state","isFullScreen","UNSAFE_componentWillReceiveProps","nextProps","renderClose","createElement","style","styles","menuIconContainer","onPress","onClose","activeOpacity","name","menuIcon","renderPlayer","playerContainer","source","useVideoPlayer","autoPlay","orientationChanged","render","visible","animationType","onRequestClose","container","supportedOrientations","create","backgroundColor","position","top","right","width","height","zIndex","fontSize","padding","textAlign","color","flex","alignItems","justifyContent"],"sources":["VideoPopup.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport {\n\tPlatform,\n\tView,\n\tModal,\n\tTouchableOpacity,\n\tStyleSheet,\n} from \"react-native\";\nimport * as ScreenOrientation from \"expo-screen-orientation\";\nimport { StatusBarHeight, getCompressed, imageExists } from \"../helper\";\nimport { FontAwesome } from \"./Icon\";\nimport { SharingTools } from \"./SharingTools\";\nimport MediaPlayer from \"./MediaPlayer\";\n\nclass VideoPopup extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\turi: \"\",\n\t\t\tisFullScreen: false,\n\t\t};\n\t}\n\n\tUNSAFE_componentWillMount = async () => {\n\t\tthis.checkCompressed(this.props.uri);\n\t\tawait ScreenOrientation.lockAsync(\n\t\t\tPlatform.OS === \"ios\"\n\t\t\t\t? ScreenOrientation.OrientationLock.DEFAULT\n\t\t\t\t: ScreenOrientation.OrientationLock.ALL,\n\t\t);\n\t};\n\n\tUNSAFE_componentWillReceiveProps(nextProps) {\n\t\tif (this.props.uri === nextProps.uri) return;\n\t\tthis.checkCompressed(nextProps.uri);\n\t}\n\n\tcomponentWillUnmount = async () => {\n\t\tawait ScreenOrientation.lockAsync(\n\t\t\tScreenOrientation.OrientationLock.PORTRAIT_UP,\n\t\t);\n\t};\n\n\tcheckCompressed = (url) => {\n\t\tconst compressedUri = getCompressed(url);\n\t\timageExists(compressedUri).then((compressedExists) => {\n\t\t\tthis.setState({ uri: compressedExists ? compressedUri : 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\trenderPlayer() {\n\t\tconst { uri } = this.state;\n\t\tif (!uri) return null;\n\n\t\treturn (\n\t\t\t<View style={styles.playerContainer}>\n\t\t\t\t<MediaPlayer\n\t\t\t\t\tsource={uri}\n\t\t\t\t\tuseVideoPlayer={true}\n\t\t\t\t\tautoPlay={true}\n\t\t\t\t\torientationChanged={(isFullScreen) => this.setState({ isFullScreen })}\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { isFullScreen } = this.state;\n\t\tconst { visible, onClose, animationType, style } = this.props;\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tvisible={visible}\n\t\t\t\tanimationType={animationType || \"fade\"}\n\t\t\t\tonRequestClose={onClose}\n\t\t\t\tstyle={[styles.container, style]}\n\t\t\t\tsupportedOrientations={[\"portrait\", \"landscape\"]}\n\t\t\t>\n\t\t\t\t{this.renderPlayer()}\n\t\t\t\t{!isFullScreen && this.renderClose()}\n\t\t\t\t{!isFullScreen && <SharingTools uri={this.props.uri} />}\n\t\t\t</Modal>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tbackgroundColor: \"#000\",\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\tplayerContainer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"#000\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n});\n\nexport { VideoPopup };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACCC,QAAQ,EACRC,IAAI,EACJC,KAAK,EACLC,gBAAgB,EAChBC,UAAU,QACJ,cAAc;AACrB,OAAO,KAAKC,iBAAiB,MAAM,yBAAyB;AAC5D,SAASC,eAAe,EAAEC,aAAa,EAAEC,WAAW,QAAQ,WAAW;AACvE,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,WAAW,MAAM,eAAe;AAEvC,MAAMC,UAAU,SAASb,SAAS,CAAC;EAClCc,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oCAQc,YAAY;MACvC,IAAI,CAACC,eAAe,CAAC,IAAI,CAACF,KAAK,CAACG,GAAG,CAAC;MACpC,MAAMZ,iBAAiB,CAACa,SAAS,CAChClB,QAAQ,CAACmB,EAAE,KAAK,KAAK,GAClB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M,EAAE,EAAE;IACVC,MAAM,EAAE;EACT,CAAC;EACDpB,QAAQ,EAAE;IACTqB,QAAQ,EAAE,EAAE;IACZC,OAAO,EAAE,EAAE;IACXJ,KAAK,EAAE,EAAE;IACTK,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,MAAM;IACbJ,MAAM,EAAE;EACT,CAAC;EACDlB,eAAe,EAAE;IAChBuB,IAAI,EAAE,CAAC;IACPX,eAAe,EAAE,MAAM;IACvBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACjB;AACD,CAAC,CAAC;AAEF,SAASzD,UAAU","ignoreList":[]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import _ from
|
|
3
|
-
import { View,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { View, Dimensions } from "react-native";
|
|
4
|
+
import { Text } from "./Text";
|
|
5
|
+
import { connect } from "react-redux";
|
|
6
|
+
import { FontAwesome } from "./Icon";
|
|
7
|
+
import { COLOUR_GREEN, TEXT_DARK, getMainBrandingColourFromState } from "../colours";
|
|
8
|
+
import { MiddlePopup } from "./MiddlePopup";
|
|
9
|
+
import { InlineButton } from "./InlineButton";
|
|
10
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
10
11
|
class WarningPopup extends PureComponent {
|
|
11
12
|
render() {
|
|
12
13
|
return /*#__PURE__*/React.createElement(MiddlePopup, {
|
|
@@ -15,9 +16,9 @@ class WarningPopup extends PureComponent {
|
|
|
15
16
|
style: [styles.popup, this.props.padHorizontal && {
|
|
16
17
|
paddingHorizontal: 16
|
|
17
18
|
}]
|
|
18
|
-
}, this.props.isSuccess && /*#__PURE__*/React.createElement(
|
|
19
|
+
}, this.props.isSuccess && /*#__PURE__*/React.createElement(FontAwesome, {
|
|
19
20
|
style: styles.icon,
|
|
20
|
-
name: "
|
|
21
|
+
name: "circle-check"
|
|
21
22
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
22
23
|
style: styles.text
|
|
23
24
|
}, this.props.confirmText), /*#__PURE__*/React.createElement(View, {
|
|
@@ -29,18 +30,18 @@ class WarningPopup extends PureComponent {
|
|
|
29
30
|
style: [styles.infoText, this.props.infoTextStyle]
|
|
30
31
|
}, this.props.infoText)), /*#__PURE__*/React.createElement(InlineButton, {
|
|
31
32
|
onPress: this.props.onClose,
|
|
32
|
-
color: this.props.ctaButton ? this.props.colourBrandingMain :
|
|
33
|
+
color: this.props.ctaButton ? this.props.colourBrandingMain : "#fff",
|
|
33
34
|
style: styles.button,
|
|
34
35
|
textStyle: [styles.closeText, {
|
|
35
|
-
color: this.props.ctaButton ?
|
|
36
|
+
color: this.props.ctaButton ? "#fff" : this.props.colourBrandingMain
|
|
36
37
|
}],
|
|
37
38
|
large: true
|
|
38
|
-
}, !_.isUndefined(this.props.buttonText) ? this.props.buttonText :
|
|
39
|
+
}, !_.isUndefined(this.props.buttonText) ? this.props.buttonText : "Close"));
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
const styles = {
|
|
42
43
|
popup: {
|
|
43
|
-
width:
|
|
44
|
+
width: "auto",
|
|
44
45
|
maxWidth: SCREEN_WIDTH - 34,
|
|
45
46
|
paddingVertical: 16
|
|
46
47
|
},
|
|
@@ -51,26 +52,26 @@ const styles = {
|
|
|
51
52
|
color: COLOUR_GREEN
|
|
52
53
|
},
|
|
53
54
|
text: {
|
|
54
|
-
fontFamily:
|
|
55
|
+
fontFamily: "sf-bold",
|
|
55
56
|
fontSize: 24,
|
|
56
57
|
lineHeight: 24,
|
|
57
58
|
color: TEXT_DARK,
|
|
58
|
-
textAlign:
|
|
59
|
+
textAlign: "center",
|
|
59
60
|
marginTop: 8
|
|
60
61
|
},
|
|
61
62
|
infoText: {
|
|
62
|
-
fontFamily:
|
|
63
|
+
fontFamily: "sf-regular",
|
|
63
64
|
fontSize: 16,
|
|
64
65
|
lineHeight: 22,
|
|
65
66
|
color: TEXT_DARK,
|
|
66
|
-
textAlign:
|
|
67
|
+
textAlign: "left"
|
|
67
68
|
},
|
|
68
69
|
button: {
|
|
69
70
|
width: 130,
|
|
70
71
|
marginTop: 20
|
|
71
72
|
},
|
|
72
73
|
closeText: {
|
|
73
|
-
fontFamily:
|
|
74
|
+
fontFamily: "sf-medium",
|
|
74
75
|
fontSize: 15
|
|
75
76
|
}
|
|
76
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","_","View","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","_","View","Dimensions","Text","connect","FontAwesome","COLOUR_GREEN","TEXT_DARK","getMainBrandingColourFromState","MiddlePopup","InlineButton","SCREEN_WIDTH","get","width","WarningPopup","render","createElement","visible","props","onClose","style","styles","popup","padHorizontal","paddingHorizontal","isSuccess","icon","name","text","confirmText","marginTop","infoText","infoTextStyle","onPress","color","ctaButton","colourBrandingMain","button","textStyle","closeText","large","isUndefined","buttonText","maxWidth","paddingVertical","paddingBottom","fontSize","fontFamily","lineHeight","textAlign","mapStateToProps","state","warningPopup"],"sources":["WarningPopup.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport _ from \"lodash\";\nimport { View, Dimensions } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport { FontAwesome } from \"./Icon\";\nimport {\n\tCOLOUR_GREEN,\n\tTEXT_DARK,\n\tgetMainBrandingColourFromState,\n} from \"../colours\";\nimport { MiddlePopup } from \"./MiddlePopup\";\nimport { InlineButton } from \"./InlineButton\";\n\nconst SCREEN_WIDTH = Dimensions.get(\"window\").width;\n\nclass WarningPopup extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<MiddlePopup\n\t\t\t\tvisible={this.props.visible}\n\t\t\t\tonClose={this.props.onClose}\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.popup,\n\t\t\t\t\tthis.props.padHorizontal && { paddingHorizontal: 16 },\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.props.isSuccess && (\n\t\t\t\t\t<FontAwesome style={styles.icon} name=\"circle-check\" />\n\t\t\t\t)}\n\t\t\t\t<Text style={styles.text}>{this.props.confirmText}</Text>\n\t\t\t\t<View style={{ marginTop: 16, paddingHorizontal: 24 }}>\n\t\t\t\t\t<Text style={[styles.infoText, this.props.infoTextStyle]}>\n\t\t\t\t\t\t{this.props.infoText}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t\t<InlineButton\n\t\t\t\t\tonPress={this.props.onClose}\n\t\t\t\t\tcolor={this.props.ctaButton ? this.props.colourBrandingMain : \"#fff\"}\n\t\t\t\t\tstyle={styles.button}\n\t\t\t\t\ttextStyle={[\n\t\t\t\t\t\tstyles.closeText,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolor: this.props.ctaButton\n\t\t\t\t\t\t\t\t? \"#fff\"\n\t\t\t\t\t\t\t\t: this.props.colourBrandingMain,\n\t\t\t\t\t\t},\n\t\t\t\t\t]}\n\t\t\t\t\tlarge\n\t\t\t\t>\n\t\t\t\t\t{!_.isUndefined(this.props.buttonText)\n\t\t\t\t\t\t? this.props.buttonText\n\t\t\t\t\t\t: \"Close\"}\n\t\t\t\t</InlineButton>\n\t\t\t</MiddlePopup>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tpopup: {\n\t\twidth: \"auto\",\n\t\tmaxWidth: SCREEN_WIDTH - 34,\n\t\tpaddingVertical: 16,\n\t},\n\ticon: {\n\t\tmarginTop: 20,\n\t\tpaddingBottom: 16,\n\t\tfontSize: 52,\n\t\tcolor: COLOUR_GREEN,\n\t},\n\ttext: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 24,\n\t\tlineHeight: 24,\n\t\tcolor: TEXT_DARK,\n\t\ttextAlign: \"center\",\n\t\tmarginTop: 8,\n\t},\n\tinfoText: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t\tlineHeight: 22,\n\t\tcolor: TEXT_DARK,\n\t\ttextAlign: \"left\",\n\t},\n\tbutton: {\n\t\twidth: 130,\n\t\tmarginTop: 20,\n\t},\n\tcloseText: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 15,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst warningPopup = connect(mapStateToProps, {})(WarningPopup);\nexport { warningPopup as WarningPopup };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,WAAW,QAAQ,QAAQ;AACpC,SACCC,YAAY,EACZC,SAAS,EACTC,8BAA8B,QACxB,YAAY;AACnB,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,MAAMC,YAAY,GAAGT,UAAU,CAACU,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;AAEnD,MAAMC,YAAY,SAASf,aAAa,CAAC;EACxCgB,MAAMA,CAAA,EAAG;IACR,oBACCjB,KAAA,CAAAkB,aAAA,CAACP,WAAW;MACXQ,OAAO,EAAE,IAAI,CAACC,KAAK,CAACD,OAAQ;MAC5BE,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC,OAAQ;MAC5BC,KAAK,EAAE,CACNC,MAAM,CAACC,KAAK,EACZ,IAAI,CAACJ,KAAK,CAACK,aAAa,IAAI;QAAEC,iBAAiB,EAAE;MAAG,CAAC;IACpD,GAED,IAAI,CAACN,KAAK,CAACO,SAAS,iBACpB3B,KAAA,CAAAkB,aAAA,CAACX,WAAW;MAACe,K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E;IACbe,aAAa,EAAE,EAAE;IACjBC,QAAQ,EAAE,EAAE;IACZZ,KAAK,EAAE5B;EACR,CAAC;EACDsB,IAAI,EAAE;IACLmB,UAAU,EAAE,SAAS;IACrBD,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE,EAAE;IACdd,KAAK,EAAE3B,SAAS;IAChB0C,SAAS,EAAE,QAAQ;IACnBnB,SAAS,EAAE;EACZ,CAAC;EACDC,QAAQ,EAAE;IACTgB,UAAU,EAAE,YAAY;IACxBD,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE,EAAE;IACdd,KAAK,EAAE3B,SAAS;IAChB0C,SAAS,EAAE;EACZ,CAAC;EACDZ,MAAM,EAAE;IACPxB,KAAK,EAAE,GAAG;IACViB,SAAS,EAAE;EACZ,CAAC;EACDS,SAAS,EAAE;IACVQ,UAAU,EAAE,WAAW;IACvBD,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAMI,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNf,kBAAkB,EAAE5B,8BAA8B,CAAC2C,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,YAAY,GAAGhD,OAAO,CAAC8C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACpC,YAAY,CAAC;AAC/D,SAASsC,YAAY,IAAItC,YAAY","ignoreList":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
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 from
|
|
5
|
-
import { StyleSheet, View, FlatList, Dimensions, ActivityIndicator, Platform } from
|
|
6
|
-
import _ from
|
|
7
|
-
import * as ScreenOrientation from
|
|
8
|
-
import * as MediaLibrary from
|
|
9
|
-
import { Camera } from
|
|
10
|
-
import { isVideo } from
|
|
11
|
-
import ImageTile from
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { StyleSheet, View, FlatList, Dimensions, ActivityIndicator, Platform } from "react-native";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
import * as ScreenOrientation from "expo-screen-orientation";
|
|
8
|
+
import * as MediaLibrary from "expo-media-library";
|
|
9
|
+
import { Camera } from "expo-camera";
|
|
10
|
+
import { isVideo } from "../../helper";
|
|
11
|
+
import ImageTile from "./ImageTile";
|
|
12
12
|
const {
|
|
13
13
|
width
|
|
14
|
-
} = Dimensions.get(
|
|
14
|
+
} = Dimensions.get("window");
|
|
15
15
|
const defaultSelectionLimit = 10;
|
|
16
16
|
const defaultLoadCount = 50;
|
|
17
17
|
export default class ImageBrowser extends React.Component {
|
|
@@ -28,8 +28,8 @@ export default class ImageBrowser extends React.Component {
|
|
|
28
28
|
status: cameraRoll
|
|
29
29
|
} = await MediaLibrary.requestPermissionsAsync();
|
|
30
30
|
this.setState({
|
|
31
|
-
hasCameraPermission: camera ===
|
|
32
|
-
hasCameraRollPermission: cameraRoll ===
|
|
31
|
+
hasCameraPermission: camera === "granted",
|
|
32
|
+
hasCameraRollPermission: cameraRoll === "granted"
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
_defineProperty(this, "onOrientationChange", ({
|
|
@@ -123,7 +123,7 @@ export default class ImageBrowser extends React.Component {
|
|
|
123
123
|
first: loadCount || defaultLoadCount,
|
|
124
124
|
mediaType,
|
|
125
125
|
album: album || undefined,
|
|
126
|
-
sortBy: [Platform.OS ===
|
|
126
|
+
sortBy: [Platform.OS === "android" ? "modificationTime" : "creationTime"]
|
|
127
127
|
};
|
|
128
128
|
if (reset) {
|
|
129
129
|
this.setState({
|
|
@@ -141,7 +141,7 @@ export default class ImageBrowser extends React.Component {
|
|
|
141
141
|
// Use remote albums
|
|
142
142
|
const selectedAlbum = remoteAlbums.find(item => item.id === album);
|
|
143
143
|
if (selectedAlbum && ((_selectedAlbum$images = selectedAlbum.images) === null || _selectedAlbum$images === void 0 ? void 0 : _selectedAlbum$images.length) > 0) {
|
|
144
|
-
const ordered = _.orderBy(selectedAlbum.images,
|
|
144
|
+
const ordered = _.orderBy(selectedAlbum.images, "date", "desc");
|
|
145
145
|
this.setState({
|
|
146
146
|
photos: ordered.map(image => {
|
|
147
147
|
return {
|