@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,81 +1,116 @@
|
|
|
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 _ from
|
|
6
|
-
import { TouchableOpacity, StyleSheet, View,
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import { TouchableOpacity, StyleSheet, View, Alert } from "react-native";
|
|
7
|
+
import { Text } from "./Text";
|
|
8
|
+
import { Icon } from "@rneui/themed";
|
|
9
|
+
import { File, Paths } from "expo-file-system";
|
|
10
|
+
import * as Sharing from "expo-sharing";
|
|
11
|
+
import * as MediaLibrary from "expo-media-library";
|
|
12
|
+
import { StatusBarHeight, isVideo, getMimeType } from "../helper";
|
|
13
|
+
import { MiddlePopup } from "./MiddlePopup";
|
|
14
|
+
import Config from "../config";
|
|
14
15
|
class SharingTools extends Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
17
18
|
_defineProperty(this, "downloadMedia", async () => {
|
|
19
|
+
var _parts$;
|
|
18
20
|
const remoteUrl = this.props.uri;
|
|
19
|
-
|
|
21
|
+
if (!remoteUrl) {
|
|
22
|
+
throw new Error("No media URL provided");
|
|
23
|
+
}
|
|
24
|
+
const parts = remoteUrl.split("/").splice(-2);
|
|
20
25
|
const mediaId = parts[0];
|
|
21
|
-
const extension = parts[1]
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = await FileSystem.downloadAsync(remoteUrl, downloadPath);
|
|
26
|
+
const extension = ((_parts$ = parts[1]) === null || _parts$ === void 0 ? void 0 : _parts$.split(".").splice(-1)[0]) || "jpg";
|
|
27
|
+
const file = await File.downloadFileAsync(remoteUrl, new File(Paths.cache, `${mediaId}.${extension}`), {
|
|
28
|
+
idempotent: true
|
|
29
|
+
});
|
|
26
30
|
return {
|
|
27
|
-
localUrl,
|
|
31
|
+
localUrl: file.uri,
|
|
28
32
|
extension
|
|
29
33
|
};
|
|
30
34
|
});
|
|
31
|
-
_defineProperty(this, "onSave", () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
_defineProperty(this, "onSave", async () => {
|
|
36
|
+
try {
|
|
37
|
+
// Request permissions first
|
|
38
|
+
const {
|
|
39
|
+
status
|
|
40
|
+
} = await MediaLibrary.requestPermissionsAsync();
|
|
41
|
+
if (status !== "granted") {
|
|
42
|
+
Alert.alert("Permission Required", "Please allow access to your photo library to save photos.", [{
|
|
43
|
+
text: "OK"
|
|
44
|
+
}]);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.setState({
|
|
48
|
+
message: "Saving..."
|
|
49
|
+
});
|
|
35
50
|
const {
|
|
36
51
|
localUrl
|
|
37
52
|
} = await this.downloadMedia();
|
|
38
53
|
await MediaLibrary.saveToLibraryAsync(localUrl);
|
|
39
54
|
this.setState({
|
|
40
|
-
message:
|
|
55
|
+
message: "Saved"
|
|
41
56
|
}, () => {
|
|
42
57
|
setTimeout(() => {
|
|
43
58
|
this.setState({
|
|
44
|
-
message:
|
|
59
|
+
message: ""
|
|
45
60
|
});
|
|
46
61
|
}, 2000);
|
|
47
62
|
});
|
|
48
|
-
})
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.log("SharingTools onSave error:", error);
|
|
65
|
+
this.setState({
|
|
66
|
+
message: ""
|
|
67
|
+
});
|
|
68
|
+
Alert.alert("Save Failed", "Unable to save photo. Please try again.", [{
|
|
69
|
+
text: "OK"
|
|
70
|
+
}]);
|
|
71
|
+
}
|
|
49
72
|
});
|
|
50
73
|
_defineProperty(this, "onShare", async () => {
|
|
51
|
-
if (!(await Sharing.isAvailableAsync()))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
if (!(await Sharing.isAvailableAsync())) {
|
|
75
|
+
Alert.alert("Sharing Unavailable", "Sharing is not available on this device.", [{
|
|
76
|
+
text: "OK"
|
|
77
|
+
}]);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
this.setState({
|
|
82
|
+
message: "Preparing..."
|
|
83
|
+
});
|
|
55
84
|
const {
|
|
56
85
|
localUrl,
|
|
57
86
|
extension
|
|
58
87
|
} = await this.downloadMedia();
|
|
59
|
-
// console.log('sharing...', localUrl);
|
|
60
|
-
|
|
61
88
|
const video = isVideo(localUrl);
|
|
62
89
|
const mimeType = getMimeType(localUrl);
|
|
63
90
|
const fileDetails = {
|
|
64
91
|
extension: `.${extension}`,
|
|
65
92
|
shareOptions: {
|
|
66
93
|
mimeType,
|
|
67
|
-
dialogTitle: video ?
|
|
94
|
+
dialogTitle: video ? "Share video" : "Share photo",
|
|
68
95
|
UTI: mimeType
|
|
69
96
|
}
|
|
70
97
|
};
|
|
71
98
|
await Sharing.shareAsync(localUrl, fileDetails.shareOptions);
|
|
72
99
|
this.setState({
|
|
73
|
-
message:
|
|
100
|
+
message: ""
|
|
74
101
|
});
|
|
75
|
-
})
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.log("SharingTools onShare error:", error);
|
|
104
|
+
this.setState({
|
|
105
|
+
message: ""
|
|
106
|
+
});
|
|
107
|
+
Alert.alert("Share Failed", "Unable to share photo. Please try again.", [{
|
|
108
|
+
text: "OK"
|
|
109
|
+
}]);
|
|
110
|
+
}
|
|
76
111
|
});
|
|
77
112
|
this.state = {
|
|
78
|
-
message:
|
|
113
|
+
message: ""
|
|
79
114
|
};
|
|
80
115
|
}
|
|
81
116
|
renderTools() {
|
|
@@ -116,12 +151,12 @@ class SharingTools extends Component {
|
|
|
116
151
|
}
|
|
117
152
|
const styles = StyleSheet.create({
|
|
118
153
|
container: {
|
|
119
|
-
position:
|
|
154
|
+
position: "absolute"
|
|
120
155
|
},
|
|
121
156
|
toolsContainer: {
|
|
122
|
-
position:
|
|
123
|
-
flexDirection:
|
|
124
|
-
justifyContent:
|
|
157
|
+
position: "absolute",
|
|
158
|
+
flexDirection: "row",
|
|
159
|
+
justifyContent: "space-between",
|
|
125
160
|
left: 0,
|
|
126
161
|
zIndex: 3,
|
|
127
162
|
top: StatusBarHeight(0)
|
|
@@ -134,20 +169,20 @@ const styles = StyleSheet.create({
|
|
|
134
169
|
fontSize: 25,
|
|
135
170
|
padding: 15,
|
|
136
171
|
width: 55,
|
|
137
|
-
textAlign:
|
|
138
|
-
color:
|
|
172
|
+
textAlign: "center",
|
|
173
|
+
color: "#fff",
|
|
139
174
|
zIndex: 3
|
|
140
175
|
},
|
|
141
176
|
messageContainer: {
|
|
142
|
-
backgroundColor:
|
|
177
|
+
backgroundColor: "#000",
|
|
143
178
|
borderRadius: 10,
|
|
144
179
|
paddingVertical: 10,
|
|
145
180
|
paddingHorizontal: 30
|
|
146
181
|
},
|
|
147
182
|
messageText: {
|
|
148
|
-
fontFamily:
|
|
183
|
+
fontFamily: "sf-bold",
|
|
149
184
|
fontSize: 24,
|
|
150
|
-
color:
|
|
185
|
+
color: "#fff"
|
|
151
186
|
}
|
|
152
187
|
});
|
|
153
188
|
export { SharingTools };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","TouchableOpacity","StyleSheet","View","Text","Icon","FileSystem","Sharing","MediaLibrary","StatusBarHeight","isVideo","getMimeType","MiddlePopup","Config","SharingTools","constructor","props","_defineProperty","remoteUrl","uri","parts","split","splice","mediaId","extension","downloadPath","cacheDirectory","localUrl","downloadAsync","setState","message","downloadMedia","saveToLibraryAsync","setTimeout","isAvailableAsync","video","mimeType","fileDetails","shareOptions","dialogTitle","UTI","shareAsync","state","renderTools","createElement","style","styles","toolsContainer","env","allowMediaDownload","onPress","onSave","activeOpacity","name","type","iconStyle","toolIcon","toolIconContainer","allowMediaSharing","onShare","renderMessage","visible","isEmpty","messageContainer","messageText","render","container","create","position","flexDirection","justifyContent","left","zIndex","top","width","height","fontSize","padding","textAlign","color","backgroundColor","borderRadius","paddingVertical","paddingHorizontal","fontFamily"],"sources":["SharingTools.js"],"sourcesContent":["import React, { Component } from 'react';\nimport _ from 'lodash';\nimport { TouchableOpacity, StyleSheet, View, Text } from 'react-native';\nimport { Icon } from '@rneui/themed';\nimport * as FileSystem from 'expo-file-system';\nimport * as Sharing from 'expo-sharing';\nimport * as MediaLibrary from 'expo-media-library';\nimport { StatusBarHeight, isVideo, getMimeType } from '../helper';\nimport { MiddlePopup } from './MiddlePopup';\nimport Config from '../config';\n\nclass SharingTools extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n message: '',\n };\n }\n\n downloadMedia = async () => {\n const remoteUrl = this.props.uri;\n const parts = remoteUrl.split('/').splice(-2);\n const mediaId = parts[0];\n const extension = parts[1].split('.').splice(-1)[0];\n\n const downloadPath = `${FileSystem.cacheDirectory}${mediaId}.${extension}`;\n const { uri: localUrl } = await FileSystem.downloadAsync(remoteUrl, downloadPath);\n return { localUrl, extension };\n };\n\n onSave = () => {\n this.setState({ message: 'Saving...' }, async () => {\n const { localUrl } = await this.downloadMedia();\n await MediaLibrary.saveToLibraryAsync(localUrl);\n\n this.setState({ message: 'Saved' }, () => {\n setTimeout(() => {\n this.setState({ message: '' });\n }, 2000);\n });\n });\n };\n\n onShare = async () => {\n if (!(await Sharing.isAvailableAsync())) return;\n\n this.setState({ message: 'Preparing...' }, async () => {\n const { localUrl, extension } = await this.downloadMedia();\n // console.log('sharing...', localUrl);\n\n const video = isVideo(localUrl);\n const mimeType = getMimeType(localUrl);\n const fileDetails = {\n extension: `.${extension}`,\n shareOptions: {\n mimeType,\n dialogTitle: video ? 'Share video' : 'Share photo',\n UTI: mimeType,\n },\n };\n\n await Sharing.shareAsync(localUrl, fileDetails.shareOptions);\n this.setState({ message: '' });\n });\n };\n\n renderTools() {\n return (\n <View style={styles.toolsContainer}>\n {Config.env.allowMediaDownload && (\n <TouchableOpacity onPress={this.onSave} activeOpacity={0.6}>\n <Icon name=\"download\" type=\"font-awesome\" iconStyle={styles.toolIcon} style={styles.toolIconContainer} />\n </TouchableOpacity>\n )}\n {Config.env.allowMediaSharing && (\n <TouchableOpacity onPress={this.onShare} activeOpacity={0.6}>\n <Icon name=\"share-square-o\" type=\"font-awesome\" iconStyle={styles.toolIcon} style={styles.toolIconContainer} />\n </TouchableOpacity>\n )}\n </View>\n );\n }\n\n renderMessage() {\n return (\n <MiddlePopup visible={!_.isEmpty(this.state.message)}>\n <View style={styles.messageContainer}>\n <Text style={styles.messageText}>{this.state.message}</Text>\n </View>\n </MiddlePopup>\n );\n }\n\n render() {\n return (\n <View style={styles.container}>\n {this.renderTools()}\n {this.renderMessage()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n },\n toolsContainer: {\n position: 'absolute',\n flexDirection: 'row',\n justifyContent: 'space-between',\n left: 0,\n zIndex: 3,\n top: StatusBarHeight(0),\n },\n toolIconContainer: {\n width: 55,\n height: 55,\n },\n toolIcon: {\n fontSize: 25,\n padding: 15,\n width: 55,\n textAlign: 'center',\n color: '#fff',\n zIndex: 3,\n },\n messageContainer: {\n backgroundColor: '#000',\n borderRadius: 10,\n paddingVertical: 10,\n paddingHorizontal: 30,\n },\n messageText: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n color: '#fff',\n },\n});\n\nexport { SharingTools };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,gBAAgB,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,IAAI,QAAQ,eAAe;AACpC,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAClD,SAASC,eAAe,EAAEC,OAAO,EAAEC,WAAW,QAAQ,WAAW;AACjE,SAASC,WAAW,QAAQ,eAAe;AAC3C,OAAOC,MAAM,MAAM,WAAW;AAE9B,MAAMC,YAAY,SAASf,SAAS,CAAC;EACnCg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B,EAAE;IACjBiB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDnB,QAAQ,EAAE;IACRoB,QAAQ,EAAE,EAAE;IACZC,OAAO,EAAE,EAAE;IACXH,KAAK,EAAE,EAAE;IACTI,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,MAAM;IACbP,MAAM,EAAE;EACV,CAAC;EACDT,gBAAgB,EAAE;IAChBiB,eAAe,EAAE,MAAM;IACvBC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDnB,WAAW,EAAE;IACXoB,UAAU,EAAE,SAAS;IACrBR,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,SAASjE,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","_","TouchableOpacity","StyleSheet","View","Alert","Text","Icon","File","Paths","Sharing","MediaLibrary","StatusBarHeight","isVideo","getMimeType","MiddlePopup","Config","SharingTools","constructor","props","_defineProperty","_parts$","remoteUrl","uri","Error","parts","split","splice","mediaId","extension","file","downloadFileAsync","cache","idempotent","localUrl","status","requestPermissionsAsync","alert","text","setState","message","downloadMedia","saveToLibraryAsync","setTimeout","error","console","log","isAvailableAsync","video","mimeType","fileDetails","shareOptions","dialogTitle","UTI","shareAsync","state","renderTools","createElement","style","styles","toolsContainer","env","allowMediaDownload","onPress","onSave","activeOpacity","name","type","iconStyle","toolIcon","toolIconContainer","allowMediaSharing","onShare","renderMessage","visible","isEmpty","messageContainer","messageText","render","container","create","position","flexDirection","justifyContent","left","zIndex","top","width","height","fontSize","padding","textAlign","color","backgroundColor","borderRadius","paddingVertical","paddingHorizontal","fontFamily"],"sources":["SharingTools.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TouchableOpacity, StyleSheet, View, Alert } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { File, Paths } from \"expo-file-system\";\nimport * as Sharing from \"expo-sharing\";\nimport * as MediaLibrary from \"expo-media-library\";\nimport { StatusBarHeight, isVideo, getMimeType } from \"../helper\";\nimport { MiddlePopup } from \"./MiddlePopup\";\nimport Config from \"../config\";\n\nclass SharingTools extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tmessage: \"\",\n\t\t};\n\t}\n\n\tdownloadMedia = async () => {\n\t\tconst remoteUrl = this.props.uri;\n\t\tif (!remoteUrl) {\n\t\t\tthrow new Error(\"No media URL provided\");\n\t\t}\n\n\t\tconst parts = remoteUrl.split(\"/\").splice(-2);\n\t\tconst mediaId = parts[0];\n\t\tconst extension = parts[1]?.split(\".\").splice(-1)[0] || \"jpg\";\n\n\t\tconst file = await File.downloadFileAsync(\n\t\t\tremoteUrl,\n\t\t\tnew File(Paths.cache, `${mediaId}.${extension}`),\n\t\t\t{ idempotent: true },\n\t\t);\n\t\treturn { localUrl: file.uri, extension };\n\t};\n\n\tonSave = async () => {\n\t\ttry {\n\t\t\t// Request permissions first\n\t\t\tconst { status } = await MediaLibrary.requestPermissionsAsync();\n\t\t\tif (status !== \"granted\") {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t\"Permission Required\",\n\t\t\t\t\t\"Please allow access to your photo library to save photos.\",\n\t\t\t\t\t[{ text: \"OK\" }],\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.setState({ message: \"Saving...\" });\n\n\t\t\tconst { localUrl } = await this.downloadMedia();\n\t\t\tawait MediaLibrary.saveToLibraryAsync(localUrl);\n\n\t\t\tthis.setState({ message: \"Saved\" }, () => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.setState({ message: \"\" });\n\t\t\t\t}, 2000);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.log(\"SharingTools onSave error:\", error);\n\t\t\tthis.setState({ message: \"\" });\n\t\t\tAlert.alert(\"Save Failed\", \"Unable to save photo. Please try again.\", [\n\t\t\t\t{ text: \"OK\" },\n\t\t\t]);\n\t\t}\n\t};\n\n\tonShare = async () => {\n\t\tif (!(await Sharing.isAvailableAsync())) {\n\t\t\tAlert.alert(\n\t\t\t\t\"Sharing Unavailable\",\n\t\t\t\t\"Sharing is not available on this device.\",\n\t\t\t\t[{ text: \"OK\" }],\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.setState({ message: \"Preparing...\" });\n\n\t\t\tconst { localUrl, extension } = await this.downloadMedia();\n\n\t\t\tconst video = isVideo(localUrl);\n\t\t\tconst mimeType = getMimeType(localUrl);\n\t\t\tconst fileDetails = {\n\t\t\t\textension: `.${extension}`,\n\t\t\t\tshareOptions: {\n\t\t\t\t\tmimeType,\n\t\t\t\t\tdialogTitle: video ? \"Share video\" : \"Share photo\",\n\t\t\t\t\tUTI: mimeType,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tawait Sharing.shareAsync(localUrl, fileDetails.shareOptions);\n\t\t\tthis.setState({ message: \"\" });\n\t\t} catch (error) {\n\t\t\tconsole.log(\"SharingTools onShare error:\", error);\n\t\t\tthis.setState({ message: \"\" });\n\t\t\tAlert.alert(\"Share Failed\", \"Unable to share photo. Please try again.\", [\n\t\t\t\t{ text: \"OK\" },\n\t\t\t]);\n\t\t}\n\t};\n\n\trenderTools() {\n\t\treturn (\n\t\t\t<View style={styles.toolsContainer}>\n\t\t\t\t{Config.env.allowMediaDownload && (\n\t\t\t\t\t<TouchableOpacity onPress={this.onSave} activeOpacity={0.6}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={styles.toolIcon}\n\t\t\t\t\t\t\tstyle={styles.toolIconContainer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t)}\n\t\t\t\t{Config.env.allowMediaSharing && (\n\t\t\t\t\t<TouchableOpacity onPress={this.onShare} activeOpacity={0.6}>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"share-square-o\"\n\t\t\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\t\t\ticonStyle={styles.toolIcon}\n\t\t\t\t\t\t\tstyle={styles.toolIconContainer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t)}\n\t\t\t</View>\n\t\t);\n\t}\n\n\trenderMessage() {\n\t\treturn (\n\t\t\t<MiddlePopup visible={!_.isEmpty(this.state.message)}>\n\t\t\t\t<View style={styles.messageContainer}>\n\t\t\t\t\t<Text style={styles.messageText}>{this.state.message}</Text>\n\t\t\t\t</View>\n\t\t\t</MiddlePopup>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={styles.container}>\n\t\t\t\t{this.renderTools()}\n\t\t\t\t{this.renderMessage()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tposition: \"absolute\",\n\t},\n\ttoolsContainer: {\n\t\tposition: \"absolute\",\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t\tleft: 0,\n\t\tzIndex: 3,\n\t\ttop: StatusBarHeight(0),\n\t},\n\ttoolIconContainer: {\n\t\twidth: 55,\n\t\theight: 55,\n\t},\n\ttoolIcon: {\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\tmessageContainer: {\n\t\tbackgroundColor: \"#000\",\n\t\tborderRadius: 10,\n\t\tpaddingVertical: 10,\n\t\tpaddingHorizontal: 30,\n\t},\n\tmessageText: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 24,\n\t\tcolor: \"#fff\",\n\t},\n});\n\nexport { SharingTools };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,S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AC,CACf,CAAC;EAET;AACD;AAEA,MAAMd,MAAM,GAAGxD,UAAU,CAAC6E,MAAM,CAAC;EAChCD,SAAS,EAAE;IACVE,QAAQ,EAAE;EACX,CAAC;EACDrB,cAAc,EAAE;IACfqB,QAAQ,EAAE,UAAU;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,CAAC;IACTC,GAAG,EAAE1E,eAAe,CAAC,CAAC;EACvB,CAAC;EACD0D,iBAAiB,EAAE;IAClBiB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACT,CAAC;EACDnB,QAAQ,EAAE;IACToB,QAAQ,EAAE,EAAE;IACZC,OAAO,EAAE,EAAE;IACXH,KAAK,EAAE,EAAE;IACTI,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,MAAM;IACbP,MAAM,EAAE;EACT,CAAC;EACDT,gBAAgB,EAAE;IACjBiB,eAAe,EAAE,MAAM;IACvBC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACpB,CAAC;EACDnB,WAAW,EAAE;IACZoB,UAAU,EAAE,SAAS;IACrBR,QAAQ,EAAE,EAAE;IACZG,KAAK,EAAE;EACR;AACD,CAAC,CAAC;AAEF,SAAS3E,YAAY","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { View } from
|
|
3
|
-
import { LoadingCircles } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { LoadingCircles } from "./LoadingCircles";
|
|
4
4
|
const Spinner = ({
|
|
5
5
|
color,
|
|
6
6
|
style
|
|
@@ -14,8 +14,8 @@ const Spinner = ({
|
|
|
14
14
|
const styles = {
|
|
15
15
|
spinnerStyle: {
|
|
16
16
|
flex: 1,
|
|
17
|
-
justifyContent:
|
|
18
|
-
alignItems:
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
alignItems: "center"
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
export { Spinner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","LoadingCircles","Spinner","color","style","createElement","styles","spinnerStyle","flex","justifyContent","alignItems"],"sources":["Spinner.js"],"sourcesContent":["import React from
|
|
1
|
+
{"version":3,"names":["React","View","LoadingCircles","Spinner","color","style","createElement","styles","spinnerStyle","flex","justifyContent","alignItems"],"sources":["Spinner.js"],"sourcesContent":["import React from \"react\";\nimport { View } from \"react-native\";\nimport { LoadingCircles } from \"./LoadingCircles\";\n\nconst Spinner = ({ color, style }) => {\n\treturn (\n\t\t<View style={[styles.spinnerStyle, style]}>\n\t\t\t<LoadingCircles color={color} />\n\t\t</View>\n\t);\n};\n\nconst styles = {\n\tspinnerStyle: {\n\t\tflex: 1,\n\t\tjustifyContent: \"center\",\n\t\talignItems: \"center\",\n\t},\n};\n\nexport { Spinner };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,MAAMC,OAAO,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAM,CAAC,KAAK;EACrC,oBACCL,KAAA,CAAAM,aAAA,CAACL,IAAI;IAACI,KAAK,EAAE,CAACE,MAAM,CAACC,YAAY,EAAEH,KAAK;EAAE,gBACzCL,KAAA,CAAAM,aAAA,CAACJ,cAAc;IAACE,KAAK,EAAEA;EAAM,CAAE,CAC1B,CAAC;AAET,CAAC;AAED,MAAMG,MAAM,GAAG;EACdC,YAAY,EAAE;IACbC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACb;AACD,CAAC;AAED,SAASR,OAAO","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { View } from
|
|
3
|
-
import { LINEGREY } from
|
|
4
|
-
import { FOOTER_HEIGHT } from
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { LINEGREY } from "../colours";
|
|
4
|
+
import { FOOTER_HEIGHT } from "../constants";
|
|
5
5
|
class StickyFooter extends PureComponent {
|
|
6
6
|
render() {
|
|
7
7
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -11,10 +11,10 @@ class StickyFooter extends PureComponent {
|
|
|
11
11
|
}
|
|
12
12
|
const styles = {
|
|
13
13
|
section: {
|
|
14
|
-
backgroundColor:
|
|
14
|
+
backgroundColor: "#fff",
|
|
15
15
|
height: FOOTER_HEIGHT,
|
|
16
16
|
borderTopWidth: 0,
|
|
17
|
-
shadowColor:
|
|
17
|
+
shadowColor: "#000",
|
|
18
18
|
shadowOffset: {
|
|
19
19
|
width: 0,
|
|
20
20
|
height: -1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","View","LINEGREY","FOOTER_HEIGHT","StickyFooter","render","createElement","style","styles","section","props","lineSeparated","children","backgroundColor","height","borderTopWidth","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderColor"],"sources":["StickyFooter.js"],"sourcesContent":["import React, { PureComponent } from
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","LINEGREY","FOOTER_HEIGHT","StickyFooter","render","createElement","style","styles","section","props","lineSeparated","children","backgroundColor","height","borderTopWidth","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderColor"],"sources":["StickyFooter.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View } from \"react-native\";\nimport { LINEGREY } from \"../colours\";\nimport { FOOTER_HEIGHT } from \"../constants\";\n\nclass StickyFooter extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.section,\n\t\t\t\t\tthis.props.lineSeparated && styles.lineSeparated,\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsection: {\n\t\tbackgroundColor: \"#fff\",\n\t\theight: FOOTER_HEIGHT,\n\t\tborderTopWidth: 0,\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: -1,\n\t\t},\n\t\tshadowOpacity: 0.1,\n\t\tshadowRadius: 6,\n\t\televation: 16,\n\t},\n\tlineSeparated: {\n\t\tborderTopWidth: 1,\n\t\tborderColor: LINEGREY,\n\t\tshadowOpacity: 0,\n\t\televation: 0,\n\t},\n};\n\nexport { StickyFooter };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,aAAa,QAAQ,cAAc;AAE5C,MAAMC,YAAY,SAASJ,aAAa,CAAC;EACxCK,MAAMA,CAAA,EAAG;IACR,oBACCN,KAAA,CAAAO,aAAA,CAACL,IAAI;MACJM,KAAK,EAAE,CACNC,MAAM,CAACC,OAAO,EACd,IAAI,CAACC,KAAK,CAACC,aAAa,IAAIH,MAAM,CAACG,aAAa,EAChD,IAAI,CAACD,KAAK,CAACH,KAAK;IACf,GAED,IAAI,CAACG,KAAK,CAACE,QACP,CAAC;EAET;AACD;AAEA,MAAMJ,MAAM,GAAG;EACdC,OAAO,EAAE;IACRI,eAAe,EAAE,MAAM;IACvBC,MAAM,EAAEX,aAAa;IACrBY,cAAc,EAAE,CAAC;IACjBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACbC,KAAK,EAAE,CAAC;MACRJ,MAAM,EAAE,CAAC;IACV,CAAC;IACDK,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACZ,CAAC;EACDV,aAAa,EAAE;IACdI,cAAc,EAAE,CAAC;IACjBO,WAAW,EAAEpB,QAAQ;IACrBiB,aAAa,EAAE,CAAC;IAChBE,SAAS,EAAE;EACZ;AACD,CAAC;AAED,SAASjB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { PureComponent } from "react";
|
|
3
|
+
import { StyleSheet, Text as TextNative } from "react-native";
|
|
4
|
+
import { TEXT_DARKEST, COLOUR_RED } from "../colours";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper around the react-native Text component that applies a
|
|
8
|
+
* maximum font size multiplier (1.2) to prevent layout breaking.
|
|
9
|
+
*
|
|
10
|
+
* * @typedef {Object} TextProps
|
|
11
|
+
* @property {'pageHeading' | 'heading' | 'label' | 'detailLabel' | 'input' | 'error'} [type] - The style preset to apply.
|
|
12
|
+
* * @example
|
|
13
|
+
* <Text type="pageHeading" className="myClass">Welcome</Text>
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
class Text extends PureComponent {
|
|
17
|
+
render() {
|
|
18
|
+
return /*#__PURE__*/React.createElement(TextNative, _extends({}, this.props, {
|
|
19
|
+
style: [styles[this.props.type], this.props.style],
|
|
20
|
+
maxFontSizeMultiplier: this.props.maxFontSizeMultiplier || 1.2
|
|
21
|
+
}), this.props.children);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
pageHeading: {
|
|
26
|
+
fontFamily: "sf-bold",
|
|
27
|
+
fontSize: 24,
|
|
28
|
+
color: TEXT_DARKEST
|
|
29
|
+
},
|
|
30
|
+
body: {
|
|
31
|
+
fontFamily: "sf-regular",
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
color: TEXT_DARKEST
|
|
34
|
+
},
|
|
35
|
+
label: {
|
|
36
|
+
fontFamily: "sf-semibold",
|
|
37
|
+
color: TEXT_DARKEST,
|
|
38
|
+
fontSize: 16
|
|
39
|
+
},
|
|
40
|
+
detailLabel: {
|
|
41
|
+
fontFamily: "sf-bold",
|
|
42
|
+
color: TEXT_DARKEST,
|
|
43
|
+
fontSize: 16
|
|
44
|
+
},
|
|
45
|
+
input: {
|
|
46
|
+
color: TEXT_DARKEST,
|
|
47
|
+
fontFamily: "sf-regular",
|
|
48
|
+
fontSize: 16
|
|
49
|
+
},
|
|
50
|
+
error: {
|
|
51
|
+
fontFamily: "sf-bold",
|
|
52
|
+
color: COLOUR_RED,
|
|
53
|
+
fontSize: 16
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export { Text };
|
|
57
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","StyleSheet","Text","TextNative","TEXT_DARKEST","COLOUR_RED","render","createElement","_extends","props","style","styles","type","maxFontSizeMultiplier","children","create","pageHeading","fontFamily","fontSize","color","body","label","detailLabel","input","error"],"sources":["Text.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { StyleSheet, Text as TextNative } from \"react-native\";\nimport { TEXT_DARKEST, COLOUR_RED } from \"../colours\";\n\n/**\n * A wrapper around the react-native Text component that applies a\n * maximum font size multiplier (1.2) to prevent layout breaking.\n *\n * * @typedef {Object} TextProps\n * @property {'pageHeading' | 'heading' | 'label' | 'detailLabel' | 'input' | 'error'} [type] - The style preset to apply.\n * * @example\n * <Text type=\"pageHeading\" className=\"myClass\">Welcome</Text>\n */\n\nclass Text extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<TextNative\n\t\t\t\t{...this.props}\n\t\t\t\tstyle={[styles[this.props.type], this.props.style]}\n\t\t\t\tmaxFontSizeMultiplier={this.props.maxFontSizeMultiplier || 1.2}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</TextNative>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tpageHeading: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 24,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\tbody: {\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 14,\n\t\tcolor: TEXT_DARKEST,\n\t},\n\tlabel: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tcolor: TEXT_DARKEST,\n\t\tfontSize: 16,\n\t},\n\tdetailLabel: {\n\t\tfontFamily: \"sf-bold\",\n\t\tcolor: TEXT_DARKEST,\n\t\tfontSize: 16,\n\t},\n\tinput: {\n\t\tcolor: TEXT_DARKEST,\n\t\tfontFamily: \"sf-regular\",\n\t\tfontSize: 16,\n\t},\n\terror: {\n\t\tfontFamily: \"sf-bold\",\n\t\tcolor: COLOUR_RED,\n\t\tfontSize: 16,\n\t},\n});\n\nexport { Text };\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,UAAU,EAAEC,IAAI,IAAIC,UAAU,QAAQ,cAAc;AAC7D,SAASC,YAAY,EAAEC,UAAU,QAAQ,YAAY;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMH,IAAI,SAASF,aAAa,CAAC;EAChCM,MAAMA,CAAA,EAAG;IACR,oBACCP,KAAA,CAAAQ,aAAA,CAACJ,UAAU,EAAAK,QAAA,KACN,IAAI,CAACC,KAAK;MACdC,KAAK,EAAE,CAACC,MAAM,CAAC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC,EAAE,IAAI,CAACH,KAAK,CAACC,KAAK,CAAE;MACnDG,qBAAqB,EAAE,IAAI,CAACJ,KAAK,CAACI,qBAAqB,IAAI;IAAI,IAE9D,IAAI,CAACJ,KAAK,CAACK,QACD,CAAC;EAEf;AACD;AAEA,MAAMH,MAAM,GAAGV,UAAU,CAACc,MAAM,CAAC;EAChCC,WAAW,EAAE;IACZC,UAAU,EAAE,SAAS;IACrBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEf;EACR,CAAC;EACDgB,IAAI,EAAE;IACLH,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAEf;EACR,CAAC;EACDiB,KAAK,EAAE;IACNJ,UAAU,EAAE,aAAa;IACzBE,KAAK,EAAEf,YAAY;IACnBc,QAAQ,EAAE;EACX,CAAC;EACDI,WAAW,EAAE;IACZL,UAAU,EAAE,SAAS;IACrBE,KAAK,EAAEf,YAAY;IACnBc,QAAQ,EAAE;EACX,CAAC;EACDK,KAAK,EAAE;IACNJ,KAAK,EAAEf,YAAY;IACnBa,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE;EACX,CAAC;EACDM,KAAK,EAAE;IACNP,UAAU,EAAE,SAAS;IACrBE,KAAK,EAAEd,UAAU;IACjBa,QAAQ,EAAE;EACX;AACD,CAAC,CAAC;AAEF,SAAShB,IAAI","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { View } from
|
|
3
|
-
import stylez from
|
|
4
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import stylez from "../styles";
|
|
4
|
+
import { FontAwesome } from "./Icon";
|
|
5
5
|
class TickIcon extends PureComponent {
|
|
6
6
|
render() {
|
|
7
7
|
const size = this.props.diameter || 20;
|
|
@@ -14,8 +14,8 @@ class TickIcon extends PureComponent {
|
|
|
14
14
|
}, this.props.color && {
|
|
15
15
|
backgroundColor: this.props.color
|
|
16
16
|
}, this.props.style]
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
18
|
-
name: "
|
|
17
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
18
|
+
name: "check",
|
|
19
19
|
style: stylez.tickIcon
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","View","stylez","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","stylez","FontAwesome","TickIcon","render","size","props","diameter","radius","createElement","style","tickBox","height","width","borderRadius","color","backgroundColor","name","tickIcon"],"sources":["TickIcon.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View } from \"react-native\";\nimport stylez from \"../styles\";\nimport { FontAwesome } from \"./Icon\";\n\nclass TickIcon extends PureComponent {\n\trender() {\n\t\tconst size = this.props.diameter || 20;\n\t\tconst radius = size / 2;\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstylez.tickBox,\n\t\t\t\t\t{ height: size, width: size, borderRadius: radius },\n\t\t\t\t\tthis.props.color && { backgroundColor: this.props.color },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<FontAwesome name=\"check\" style={stylez.tickIcon} />\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport { TickIcon };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,QAAQ,cAAc;AACnC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,WAAW,QAAQ,QAAQ;AAEpC,MAAMC,QAAQ,SAASJ,aAAa,CAAC;EACpCK,MAAMA,CAAA,EAAG;IACR,MAAMC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,IAAI,EAAE;IACtC,MAAMC,MAAM,GAAGH,IAAI,GAAG,CAAC;IACvB,oBACCP,KAAA,CAAAW,aAAA,CAACT,IAAI;MACJU,KAAK,EAAE,CACNT,MAAM,CAACU,OAAO,EACd;QAAEC,MAAM,EAAEP,IAAI;QAAEQ,KAAK,EAAER,IAAI;QAAES,YAAY,EAAEN;MAAO,CAAC,EACnD,IAAI,CAACF,KAAK,CAACS,KAAK,IAAI;QAAEC,eAAe,EAAE,IAAI,CAACV,KAAK,CAACS;MAAM,CAAC,EACzD,IAAI,CAACT,KAAK,CAACI,KAAK;IACf,gBAEFZ,KAAA,CAAAW,aAAA,CAACP,WAAW;MAACe,IAAI,EAAC,OAAO;MAACP,KAAK,EAAET,MAAM,CAACiB;IAAS,CAAE,CAC9C,CAAC;EAET;AACD;AAEA,SAASf,QAAQ","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { View, TouchableOpacity } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { getMainBrandingColourFromState } from "../colours";
|
|
5
6
|
class Toggle extends PureComponent {
|
|
6
7
|
render() {
|
|
7
8
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -28,22 +29,22 @@ class Toggle extends PureComponent {
|
|
|
28
29
|
}
|
|
29
30
|
const styles = {
|
|
30
31
|
container: {
|
|
31
|
-
flexDirection:
|
|
32
|
+
flexDirection: "row"
|
|
32
33
|
},
|
|
33
34
|
text: {
|
|
34
|
-
fontFamily:
|
|
35
|
+
fontFamily: "sf-semibold",
|
|
35
36
|
fontSize: 14,
|
|
36
|
-
textAlign:
|
|
37
|
+
textAlign: "center"
|
|
37
38
|
},
|
|
38
39
|
activeText: {
|
|
39
|
-
color:
|
|
40
|
+
color: "#fff"
|
|
40
41
|
},
|
|
41
42
|
tag: {
|
|
42
43
|
flex: 1,
|
|
43
44
|
height: 34,
|
|
44
45
|
borderWidth: 1,
|
|
45
46
|
borderLeftWidth: 0,
|
|
46
|
-
justifyContent:
|
|
47
|
+
justifyContent: "center"
|
|
47
48
|
},
|
|
48
49
|
firstTag: {
|
|
49
50
|
borderLeftWidth: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","TouchableOpacity","Text","connect","getMainBrandingColourFromState","Toggle","render","createElement","style","styles","container","props","options","map","option","index","onPress","tag","borderColor","colourBrandingMain","val","activeVal","backgroundColor","firstTag","length","lastTag","tagStyle","key","text","color","activeText","textStyle","flexDirection","fontFamily","fontSize","textAlign","flex","height","borderWidth","borderLeftWidth","justifyContent","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","mapStateToProps","state","toggle"],"sources":["Toggle.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport { getMainBrandingColourFromState } from \"../colours\";\n\nclass Toggle extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{this.props.options.map((option, index) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\t\t\tthis.props.onPress(option);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\tstyles.tag,\n\t\t\t\t\t\t\t\t{ borderColor: this.props.colourBrandingMain },\n\t\t\t\t\t\t\t\toption.val === this.props.activeVal && {\n\t\t\t\t\t\t\t\t\tborderColor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t\t\tbackgroundColor: this.props.colourBrandingMain,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tindex === 0 && styles.firstTag,\n\t\t\t\t\t\t\t\tindex === this.props.options.length - 1 && styles.lastTag,\n\t\t\t\t\t\t\t\tthis.props.tagStyle,\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\tkey={option.val}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\tstyles.text,\n\t\t\t\t\t\t\t\t\t{ color: this.props.colourBrandingMain },\n\t\t\t\t\t\t\t\t\toption.val === this.props.activeVal && styles.activeText,\n\t\t\t\t\t\t\t\t\tthis.props.textStyle,\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.text}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t},\n\ttext: {\n\t\tfontFamily: \"sf-semibold\",\n\t\tfontSize: 14,\n\t\ttextAlign: \"center\",\n\t},\n\tactiveText: {\n\t\tcolor: \"#fff\",\n\t},\n\ttag: {\n\t\tflex: 1,\n\t\theight: 34,\n\t\tborderWidth: 1,\n\t\tborderLeftWidth: 0,\n\t\tjustifyContent: \"center\",\n\t},\n\tfirstTag: {\n\t\tborderLeftWidth: 1,\n\t\tborderTopLeftRadius: 4,\n\t\tborderBottomLeftRadius: 4,\n\t},\n\tlastTag: {\n\t\tborderTopRightRadius: 4,\n\t\tborderBottomRightRadius: 4,\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst toggle = connect(mapStateToProps, {})(Toggle);\nexport { toggle as Toggle };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACrD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,8BAA8B,QAAQ,YAAY;AAE3D,MAAMC,MAAM,SAASN,aAAa,CAAC;EAClCO,MAAMA,CAAA,EAAG;IACR,oBACCR,KAAA,CAAAS,aAAA,CAACP,IAAI;MAACQ,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACC,KAAK,CAACH,KAAK;IAAE,G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AAQ,EAAE,EAAE;IACZC,SAAS,EAAE;EACZ,CAAC;EACDL,UAAU,EAAE;IACXD,KAAK,EAAE;EACR,CAAC;EACDZ,GAAG,EAAE;IACJmB,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,eAAe,EAAE,CAAC;IAClBC,cAAc,EAAE;EACjB,CAAC;EACDjB,QAAQ,EAAE;IACTgB,eAAe,EAAE,CAAC;IAClBE,mBAAmB,EAAE,CAAC;IACtBC,sBAAsB,EAAE;EACzB,CAAC;EACDjB,OAAO,EAAE;IACRkB,oBAAoB,EAAE,CAAC;IACvBC,uBAAuB,EAAE;EAC1B;AACD,CAAC;AAED,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACN3B,kBAAkB,EAAEf,8BAA8B,CAAC0C,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,MAAM,GAAG5C,OAAO,CAAC0C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACxC,MAAM,CAAC;AACnD,SAAS0C,MAAM,IAAI1C,MAAM","ignoreList":[]}
|
|
@@ -1,18 +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 { View, TouchableWithoutFeedback
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View, TouchableWithoutFeedback } from "react-native";
|
|
6
|
+
import { Text } from "./Text";
|
|
7
|
+
import { connect } from "react-redux";
|
|
8
|
+
import { getSiteSettingFromState } from "../helper";
|
|
9
|
+
import { TEXT_LIGHT, BOXGREY } from "../colours";
|
|
10
|
+
import { FontAwesome } from "./Icon";
|
|
11
|
+
import Config, { Services } from "../config";
|
|
11
12
|
class TouchableSearchBar extends Component {
|
|
12
13
|
constructor(...args) {
|
|
13
14
|
super(...args);
|
|
14
15
|
_defineProperty(this, "onPressSearch", () => {
|
|
15
|
-
Services.navigation.navigate(
|
|
16
|
+
Services.navigation.navigate("search", {
|
|
16
17
|
priorityType: this.props.priorityType,
|
|
17
18
|
searchName: this.props.searchName
|
|
18
19
|
});
|
|
@@ -22,11 +23,11 @@ class TouchableSearchBar extends Component {
|
|
|
22
23
|
return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
23
24
|
onPress: this.onPressSearch
|
|
24
25
|
}, /*#__PURE__*/React.createElement(View, {
|
|
25
|
-
style: [styles.searchInputContainer, this.props.headerType !==
|
|
26
|
-
backgroundColor:
|
|
26
|
+
style: [styles.searchInputContainer, this.props.headerType !== "white" && {
|
|
27
|
+
backgroundColor: "#fff"
|
|
27
28
|
}, this.props.style]
|
|
28
|
-
}, /*#__PURE__*/React.createElement(
|
|
29
|
-
name: "
|
|
29
|
+
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
30
|
+
name: "magnifying-glass",
|
|
30
31
|
style: styles.searchIcon
|
|
31
32
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
32
33
|
style: styles.searchText
|
|
@@ -41,9 +42,9 @@ const styles = {
|
|
|
41
42
|
marginVertical: 17,
|
|
42
43
|
borderRadius: 25,
|
|
43
44
|
backgroundColor: BOXGREY,
|
|
44
|
-
alignItems:
|
|
45
|
-
justifyContent:
|
|
46
|
-
flexDirection:
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
flexDirection: "row",
|
|
47
48
|
paddingHorizontal: 16
|
|
48
49
|
},
|
|
49
50
|
searchIcon: {
|
|
@@ -54,12 +55,12 @@ const styles = {
|
|
|
54
55
|
searchText: {
|
|
55
56
|
fontSize: 14,
|
|
56
57
|
color: TEXT_LIGHT,
|
|
57
|
-
fontFamily:
|
|
58
|
+
fontFamily: "sf-medium"
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
const mapStateToProps = state => {
|
|
61
62
|
return {
|
|
62
|
-
headerType: getSiteSettingFromState(state,
|
|
63
|
+
headerType: getSiteSettingFromState(state, "HeaderType", getSiteSettingFromState(state, "UseGradientHeader", Config.env.hasGradientHeader) ? "gradient" : "white")
|
|
63
64
|
};
|
|
64
65
|
};
|
|
65
66
|
const touchableSearchBar = connect(mapStateToProps, {})(TouchableSearchBar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","TouchableWithoutFeedback","Text","connect","getSiteSettingFromState","TEXT_LIGHT","BOXGREY","
|
|
1
|
+
{"version":3,"names":["React","Component","View","TouchableWithoutFeedback","Text","connect","getSiteSettingFromState","TEXT_LIGHT","BOXGREY","FontAwesome","Config","Services","TouchableSearchBar","constructor","args","_defineProperty","navigation","navigate","priorityType","props","searchName","render","createElement","onPress","onPressSearch","style","styles","searchInputContainer","headerType","backgroundColor","name","searchIcon","searchText","flex","height","marginHorizontal","marginVertical","borderRadius","alignItems","justifyContent","flexDirection","paddingHorizontal","fontSize","color","marginRight","fontFamily","mapStateToProps","state","env","hasGradientHeader","touchableSearchBar"],"sources":["TouchableSearchBar.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View, TouchableWithoutFeedback } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { connect } from \"react-redux\";\nimport { getSiteSettingFromState } from \"../helper\";\nimport { TEXT_LIGHT, BOXGREY } from \"../colours\";\nimport { FontAwesome } from \"./Icon\";\nimport Config, { Services } from \"../config\";\n\nclass TouchableSearchBar extends Component {\n\tonPressSearch = () => {\n\t\tServices.navigation.navigate(\"search\", {\n\t\t\tpriorityType: this.props.priorityType,\n\t\t\tsearchName: this.props.searchName,\n\t\t});\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback onPress={this.onPressSearch}>\n\t\t\t\t<View\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.searchInputContainer,\n\t\t\t\t\t\tthis.props.headerType !== \"white\" && { backgroundColor: \"#fff\" },\n\t\t\t\t\t\tthis.props.style,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesome name=\"magnifying-glass\" style={styles.searchIcon} />\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={styles.searchText}\n\t\t\t\t\t>{`Search ${this.props.searchName}`}</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tsearchInputContainer: {\n\t\tflex: 1,\n\t\theight: 36,\n\t\tmarginHorizontal: 16,\n\t\tmarginVertical: 17,\n\t\tborderRadius: 25,\n\t\tbackgroundColor: BOXGREY,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tflexDirection: \"row\",\n\t\tpaddingHorizontal: 16,\n\t},\n\tsearchIcon: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tmarginRight: 8,\n\t},\n\tsearchText: {\n\t\tfontSize: 14,\n\t\tcolor: TEXT_LIGHT,\n\t\tfontFamily: \"sf-medium\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\theaderType: getSiteSettingFromState(\n\t\t\tstate,\n\t\t\t\"HeaderType\",\n\t\t\tgetSiteSettingFromState(\n\t\t\t\tstate,\n\t\t\t\t\"UseGradientHeader\",\n\t\t\t\tConfig.env.hasGradientHeader,\n\t\t\t)\n\t\t\t\t? \"gradient\"\n\t\t\t\t: \"white\",\n\t\t),\n\t};\n};\n\nconst touchableSearchBar = connect(mapStateToProps, {})(TouchableSearchBar);\nexport { touchableSearchBar as TouchableSearchBar };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,wBAAwB,QAAQ,cAAc;AAC7D,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,uBAAuB,QAAQ,WAAW;AACnD,SAASC,UAAU,EAAEC,OAAO,QAAQ,YAAY;AAChD,SAASC,WAAW,QAAQ,QAAQ;AACpC,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,WAAW;AAE5C,MAAMC,kBAAkB,SAASX,SAAS,CAAC;EAAAY,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,wBAC1B,MAAM;MACrBJ,QAAQ,CAACK,UAAU,CAACC,QAAQ,CAAC,QAAQ,EAAE;QACtCC,YAAY,EAAE,IAAI,CAACC,KAAK,CAACD,YAAY;QACrCE,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;MACxB,CAAC,CAAC;IACH,CAAC;EAAA;EAEDC,MAAMA,CAAA,EAAG;IACR,oBACCrB,KAAA,CAAAsB,aAAA,CAACnB,wBAAwB;MAACoB,OAAO,EAAE,IAAI,CAACC;IAAc,gBACrDxB,KAAA,CAAAsB,aAAA,CAACpB,IAAI;MACJuB,KAAK,EAAE,CACNC,MAAM,CAACC,oBAAoB,EAC3B,IAAI,CAACR,KAAK,CAACS,UAAU,KAAK,OAAO,IAAI;QAAEC,eAAe,EAAE;MAAO,CAAC,EAChE,IAAI,CAACV,KAAK,CAACM,KAAK;IACf,gBAEFzB,KAAA,CAAAsB,aAAA,CAACb,WAAW;MAACqB,IAAI,EAAC,kBAAkB;MAACL,KAAK,EAAEC,MAAM,CAACK;IAAW,CAAE,CAAC,eACjE/B,KAAA,CAAAsB,aAAA,CAAClB,IAAI;MACJqB,KAAK,EAAEC,MAAM,CAACM;IAAW,G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