@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,16 +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, { Component } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { Text } from "@plusscommunities/pluss-core-app/components";
|
|
6
|
+
import { View, TouchableOpacity, StyleSheet, ActivityIndicator } from "react-native";
|
|
7
|
+
import { Icon } from "@rneui/themed";
|
|
8
|
+
import * as DocumentPicker from "expo-document-picker";
|
|
9
|
+
import { connect } from "react-redux";
|
|
10
|
+
import Config from "../config";
|
|
11
|
+
import { fileActions } from "../apis";
|
|
12
|
+
import { getValueOrDefault } from "../helper";
|
|
13
|
+
import { TEXT_DARK, getMainBrandingColourFromState } from "../colours";
|
|
14
|
+
const DEFAULT_DOCUMENT_NAME = "document";
|
|
14
15
|
class DocumentUploader extends Component {
|
|
15
16
|
constructor(...args) {
|
|
16
17
|
super(...args);
|
|
@@ -23,22 +24,21 @@ class DocumentUploader extends Component {
|
|
|
23
24
|
allowedTypes,
|
|
24
25
|
multiple
|
|
25
26
|
} = this.props;
|
|
27
|
+
try {
|
|
28
|
+
const result = await DocumentPicker.getDocumentAsync({
|
|
29
|
+
type: allowedTypes,
|
|
30
|
+
copyToCacheDirectory: true,
|
|
31
|
+
multiple: multiple || false
|
|
32
|
+
});
|
|
33
|
+
// console.log('pickDocument', JSON.stringify(result, null, 2));
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// if (!result.canceled) {
|
|
36
|
-
// await this.handleDocumentPicked(result);
|
|
37
|
-
// }
|
|
38
|
-
// } catch (error) {
|
|
39
|
-
// console.log('Document picker error:', error);
|
|
40
|
-
// this.props.onUploadFailed(null, error.message);
|
|
41
|
-
// }
|
|
35
|
+
if (!result.canceled) {
|
|
36
|
+
await this.handleDocumentPicked(result);
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.log("Document picker error:", error);
|
|
40
|
+
this.props.onUploadFailed(null, error.message);
|
|
41
|
+
}
|
|
42
42
|
});
|
|
43
43
|
_defineProperty(this, "handleDocumentPicked", async documentResult => {
|
|
44
44
|
const {
|
|
@@ -61,19 +61,19 @@ class DocumentUploader extends Component {
|
|
|
61
61
|
mimeType
|
|
62
62
|
} = asset;
|
|
63
63
|
let file, fileExt;
|
|
64
|
-
if (name && name.includes(
|
|
65
|
-
const lastDotIndex = name.lastIndexOf(
|
|
64
|
+
if (name && name.includes(".")) {
|
|
65
|
+
const lastDotIndex = name.lastIndexOf(".");
|
|
66
66
|
file = name.substring(0, lastDotIndex);
|
|
67
67
|
fileExt = name.substring(lastDotIndex + 1);
|
|
68
68
|
} else {
|
|
69
69
|
// Fallback: extract extension from mimeType
|
|
70
|
-
file = name ||
|
|
70
|
+
file = name || "document";
|
|
71
71
|
if (mimeType) {
|
|
72
|
-
const mimeTypeParts = mimeType.split(
|
|
72
|
+
const mimeTypeParts = mimeType.split("/");
|
|
73
73
|
// Handle specific MIME type mappings
|
|
74
|
-
if (mimeType ===
|
|
74
|
+
if (mimeType === "application/pdf") fileExt = "pdf";else if (mimeType.startsWith("image/")) fileExt = mimeTypeParts[1];else if (mimeType.startsWith("text/")) fileExt = "txt";else fileExt = mimeTypeParts[1] || "pdf";
|
|
75
75
|
} else {
|
|
76
|
-
fileExt =
|
|
76
|
+
fileExt = "pdf";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -90,7 +90,7 @@ class DocumentUploader extends Component {
|
|
|
90
90
|
});
|
|
91
91
|
const fileUrl = Config.env.baseUploadsUrl + res.key;
|
|
92
92
|
this.props.onUploadSuccess(fileUrl, uploadUri);
|
|
93
|
-
console.log(
|
|
93
|
+
console.log("Upload success", fileUrl);
|
|
94
94
|
return {
|
|
95
95
|
success: true,
|
|
96
96
|
url: fileUrl,
|
|
@@ -111,7 +111,7 @@ class DocumentUploader extends Component {
|
|
|
111
111
|
const results = await Promise.all(uploadPromises);
|
|
112
112
|
return results;
|
|
113
113
|
} catch (error) {
|
|
114
|
-
console.error(
|
|
114
|
+
console.error("Document upload error:", error);
|
|
115
115
|
return [];
|
|
116
116
|
} finally {
|
|
117
117
|
this.setState({
|
|
@@ -179,8 +179,8 @@ class DocumentUploader extends Component {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
_defineProperty(DocumentUploader, "defaultProps", {
|
|
182
|
-
allowedTypes: [
|
|
183
|
-
buttonTitle:
|
|
182
|
+
allowedTypes: ["application/pdf"],
|
|
183
|
+
buttonTitle: "Upload Document",
|
|
184
184
|
buttonStyle: {},
|
|
185
185
|
buttonTextStyle: {},
|
|
186
186
|
onUploadStarted: () => {},
|
|
@@ -196,24 +196,24 @@ const styles = StyleSheet.create({
|
|
|
196
196
|
marginVertical: 10
|
|
197
197
|
},
|
|
198
198
|
uploadButton: {
|
|
199
|
-
flexDirection:
|
|
200
|
-
alignItems:
|
|
201
|
-
justifyContent:
|
|
199
|
+
flexDirection: "row",
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
justifyContent: "center",
|
|
202
202
|
paddingVertical: 8,
|
|
203
203
|
paddingHorizontal: 16,
|
|
204
204
|
borderRadius: 6,
|
|
205
|
-
backgroundColor:
|
|
205
|
+
backgroundColor: "#fff",
|
|
206
206
|
borderWidth: 1,
|
|
207
|
-
borderColor:
|
|
207
|
+
borderColor: "#007AFF"
|
|
208
208
|
},
|
|
209
209
|
buttonContent: {
|
|
210
|
-
flexDirection:
|
|
211
|
-
alignItems:
|
|
210
|
+
flexDirection: "row",
|
|
211
|
+
alignItems: "center"
|
|
212
212
|
},
|
|
213
213
|
buttonText: {
|
|
214
|
-
color:
|
|
214
|
+
color: "#fff",
|
|
215
215
|
fontSize: 16,
|
|
216
|
-
fontWeight:
|
|
216
|
+
fontWeight: "500",
|
|
217
217
|
marginLeft: 8
|
|
218
218
|
},
|
|
219
219
|
icon: {
|
|
@@ -221,18 +221,18 @@ const styles = StyleSheet.create({
|
|
|
221
221
|
},
|
|
222
222
|
progressContainer: {
|
|
223
223
|
marginTop: 8,
|
|
224
|
-
alignItems:
|
|
224
|
+
alignItems: "center"
|
|
225
225
|
},
|
|
226
226
|
progressBar: {
|
|
227
227
|
height: 4,
|
|
228
|
-
width:
|
|
229
|
-
backgroundColor:
|
|
228
|
+
width: "100%",
|
|
229
|
+
backgroundColor: "#E0E0E0",
|
|
230
230
|
borderRadius: 2,
|
|
231
|
-
overflow:
|
|
231
|
+
overflow: "hidden"
|
|
232
232
|
},
|
|
233
233
|
progressFill: {
|
|
234
|
-
height:
|
|
235
|
-
backgroundColor:
|
|
234
|
+
height: "100%",
|
|
235
|
+
backgroundColor: "#4CAF50"
|
|
236
236
|
},
|
|
237
237
|
progressText: {
|
|
238
238
|
marginTop: 4,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","TouchableOpacity","Text","StyleSheet","ActivityIndicator","Icon","connect","Config","fileActions","getValueOrDefault","TEXT_DARK","getMainBrandingColourFromState","DEFAULT_DOCUMENT_NAME","DocumentUploader","constructor","args","_defineProperty","isUploading","uploadProgress","allowedTypes","multiple","props","documentResult","assets","userId","setState","uploadPromises","map","asset","name","uri","mimeType","file","fileExt","includes","lastDotIndex","lastIndexOf","substring","mimeTypeParts","split","startsWith","fileName","uploadUri","getUploadUrl","onUploadStarted","toUpperCase","res","uploadUserMediaWithProgress","progress","onUploadProgress","fileUrl","env","baseUploadsUrl","key","onUploadSuccess","console","log","success","url","error","onUploadFailed","message","results","Promise","all","buttonTitle","buttonStyle","buttonTextStyle","disabled","state","mainColor","createElement","style","styles","uploadButton","borderColor","onPress","pickDocument","activeOpacity","buttonContent","color","type","size","icon","buttonText","progressContainer","progressBar","progressFill","width","progressText","Math","round","render","container","renderUploadButton","renderProgress","create","marginVertical","flexDirection","alignItems","justifyContent","paddingVertical","paddingHorizontal","borderRadius","backgroundColor","borderWidth","fontSize","fontWeight","marginLeft","marginRight","marginTop","height","overflow","mapStateToProps","user","colourBrandingMain"],"sources":["DocumentUploader.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, TouchableOpacity, Text, StyleSheet, ActivityIndicator } from 'react-native';\nimport { Icon } from '@rneui/themed';\n// import * as DocumentPicker from 'expo-document-picker';\nimport { connect } from 'react-redux';\nimport Config from '../config';\nimport { fileActions } from '../apis';\nimport { getValueOrDefault } from '../helper';\nimport { TEXT_DARK, getMainBrandingColourFromState } from '../colours';\n\nconst DEFAULT_DOCUMENT_NAME = 'document';\n\nclass DocumentUploader extends Component {\n static defaultProps = {\n allowedTypes: ['application/pdf'],\n buttonTitle: 'Upload Document',\n buttonStyle: {},\n buttonTextStyle: {},\n onUploadStarted: () => {},\n onUploadSuccess: () => {},\n onUploadFailed: () => {},\n onUploadProgress: null,\n userId: null,\n fileName: null,\n disabled: false,\n };\n\n state = {\n isUploading: false,\n uploadProgress: 0,\n };\n\n pickDocument = async () => {\n const { allowedTypes, multiple } = this.props;\n\n // try {\n // const result = await DocumentPicker.getDocumentAsync({\n // type: allowedTypes,\n // copyToCacheDirectory: true,\n // multiple: multiple || false,\n // });\n // // console.log('pickDocument', JSON.stringify(result, null, 2));\n\n // if (!result.canceled) {\n // await this.handleDocumentPicked(result);\n // }\n // } catch (error) {\n // console.log('Document picker error:', error);\n // this.props.onUploadFailed(null, error.message);\n // }\n };\n\n handleDocumentPicked = async documentResult => {\n const { assets } = documentResult;\n const { userId } = this.props;\n\n try {\n this.setState({ isUploading: true, uploadProgress: 0 });\n\n // Process each asset in parallel\n const uploadPromises = assets.map(async asset => {\n const { name, uri, mimeType } = asset;\n\n let file, fileExt;\n if (name && name.includes('.')) {\n const lastDotIndex = name.lastIndexOf('.');\n file = name.substring(0, lastDotIndex);\n fileExt = name.substring(lastDotIndex + 1);\n } else {\n // Fallback: extract extension from mimeType\n file = name || 'document';\n if (mimeType) {\n const mimeTypeParts = mimeType.split('/');\n // Handle specific MIME type mappings\n if (mimeType === 'application/pdf') fileExt = 'pdf';\n else if (mimeType.startsWith('image/')) fileExt = mimeTypeParts[1];\n else if (mimeType.startsWith('text/')) fileExt = 'txt';\n else fileExt = mimeTypeParts[1] || 'pdf';\n } else {\n fileExt = 'pdf';\n }\n }\n\n // Generate a unique filename if not provided\n const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_DOCUMENT_NAME)}.${fileExt}`;\n const uploadUri = fileActions.getUploadUrl(userId, fileName);\n // console.log('handleDocumentPicked', JSON.stringify({ uploadUri, uri, name, fileName, mimeType, file, fileExt }, null, 2));\n\n try {\n // Notify parent component that upload has started for this file\n this.props.onUploadStarted(uploadUri, uri, file, fileExt.toUpperCase());\n\n const res = await fileActions.uploadUserMediaWithProgress(uri, uploadUri, progress => {\n if (this.props.onUploadProgress) this.props.onUploadProgress(progress);\n });\n\n const fileUrl = Config.env.baseUploadsUrl + res.key;\n this.props.onUploadSuccess(fileUrl, uploadUri);\n console.log('Upload success', fileUrl);\n return { success: true, url: fileUrl, uploadUri };\n } catch (error) {\n console.error(`Upload failed for ${name}:`, error);\n this.props.onUploadFailed(uploadUri, error.message);\n return { success: false, error, uploadUri };\n }\n });\n\n // Wait for all uploads to complete\n const results = await Promise.all(uploadPromises);\n return results;\n } catch (error) {\n console.error('Document upload error:', error);\n return [];\n } finally {\n this.setState({ isUploading: false, uploadProgress: 0 });\n }\n };\n\n renderUploadButton = () => {\n const { buttonTitle, buttonStyle, buttonTextStyle, disabled } = this.props;\n const { isUploading } = this.state;\n const mainColor = getMainBrandingColourFromState(this.props);\n\n return (\n <TouchableOpacity\n style={[styles.uploadButton, { borderColor: mainColor }, buttonStyle]}\n onPress={this.pickDocument}\n disabled={isUploading || disabled}\n activeOpacity={0.7}\n >\n <View style={styles.buttonContent}>\n {isUploading ? (\n <ActivityIndicator color={mainColor} />\n ) : (\n <Icon name=\"attachment\" type=\"entypo\" color={mainColor} size={18} style={styles.icon} />\n )}\n <Text style={[styles.buttonText, { color: mainColor }, buttonTextStyle]}>{buttonTitle}</Text>\n </View>\n </TouchableOpacity>\n );\n };\n\n renderProgress = () => {\n const { uploadProgress } = this.state;\n if (uploadProgress <= 0 || uploadProgress >= 1) return null;\n\n return (\n <View style={styles.progressContainer}>\n <View style={styles.progressBar}>\n <View style={[styles.progressFill, { width: `${uploadProgress * 100}%` }]} />\n </View>\n <Text style={styles.progressText}>{Math.round(uploadProgress * 100)}%</Text>\n </View>\n );\n };\n\n render() {\n return (\n <View style={styles.container}>\n {this.renderUploadButton()}\n {this.renderProgress()}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n marginVertical: 10,\n },\n uploadButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n paddingVertical: 8,\n paddingHorizontal: 16,\n borderRadius: 6,\n backgroundColor: '#fff',\n borderWidth: 1,\n borderColor: '#007AFF',\n },\n buttonContent: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n buttonText: {\n color: '#fff',\n fontSize: 16,\n fontWeight: '500',\n marginLeft: 8,\n },\n icon: {\n marginRight: 8,\n },\n progressContainer: {\n marginTop: 8,\n alignItems: 'center',\n },\n progressBar: {\n height: 4,\n width: '100%',\n backgroundColor: '#E0E0E0',\n borderRadius: 2,\n overflow: 'hidden',\n },\n progressFill: {\n height: '100%',\n backgroundColor: '#4CAF50',\n },\n progressText: {\n marginTop: 4,\n fontSize: 12,\n color: TEXT_DARK,\n },\n});\n\nconst mapStateToProps = state => {\n const { user } = state;\n return {\n user,\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps)(DocumentUploader);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,cAAc;AAC1F,SAASC,IAAI,QAAQ,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,KAAK,EAAE,MAAM;IACb0B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE;EACd,CAAC;EACDzB,IAAI,EAAE;IACJ0B,WAAW,EAAE;EACf,CAAC;EACDxB,iBAAiB,EAAE;IACjByB,SAAS,EAAE,CAAC;IACZX,UAAU,EAAE;EACd,CAAC;EACDb,WAAW,EAAE;IACXyB,MAAM,EAAE,CAAC;IACTvB,KAAK,EAAE,MAAM;IACbgB,eAAe,EAAE,SAAS;IAC1BD,YAAY,EAAE,CAAC;IACfS,QAAQ,EAAE;EACZ,CAAC;EACDzB,YAAY,EAAE;IACZwB,MAAM,EAAE,MAAM;IACdP,eAAe,EAAE;EACnB,CAAC;EACDf,YAAY,EAAE;IACZqB,SAAS,EAAE,CAAC;IACZJ,QAAQ,EAAE,EAAE;IACZ1B,KAAK,EAAEtE;EACT;AACF,CAAC,CAAC;AAEF,MAAMuG,eAAe,GAAG5C,KAAK,IAAI;EAC/B,MAAM;IAAE6C;EAAK,CAAC,GAAG7C,KAAK;EACtB,OAAO;IACL6C,IAAI;IACJC,kBAAkB,EAAExG,8BAA8B,CAAC0D,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,eAAe/D,OAAO,CAAC2G,eAAe,CAAC,CAACpG,gBAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Component","Text","View","TouchableOpacity","StyleSheet","ActivityIndicator","Icon","DocumentPicker","connect","Config","fileActions","getValueOrDefault","TEXT_DARK","getMainBrandingColourFromState","DEFAULT_DOCUMENT_NAME","DocumentUploader","constructor","args","_defineProperty","isUploading","uploadProgress","allowedTypes","multiple","props","result","getDocumentAsync","type","copyToCacheDirectory","canceled","handleDocumentPicked","error","console","log","onUploadFailed","message","documentResult","assets","userId","setState","uploadPromises","map","asset","name","uri","mimeType","file","fileExt","includes","lastDotIndex","lastIndexOf","substring","mimeTypeParts","split","startsWith","fileName","uploadUri","getUploadUrl","onUploadStarted","toUpperCase","res","uploadUserMediaWithProgress","progress","onUploadProgress","fileUrl","env","baseUploadsUrl","key","onUploadSuccess","success","url","results","Promise","all","buttonTitle","buttonStyle","buttonTextStyle","disabled","state","mainColor","createElement","style","styles","uploadButton","borderColor","onPress","pickDocument","activeOpacity","buttonContent","color","size","icon","buttonText","progressContainer","progressBar","progressFill","width","progressText","Math","round","render","container","renderUploadButton","renderProgress","create","marginVertical","flexDirection","alignItems","justifyContent","paddingVertical","paddingHorizontal","borderRadius","backgroundColor","borderWidth","fontSize","fontWeight","marginLeft","marginRight","marginTop","height","overflow","mapStateToProps","user","colourBrandingMain"],"sources":["DocumentUploader.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tView,\n\tTouchableOpacity,\n\tStyleSheet,\n\tActivityIndicator,\n} from \"react-native\";\nimport { Icon } from \"@rneui/themed\";\nimport * as DocumentPicker from \"expo-document-picker\";\nimport { connect } from \"react-redux\";\nimport Config from \"../config\";\nimport { fileActions } from \"../apis\";\nimport { getValueOrDefault } from \"../helper\";\nimport { TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\n\nconst DEFAULT_DOCUMENT_NAME = \"document\";\n\nclass DocumentUploader extends Component {\n\tstatic defaultProps = {\n\t\tallowedTypes: [\"application/pdf\"],\n\t\tbuttonTitle: \"Upload Document\",\n\t\tbuttonStyle: {},\n\t\tbuttonTextStyle: {},\n\t\tonUploadStarted: () => {},\n\t\tonUploadSuccess: () => {},\n\t\tonUploadFailed: () => {},\n\t\tonUploadProgress: null,\n\t\tuserId: null,\n\t\tfileName: null,\n\t\tdisabled: false,\n\t};\n\n\tstate = {\n\t\tisUploading: false,\n\t\tuploadProgress: 0,\n\t};\n\n\tpickDocument = async () => {\n\t\tconst { allowedTypes, multiple } = this.props;\n\n\t\ttry {\n\t\t\tconst result = await DocumentPicker.getDocumentAsync({\n\t\t\t\ttype: allowedTypes,\n\t\t\t\tcopyToCacheDirectory: true,\n\t\t\t\tmultiple: multiple || false,\n\t\t\t});\n\t\t\t// console.log('pickDocument', JSON.stringify(result, null, 2));\n\n\t\t\tif (!result.canceled) {\n\t\t\t\tawait this.handleDocumentPicked(result);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.log(\"Document picker error:\", error);\n\t\t\tthis.props.onUploadFailed(null, error.message);\n\t\t}\n\t};\n\n\thandleDocumentPicked = async (documentResult) => {\n\t\tconst { assets } = documentResult;\n\t\tconst { userId } = this.props;\n\n\t\ttry {\n\t\t\tthis.setState({ isUploading: true, uploadProgress: 0 });\n\n\t\t\t// Process each asset in parallel\n\t\t\tconst uploadPromises = assets.map(async (asset) => {\n\t\t\t\tconst { name, uri, mimeType } = asset;\n\n\t\t\t\tlet file, fileExt;\n\t\t\t\tif (name && name.includes(\".\")) {\n\t\t\t\t\tconst lastDotIndex = name.lastIndexOf(\".\");\n\t\t\t\t\tfile = name.substring(0, lastDotIndex);\n\t\t\t\t\tfileExt = name.substring(lastDotIndex + 1);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback: extract extension from mimeType\n\t\t\t\t\tfile = name || \"document\";\n\t\t\t\t\tif (mimeType) {\n\t\t\t\t\t\tconst mimeTypeParts = mimeType.split(\"/\");\n\t\t\t\t\t\t// Handle specific MIME type mappings\n\t\t\t\t\t\tif (mimeType === \"application/pdf\") fileExt = \"pdf\";\n\t\t\t\t\t\telse if (mimeType.startsWith(\"image/\")) fileExt = mimeTypeParts[1];\n\t\t\t\t\t\telse if (mimeType.startsWith(\"text/\")) fileExt = \"txt\";\n\t\t\t\t\t\telse fileExt = mimeTypeParts[1] || \"pdf\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfileExt = \"pdf\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Generate a unique filename if not provided\n\t\t\t\tconst fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_DOCUMENT_NAME)}.${fileExt}`;\n\t\t\t\tconst uploadUri = fileActions.getUploadUrl(userId, fileName);\n\t\t\t\t// console.log('handleDocumentPicked', JSON.stringify({ uploadUri, uri, name, fileName, mimeType, file, fileExt }, null, 2));\n\n\t\t\t\ttry {\n\t\t\t\t\t// Notify parent component that upload has started for this file\n\t\t\t\t\tthis.props.onUploadStarted(\n\t\t\t\t\t\tuploadUri,\n\t\t\t\t\t\turi,\n\t\t\t\t\t\tfile,\n\t\t\t\t\t\tfileExt.toUpperCase(),\n\t\t\t\t\t);\n\n\t\t\t\t\tconst res = await fileActions.uploadUserMediaWithProgress(\n\t\t\t\t\t\turi,\n\t\t\t\t\t\tuploadUri,\n\t\t\t\t\t\t(progress) => {\n\t\t\t\t\t\t\tif (this.props.onUploadProgress)\n\t\t\t\t\t\t\t\tthis.props.onUploadProgress(progress);\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tconst fileUrl = Config.env.baseUploadsUrl + res.key;\n\t\t\t\t\tthis.props.onUploadSuccess(fileUrl, uploadUri);\n\t\t\t\t\tconsole.log(\"Upload success\", fileUrl);\n\t\t\t\t\treturn { success: true, url: fileUrl, uploadUri };\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(`Upload failed for ${name}:`, error);\n\t\t\t\t\tthis.props.onUploadFailed(uploadUri, error.message);\n\t\t\t\t\treturn { success: false, error, uploadUri };\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Wait for all uploads to complete\n\t\t\tconst results = await Promise.all(uploadPromises);\n\t\t\treturn results;\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Document upload error:\", error);\n\t\t\treturn [];\n\t\t} finally {\n\t\t\tthis.setState({ isUploading: false, uploadProgress: 0 });\n\t\t}\n\t};\n\n\trenderUploadButton = () => {\n\t\tconst { buttonTitle, buttonStyle, buttonTextStyle, disabled } = this.props;\n\t\tconst { isUploading } = this.state;\n\t\tconst mainColor = getMainBrandingColourFromState(this.props);\n\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={[styles.uploadButton, { borderColor: mainColor }, buttonStyle]}\n\t\t\t\tonPress={this.pickDocument}\n\t\t\t\tdisabled={isUploading || disabled}\n\t\t\t\tactiveOpacity={0.7}\n\t\t\t>\n\t\t\t\t<View style={styles.buttonContent}>\n\t\t\t\t\t{isUploading ? (\n\t\t\t\t\t\t<ActivityIndicator color={mainColor} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname=\"attachment\"\n\t\t\t\t\t\t\ttype=\"entypo\"\n\t\t\t\t\t\t\tcolor={mainColor}\n\t\t\t\t\t\t\tsize={18}\n\t\t\t\t\t\t\tstyle={styles.icon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[styles.buttonText, { color: mainColor }, buttonTextStyle]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{buttonTitle}\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t};\n\n\trenderProgress = () => {\n\t\tconst { uploadProgress } = this.state;\n\t\tif (uploadProgress <= 0 || uploadProgress >= 1) return null;\n\n\t\treturn (\n\t\t\t<View style={styles.progressContainer}>\n\t\t\t\t<View style={styles.progressBar}>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={[styles.progressFill, { width: `${uploadProgress * 100}%` }]}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Text style={styles.progressText}>\n\t\t\t\t\t{Math.round(uploadProgress * 100)}%\n\t\t\t\t</Text>\n\t\t\t</View>\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.renderUploadButton()}\n\t\t\t\t{this.renderProgress()}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tmarginVertical: 10,\n\t},\n\tuploadButton: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tpaddingVertical: 8,\n\t\tpaddingHorizontal: 16,\n\t\tborderRadius: 6,\n\t\tbackgroundColor: \"#fff\",\n\t\tborderWidth: 1,\n\t\tborderColor: \"#007AFF\",\n\t},\n\tbuttonContent: {\n\t\tflexDirection: \"row\",\n\t\talignItems: \"center\",\n\t},\n\tbuttonText: {\n\t\tcolor: \"#fff\",\n\t\tfontSize: 16,\n\t\tfontWeight: \"500\",\n\t\tmarginLeft: 8,\n\t},\n\ticon: {\n\t\tmarginRight: 8,\n\t},\n\tprogressContainer: {\n\t\tmarginTop: 8,\n\t\talignItems: \"center\",\n\t},\n\tprogressBar: {\n\t\theight: 4,\n\t\twidth: \"100%\",\n\t\tbackgroundColor: \"#E0E0E0\",\n\t\tborderRadius: 2,\n\t\toverflow: \"hidden\",\n\t},\n\tprogressFill: {\n\t\theight: \"100%\",\n\t\tbackgroundColor: \"#4CAF50\",\n\t},\n\tprogressText: {\n\t\tmarginTop: 4,\n\t\tfontSize: 12,\n\t\tcolor: TEXT_DARK,\n\t},\n});\n\nconst mapStateToProps = (state) => {\n\tconst { user } = state;\n\treturn {\n\t\tuser,\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nexport default connect(mapStateToProps)(DocumentUploader);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,QACX,cAAc;AACrB,SAASC,IAAI,QAAQ,eAAe;AACpC,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AACtD,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,WAAW,QAAQ,SAAS;AACrC,SAASC,iBAAiB,QAAQ,WAAW;AAC7C,SAASC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AAEtE,MAAMC,qBAAqB,GAAG,UAA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C;IACfC,eAAe,EAAE,MAAM;IACvBC,WAAW,EAAE,CAAC;IACd7B,WAAW,EAAE;EACd,CAAC;EACDI,aAAa,EAAE;IACdkB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACb,CAAC;EACDf,UAAU,EAAE;IACXH,KAAK,EAAE,MAAM;IACbyB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE;EACb,CAAC;EACDzB,IAAI,EAAE;IACL0B,WAAW,EAAE;EACd,CAAC;EACDxB,iBAAiB,EAAE;IAClByB,SAAS,EAAE,CAAC;IACZX,UAAU,EAAE;EACb,CAAC;EACDb,WAAW,EAAE;IACZyB,MAAM,EAAE,CAAC;IACTvB,KAAK,EAAE,MAAM;IACbgB,eAAe,EAAE,SAAS;IAC1BD,YAAY,EAAE,CAAC;IACfS,QAAQ,EAAE;EACX,CAAC;EACDzB,YAAY,EAAE;IACbwB,MAAM,EAAE,MAAM;IACdP,eAAe,EAAE;EAClB,CAAC;EACDf,YAAY,EAAE;IACbqB,SAAS,EAAE,CAAC;IACZJ,QAAQ,EAAE,EAAE;IACZzB,KAAK,EAAE5E;EACR;AACD,CAAC,CAAC;AAEF,MAAM4G,eAAe,GAAI3C,KAAK,IAAK;EAClC,MAAM;IAAE4C;EAAK,CAAC,GAAG5C,KAAK;EACtB,OAAO;IACN4C,IAAI;IACJC,kBAAkB,EAAE7G,8BAA8B,CAACgE,KAAK;EACzD,CAAC;AACF,CAAC;AAED,eAAerE,OAAO,CAACgH,eAAe,CAAC,CAACzG,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,13 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import { TouchableOpacity } from "react-native";
|
|
7
|
+
import { Text } from "./Text";
|
|
8
|
+
import { Icon } from "@rneui/themed";
|
|
9
|
+
import { connect } from "react-redux";
|
|
10
|
+
import { TEXT_DARK, getMainBrandingColourFromState } from "../colours";
|
|
10
11
|
class DropDownItem extends Component {
|
|
11
12
|
constructor(...args) {
|
|
12
13
|
super(...args);
|
|
@@ -40,28 +41,28 @@ class DropDownItem extends Component {
|
|
|
40
41
|
}
|
|
41
42
|
const styles = {
|
|
42
43
|
container: {
|
|
43
|
-
flexDirection:
|
|
44
|
+
flexDirection: "row",
|
|
44
45
|
marginBottom: 12,
|
|
45
46
|
minHeight: 18,
|
|
46
|
-
width:
|
|
47
|
-
position:
|
|
47
|
+
width: "100%",
|
|
48
|
+
position: "relative"
|
|
48
49
|
},
|
|
49
50
|
text: {
|
|
50
|
-
fontFamily:
|
|
51
|
+
fontFamily: "sf-medium",
|
|
51
52
|
fontSize: 16,
|
|
52
53
|
lineHeight: 18,
|
|
53
54
|
color: TEXT_DARK,
|
|
54
|
-
backgroundColor:
|
|
55
|
+
backgroundColor: "transparent"
|
|
55
56
|
},
|
|
56
57
|
dropDownItem_Icon: {
|
|
57
58
|
marginRight: 8,
|
|
58
59
|
width: 18,
|
|
59
|
-
alignSelf:
|
|
60
|
+
alignSelf: "center"
|
|
60
61
|
},
|
|
61
62
|
dropDownItem_IconStyle: {
|
|
62
63
|
fontSize: 16,
|
|
63
64
|
lineHeight: 18,
|
|
64
|
-
textAlign:
|
|
65
|
+
textAlign: "center"
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
const mapStateToProps = state => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","_","
|
|
1
|
+
{"version":3,"names":["React","Component","_","TouchableOpacity","Text","Icon","connect","TEXT_DARK","getMainBrandingColourFromState","DropDownItem","constructor","args","_defineProperty","renderIcon","isUndefined","props","icon","createElement","name","type","style","styles","dropDownItem_Icon","iconStyle","dropDownItem_IconStyle","fontSize","color","colourBrandingMain","render","container","last","marginBottom","onPress","activeOpacity","text","textStyle","flexDirection","minHeight","width","position","fontFamily","lineHeight","backgroundColor","marginRight","alignSelf","textAlign","mapStateToProps","state","dropDownItem"],"sources":["DropDownItem.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport _ from \"lodash\";\nimport { TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"@rneui/themed\";\nimport { connect } from \"react-redux\";\nimport { TEXT_DARK, getMainBrandingColourFromState } from \"../colours\";\n\nclass DropDownItem extends Component {\n\tstate = {};\n\n\trenderIcon() {\n\t\tif (!_.isUndefined(this.props.icon)) {\n\t\t\treturn (\n\t\t\t\t<Icon\n\t\t\t\t\tname={this.props.icon}\n\t\t\t\t\ttype=\"font-awesome\"\n\t\t\t\t\tstyle={styles.dropDownItem_Icon}\n\t\t\t\t\ticonStyle={[\n\t\t\t\t\t\tstyles.dropDownItem_IconStyle,\n\t\t\t\t\t\t{ fontSize: 16, color: this.props.colourBrandingMain },\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.container,\n\t\t\t\t\tthis.props.last && { marginBottom: 0 },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t\tonPress={this.props.onPress}\n\t\t\t\tactiveOpacity={0.6}\n\t\t\t>\n\t\t\t\t{this.renderIcon()}\n\t\t\t\t<Text style={[styles.text, this.props.textStyle]}>\n\t\t\t\t\t{this.props.text}\n\t\t\t\t</Text>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tflexDirection: \"row\",\n\t\tmarginBottom: 12,\n\t\tminHeight: 18,\n\t\twidth: \"100%\",\n\t\tposition: \"relative\",\n\t},\n\ttext: {\n\t\tfontFamily: \"sf-medium\",\n\t\tfontSize: 16,\n\t\tlineHeight: 18,\n\t\tcolor: TEXT_DARK,\n\t\tbackgroundColor: \"transparent\",\n\t},\n\tdropDownItem_Icon: {\n\t\tmarginRight: 8,\n\t\twidth: 18,\n\t\talignSelf: \"center\",\n\t},\n\tdropDownItem_IconStyle: {\n\t\tfontSize: 16,\n\t\tlineHeight: 18,\n\t\ttextAlign: \"center\",\n\t},\n};\n\nconst mapStateToProps = (state) => {\n\treturn {\n\t\tcolourBrandingMain: getMainBrandingColourFromState(state),\n\t};\n};\n\nconst dropDownItem = connect(mapStateToProps, {})(DropDownItem);\nexport { dropDownItem as DropDownItem };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,SAAS,EAAEC,8BAA8B,QAAQ,YAAY;AAEtE,MAAMC,YAAY,SAASR,SAAS,CAAC;EAAAS,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBAC5B,CAAC,CAAC;EAAA;EAEVC,UAAUA,CAAA,EAAG;IACZ,IAAI,CAACX,CAAC,CAACY,WAAW,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI,CAAC,EAAE;MACpC,oBACChB,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EAAE,CAAC;IACdL,KAAK,EAAE,EAAE;IACTM,SAAS,EAAE;EACZ,CAAC;EACDpB,sBAAsB,EAAE;IACvBC,QAAQ,EAAE,EAAE;IACZgB,UAAU,EAAE,EAAE;IACdI,SAAS,EAAE;EACZ;AACD,CAAC;AAED,MAAMC,eAAe,GAAIC,KAAK,IAAK;EAClC,OAAO;IACNpB,kBAAkB,EAAEnB,8BAA8B,CAACuC,KAAK;EACzD,CAAC;AACF,CAAC;AAED,MAAMC,YAAY,GAAG1C,OAAO,CAACwC,eAAe,EAAE,CAAC,CAAC,CAAC,CAACrC,YAAY,CAAC;AAC/D,SAASuC,YAAY,IAAIvC,YAAY","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
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 } from
|
|
4
|
+
import React, { Component } from "react";
|
|
5
|
+
import { View } from "react-native";
|
|
6
6
|
class DropDownMenu extends Component {
|
|
7
7
|
constructor(...args) {
|
|
8
8
|
super(...args);
|
|
@@ -20,7 +20,7 @@ class DropDownMenu extends Component {
|
|
|
20
20
|
const styles = {
|
|
21
21
|
container: {
|
|
22
22
|
borderRadius: 2,
|
|
23
|
-
shadowColor:
|
|
23
|
+
shadowColor: "#000",
|
|
24
24
|
shadowOffset: {
|
|
25
25
|
width: 0,
|
|
26
26
|
height: 2
|
|
@@ -29,10 +29,10 @@ const styles = {
|
|
|
29
29
|
shadowRadius: 4,
|
|
30
30
|
elevation: 4,
|
|
31
31
|
zIndex: 10,
|
|
32
|
-
backgroundColor:
|
|
32
|
+
backgroundColor: "#fff",
|
|
33
33
|
padding: 16,
|
|
34
34
|
paddingVertical: 14,
|
|
35
|
-
position:
|
|
35
|
+
position: "absolute",
|
|
36
36
|
right: 0,
|
|
37
37
|
top: 0
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","DropDownMenu","constructor","args","_defineProperty","render","props","visible","createElement","style","styles","container","children","borderRadius","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","zIndex","backgroundColor","padding","paddingVertical","position","right","top"],"sources":["DropDownMenu.js"],"sourcesContent":["import React, { Component } from
|
|
1
|
+
{"version":3,"names":["React","Component","View","DropDownMenu","constructor","args","_defineProperty","render","props","visible","createElement","style","styles","container","children","borderRadius","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","zIndex","backgroundColor","padding","paddingVertical","position","right","top"],"sources":["DropDownMenu.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { View } from \"react-native\";\n\nclass DropDownMenu extends Component {\n\tstate = {};\n\n\trender() {\n\t\tif (!this.props.visible) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{this.props.children}\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tborderRadius: 2,\n\t\tshadowColor: \"#000\",\n\t\tshadowOffset: {\n\t\t\twidth: 0,\n\t\t\theight: 2,\n\t\t},\n\t\tshadowOpacity: 0.2,\n\t\tshadowRadius: 4,\n\t\televation: 4,\n\t\tzIndex: 10,\n\t\tbackgroundColor: \"#fff\",\n\t\tpadding: 16,\n\t\tpaddingVertical: 14,\n\n\t\tposition: \"absolute\",\n\t\tright: 0,\n\t\ttop: 0,\n\t},\n};\n\nexport { DropDownMenu };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AAEnC,MAAMC,YAAY,SAASF,SAAS,CAAC;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBAC5B,CAAC,CAAC;EAAA;EAEVC,MAAMA,CAAA,EAAG;IACR,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,OAAO,EAAE;MACxB,OAAO,IAAI;IACZ;IACA,oBACCT,KAAA,CAAAU,aAAA,CAACR,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACL,KAAK,CAACG,KAAK;IAAE,GAChD,IAAI,CAACH,KAAK,CAACM,QACP,CAAC;EAET;AACD;AAEA,MAAMF,MAAM,GAAG;EACdC,SAAS,EAAE;IACVE,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACbC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE;IACT,CAAC;IACDC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,MAAM,EAAE,EAAE;IACVC,eAAe,EAAE,MAAM;IACvBC,OAAO,EAAE,EAAE;IACXC,eAAe,EAAE,EAAE;IAEnBC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACN;AACD,CAAC;AAED,SAAS1B,YAAY","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, ScrollView, StyleSheet } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import _ from "lodash";
|
|
5
|
+
import { TEXT_BLUEGREY } from "../colours";
|
|
5
6
|
class EmptyStateMain extends PureComponent {
|
|
6
7
|
renderPlaceHolder(index, opacity = 1) {
|
|
7
8
|
const barCount = _.isUndefined(this.props.barCount) ? 3 : this.props.barCount;
|
|
@@ -19,7 +20,7 @@ class EmptyStateMain extends PureComponent {
|
|
|
19
20
|
style: [styles.container, this.props.style]
|
|
20
21
|
}, !this.props.hideTitle && /*#__PURE__*/React.createElement(Text, {
|
|
21
22
|
style: styles.titleText
|
|
22
|
-
}, this.props.title ||
|
|
23
|
+
}, this.props.title || "Nothing to see here"), this.props.content, /*#__PURE__*/React.createElement(ScrollView, {
|
|
23
24
|
style: styles.itemContainer
|
|
24
25
|
}, this.renderPlaceHolder(0, 0.8), this.renderPlaceHolder(1, 0.6), this.renderPlaceHolder(2, 0.4)));
|
|
25
26
|
}
|
|
@@ -30,19 +31,19 @@ const styles = StyleSheet.create({
|
|
|
30
31
|
paddingVertical: 5
|
|
31
32
|
},
|
|
32
33
|
titleText: {
|
|
33
|
-
fontFamily:
|
|
34
|
+
fontFamily: "qs-bold",
|
|
34
35
|
fontSize: 16,
|
|
35
36
|
color: TEXT_BLUEGREY
|
|
36
37
|
},
|
|
37
38
|
itemContainer: {
|
|
38
39
|
marginTop: 20,
|
|
39
|
-
flexDirection:
|
|
40
|
+
flexDirection: "column"
|
|
40
41
|
},
|
|
41
42
|
item: {
|
|
42
43
|
borderRadius: 4,
|
|
43
|
-
width:
|
|
44
|
+
width: "100%",
|
|
44
45
|
height: 32,
|
|
45
|
-
backgroundColor:
|
|
46
|
+
backgroundColor: "#e6ebef",
|
|
46
47
|
marginBottom: 17
|
|
47
48
|
}
|
|
48
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","ScrollView","StyleSheet","Text","_","TEXT_BLUEGREY","EmptyStateMain","renderPlaceHolder","index","opacity","barCount","isUndefined","props","createElement","style","styles","item","render","container","hideTitle","titleText","title","content","itemContainer","create","borderRadius","paddingVertical","fontFamily","fontSize","color","marginTop","flexDirection","width","height","backgroundColor","marginBottom"],"sources":["EmptyStateMain.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, ScrollView, StyleSheet } from \"react-native\";\nimport { Text } from \"./Text\";\nimport _ from \"lodash\";\nimport { TEXT_BLUEGREY } from \"../colours\";\n\nclass EmptyStateMain extends PureComponent {\n\trenderPlaceHolder(index, opacity = 1) {\n\t\tconst barCount = _.isUndefined(this.props.barCount)\n\t\t\t? 3\n\t\t\t: this.props.barCount;\n\t\tif (barCount <= index) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <View style={[styles.item, { opacity }]} />;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View style={[styles.container, this.props.style]}>\n\t\t\t\t{!this.props.hideTitle && (\n\t\t\t\t\t<Text style={styles.titleText}>\n\t\t\t\t\t\t{this.props.title || \"Nothing to see here\"}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t{this.props.content}\n\t\t\t\t<ScrollView style={styles.itemContainer}>\n\t\t\t\t\t{this.renderPlaceHolder(0, 0.8)}\n\t\t\t\t\t{this.renderPlaceHolder(1, 0.6)}\n\t\t\t\t\t{this.renderPlaceHolder(2, 0.4)}\n\t\t\t\t</ScrollView>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tborderRadius: 5,\n\t\tpaddingVertical: 5,\n\t},\n\ttitleText: {\n\t\tfontFamily: \"qs-bold\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_BLUEGREY,\n\t},\n\titemContainer: {\n\t\tmarginTop: 20,\n\t\tflexDirection: \"column\",\n\t},\n\titem: {\n\t\tborderRadius: 4,\n\t\twidth: \"100%\",\n\t\theight: 32,\n\t\tbackgroundColor: \"#e6ebef\",\n\t\tmarginBottom: 17,\n\t},\n});\n\nexport default EmptyStateMain;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC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AAMQ,MAAM,GAAGb,UAAU,CAACsB,MAAM,CAAC;EAChCN,SAAS,EAAE;IACVO,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE;EAClB,CAAC;EACDN,SAAS,EAAE;IACVO,UAAU,EAAE,SAAS;IACrBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAExB;EACR,CAAC;EACDkB,aAAa,EAAE;IACdO,SAAS,EAAE,EAAE;IACbC,aAAa,EAAE;EAChB,CAAC;EACDf,IAAI,EAAE;IACLS,YAAY,EAAE,CAAC;IACfO,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,EAAE;IACVC,eAAe,EAAE,SAAS;IAC1BC,YAAY,EAAE;EACf;AACD,CAAC,CAAC;AAEF,eAAe7B,cAAc","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { View, ScrollView, StyleSheet } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { TEXT_BLUEGREY } from "../colours";
|
|
4
5
|
class EmptyStateWidget extends PureComponent {
|
|
5
6
|
renderPlaceHolder(opacity = 1) {
|
|
6
7
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -16,7 +17,7 @@ class EmptyStateWidget extends PureComponent {
|
|
|
16
17
|
}, this.props.style]
|
|
17
18
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
18
19
|
style: styles.titleText
|
|
19
|
-
}, this.props.title ||
|
|
20
|
+
}, this.props.title || "Nothing to see here"), /*#__PURE__*/React.createElement(ScrollView, {
|
|
20
21
|
horizontal: true,
|
|
21
22
|
style: styles.itemContainer
|
|
22
23
|
}, this.renderPlaceHolder(0.8), this.renderPlaceHolder(0.6), this.renderPlaceHolder(0.4), this.renderPlaceHolder(0.2)));
|
|
@@ -28,7 +29,7 @@ const styles = StyleSheet.create({
|
|
|
28
29
|
paddingVertical: 5
|
|
29
30
|
},
|
|
30
31
|
titleText: {
|
|
31
|
-
fontFamily:
|
|
32
|
+
fontFamily: "qs-bold",
|
|
32
33
|
fontSize: 16,
|
|
33
34
|
color: TEXT_BLUEGREY
|
|
34
35
|
},
|
|
@@ -39,7 +40,7 @@ const styles = StyleSheet.create({
|
|
|
39
40
|
borderRadius: 4,
|
|
40
41
|
width: 97,
|
|
41
42
|
height: 98,
|
|
42
|
-
backgroundColor:
|
|
43
|
+
backgroundColor: "#e6ebef",
|
|
43
44
|
marginRight: 17
|
|
44
45
|
}
|
|
45
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","ScrollView","StyleSheet","Text","TEXT_BLUEGREY","EmptyStateWidget","renderPlaceHolder","opacity","createElement","style","styles","item","render","container","props","height","titleText","title","horizontal","itemContainer","create","borderRadius","paddingVertical","fontFamily","fontSize","color","marginTop","width","backgroundColor","marginRight"],"sources":["EmptyStateWidget.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { View, ScrollView, StyleSheet } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { TEXT_BLUEGREY } from \"../colours\";\n\nclass EmptyStateWidget extends PureComponent {\n\trenderPlaceHolder(opacity = 1) {\n\t\treturn <View style={[styles.item, { opacity }]} />;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.container,\n\t\t\t\t\tthis.props.height && { height: this.props.height },\n\t\t\t\t\tthis.props.style,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<Text style={styles.titleText}>\n\t\t\t\t\t{this.props.title || \"Nothing to see here\"}\n\t\t\t\t</Text>\n\t\t\t\t<ScrollView horizontal style={styles.itemContainer}>\n\t\t\t\t\t{this.renderPlaceHolder(0.8)}\n\t\t\t\t\t{this.renderPlaceHolder(0.6)}\n\t\t\t\t\t{this.renderPlaceHolder(0.4)}\n\t\t\t\t\t{this.renderPlaceHolder(0.2)}\n\t\t\t\t</ScrollView>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tborderRadius: 5,\n\t\tpaddingVertical: 5,\n\t},\n\ttitleText: {\n\t\tfontFamily: \"qs-bold\",\n\t\tfontSize: 16,\n\t\tcolor: TEXT_BLUEGREY,\n\t},\n\titemContainer: {\n\t\tmarginTop: 20,\n\t},\n\titem: {\n\t\tborderRadius: 4,\n\t\twidth: 97,\n\t\theight: 98,\n\t\tbackgroundColor: \"#e6ebef\",\n\t\tmarginRight: 17,\n\t},\n});\n\nexport default EmptyStateWidget;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC3D,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,aAAa,QAAQ,YAAY;AAE1C,MAAMC,gBAAgB,SAASN,aAAa,CAAC;EAC5CO,iBAAiBA,CAACC,OAAO,GAAG,CAAC,EAAE;IAC9B,oBAAOT,KAAA,CAAAU,aAAA,CAACR,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAE;QAAEJ;MAAQ,CAAC;IAAE,CAAE,CAAC;EACnD;EAEAK,MAAMA,CAAA,EAAG;IACR,oBACCd,KAAA,CAAAU,aAAA,CAACR,IAAI;MACJS,KAAK,EAAE,CACNC,MAAM,CAACG,SAAS,EAChB,IAAI,CAACC,KAAK,CAACC,MAAM,IAAI;QAAEA,MAAM,EAAE,IAAI,CAACD,KAAK,CAACC;MAAO,CAAC,EAClD,IAAI,CAACD,KAAK,CAACL,KAAK;IACf,gBAEFX,KAAA,CAAAU,aAAA,CAACL,IAAI;MAACM,KAAK,EAAEC,MAAM,CAACM;IAAU,GAC5B,IAAI,CAACF,KAAK,CAACG,KAAK,IAAI,qBAChB,CAAC,eACPnB,KAAA,CAAAU,aAAA,CAACP,UAAU;MAACiB,UAAU;MAACT,KAAK,EAAEC,MAAM,CAACS;IAAc,GACjD,IAAI,CAACb,iBAAiB,CAAC,GAAG,CAAC,EAC3B,IAAI,CAACA,iBAAiB,CAAC,GAAG,CAAC,EAC3B,IAAI,CAACA,iBAAiB,CAAC,GAAG,CAAC,EAC3B,IAAI,CAACA,iBAAiB,CAAC,GAAG,CAChB,CACP,CAAC;EAET;AACD;AAEA,MAAMI,MAAM,GAAGR,UAAU,CAACkB,MAAM,CAAC;EAChCP,SAAS,EAAE;IACVQ,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE;EAClB,CAAC;EACDN,SAAS,EAAE;IACVO,UAAU,EAAE,SAAS;IACrBC,QAAQ,EAAE,EAAE;IACZC,KAAK,EAAErB;EACR,CAAC;EACDe,aAAa,EAAE;IACdO,SAAS,EAAE;EACZ,CAAC;EACDf,IAAI,EAAE;IACLU,YAAY,EAAE,CAAC;IACfM,KAAK,EAAE,EAAE;IACTZ,MAAM,EAAE,EAAE;IACVa,eAAe,EAAE,SAAS;IAC1BC,WAAW,EAAE;EACd;AACD,CAAC,CAAC;AAEF,eAAexB,gBAAgB","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { TouchableOpacity
|
|
3
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { TouchableOpacity } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { TEXT_DARK } from "../colours";
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
Props-
|
|
@@ -24,7 +25,7 @@ const styles = {
|
|
|
24
25
|
padding: 15
|
|
25
26
|
},
|
|
26
27
|
text: {
|
|
27
|
-
fontFamily:
|
|
28
|
+
fontFamily: "sf-medium",
|
|
28
29
|
color: TEXT_DARK,
|
|
29
30
|
fontSize: 14
|
|
30
31
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","TouchableOpacity","Text","TEXT_DARK","FontScaleButton","render","createElement","style","styles","container","props","onPress","text","largeText","padding","fontFamily","color","fontSize"],"sources":["FontScaleButton.js"],"sourcesContent":["import React, { PureComponent } from
|
|
1
|
+
{"version":3,"names":["React","PureComponent","TouchableOpacity","Text","TEXT_DARK","FontScaleButton","render","createElement","style","styles","container","props","onPress","text","largeText","padding","fontFamily","color","fontSize"],"sources":["FontScaleButton.js"],"sourcesContent":["import React, { PureComponent } from \"react\";\nimport { TouchableOpacity } from \"react-native\";\nimport { Text } from \"./Text\";\nimport { TEXT_DARK } from \"../colours\";\n\n/* \nProps- \n style - custom style for container\n*/\n\nclass FontScaleButton extends PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tstyle={[styles.container, this.props.style]}\n\t\t\t\tonPress={this.props.onPress}\n\t\t\t>\n\t\t\t\t<Text style={styles.text}>\n\t\t\t\t\t<Text>A</Text>\n\t\t\t\t\t<Text>{` `}</Text>\n\t\t\t\t\t<Text style={styles.largeText}>A</Text>\n\t\t\t\t</Text>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nconst styles = {\n\tcontainer: {\n\t\tpadding: 15,\n\t},\n\ttext: {\n\t\tfontFamily: \"sf-medium\",\n\t\tcolor: TEXT_DARK,\n\t\tfontSize: 14,\n\t},\n\tlargeText: {\n\t\tfontSize: 24,\n\t},\n};\n\nexport { FontScaleButton };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,SAAS,QAAQ,YAAY;;AAEtC;AACA;AACA;AACA;;AAEA,MAAMC,eAAe,SAASJ,aAAa,CAAC;EAC3CK,MAAMA,CAAA,EAAG;IACR,oBACCN,KAAA,CAAAO,aAAA,CAACL,gBAAgB;MAChBM,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE,IAAI,CAACC,KAAK,CAACH,KAAK,CAAE;MAC5CI,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC;IAAQ,gBAE5BZ,KAAA,CAAAO,aAAA,CAACJ,IAAI;MAACK,KAAK,EAAEC,MAAM,CAACI;IAAK,gBACxBb,KAAA,CAAAO,aAAA,CAACJ,IAAI,QAAC,GAAO,CAAC,eACdH,KAAA,CAAAO,aAAA,CAACJ,IAAI,QAAE,GAAU,CAAC,eAClBH,KAAA,CAAAO,aAAA,CAACJ,IAAI;MAACK,KAAK,EAAEC,MAAM,CAACK;IAAU,GAAC,GAAO,CACjC,CACW,CAAC;EAErB;AACD;AAEA,MAAML,MAAM,GAAG;EACdC,SAAS,EAAE;IACVK,OAAO,EAAE;EACV,CAAC;EACDF,IAAI,EAAE;IACLG,UAAU,EAAE,WAAW;IACvBC,KAAK,EAAEb,SAAS;IAChBc,QAAQ,EAAE;EACX,CAAC;EACDJ,SAAS,EAAE;IACVI,QAAQ,EAAE;EACX;AACD,CAAC;AAED,SAASb,eAAe","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { TouchableOpacity,
|
|
3
|
-
import {
|
|
1
|
+
import React, { PureComponent } from "react";
|
|
2
|
+
import { TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { TEXT_DARK, LINEGREY } from "../colours";
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
Props-
|
|
@@ -33,9 +34,9 @@ class FontScalePopup extends PureComponent {
|
|
|
33
34
|
}
|
|
34
35
|
const styles = {
|
|
35
36
|
container: {
|
|
36
|
-
flexDirection:
|
|
37
|
+
flexDirection: "row",
|
|
37
38
|
borderRadius: 2,
|
|
38
|
-
shadowColor:
|
|
39
|
+
shadowColor: "#000",
|
|
39
40
|
shadowOffset: {
|
|
40
41
|
width: 0,
|
|
41
42
|
height: 2
|
|
@@ -44,15 +45,15 @@ const styles = {
|
|
|
44
45
|
shadowRadius: 4,
|
|
45
46
|
elevation: 4,
|
|
46
47
|
zIndex: 10,
|
|
47
|
-
backgroundColor:
|
|
48
|
+
backgroundColor: "#fff",
|
|
48
49
|
padding: 2
|
|
49
50
|
},
|
|
50
51
|
button: {
|
|
51
52
|
height: 50,
|
|
52
53
|
width: 64,
|
|
53
54
|
borderColor: LINEGREY,
|
|
54
|
-
alignItems:
|
|
55
|
-
justifyContent:
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
justifyContent: "center"
|
|
56
57
|
},
|
|
57
58
|
buttonLeft: {
|
|
58
59
|
borderRightWidth: 1
|
|
@@ -61,12 +62,12 @@ const styles = {
|
|
|
61
62
|
borderLeftWidth: 1
|
|
62
63
|
},
|
|
63
64
|
smallText: {
|
|
64
|
-
fontFamily:
|
|
65
|
+
fontFamily: "sf-medium",
|
|
65
66
|
color: TEXT_DARK,
|
|
66
67
|
fontSize: 16
|
|
67
68
|
},
|
|
68
69
|
largeText: {
|
|
69
|
-
fontFamily:
|
|
70
|
+
fontFamily: "sf-medium",
|
|
70
71
|
color: TEXT_DARK,
|
|
71
72
|
fontSize: 24
|
|
72
73
|
}
|