@plusscommunities/pluss-core-app 1.4.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/actions/FollowerActions.js +34 -0
- package/dist/module/actions/FollowerActions.js.map +1 -0
- package/dist/module/actions/MediaActions.js +20 -0
- package/dist/module/actions/MediaActions.js.map +1 -0
- package/dist/module/actions/ResidentActions.js +26 -0
- package/dist/module/actions/ResidentActions.js.map +1 -0
- package/dist/module/actions/UserActions.js +214 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/index.js +5 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +14 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/analyticsActions.js +20 -0
- package/dist/module/apis/analyticsActions.js.map +1 -0
- package/dist/module/apis/contactActions.js +27 -0
- package/dist/module/apis/contactActions.js.map +1 -0
- package/dist/module/apis/eventActions.js +163 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +96 -0
- package/dist/module/apis/fileActions.js.map +1 -0
- package/dist/module/apis/followerActions.js +38 -0
- package/dist/module/apis/followerActions.js.map +1 -0
- package/dist/module/apis/index.js +11 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/notificationActions.js +60 -0
- package/dist/module/apis/notificationActions.js.map +1 -0
- package/dist/module/apis/profileActions.js +14 -0
- package/dist/module/apis/profileActions.js.map +1 -0
- package/dist/module/apis/reactionActions.js +78 -0
- package/dist/module/apis/reactionActions.js.map +1 -0
- package/dist/module/apis/typeActions.js +15 -0
- package/dist/module/apis/typeActions.js.map +1 -0
- package/dist/module/apis/userActions.js +104 -0
- package/dist/module/apis/userActions.js.map +1 -0
- package/{assets → dist/module/assets}/icons/reactions/heart.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/party.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/sad.png +0 -0
- package/{assets → dist/module/assets}/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +149 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +45 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/Attachment.js +59 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +70 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +376 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/BackButton.js +62 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +171 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +363 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +785 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +85 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +77 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DropDownItem.js +82 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +46 -0
- package/dist/module/components/DropDownMenu.js.map +1 -0
- package/dist/module/components/EmptyStateMain.js +50 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +52 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +37 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +77 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/FormCard.js +28 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +240 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +77 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +145 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +161 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +174 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +491 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/ImagePopup.js +257 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +72 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +850 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +72 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +164 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +224 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +95 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +51 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +440 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +46 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +188 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +997 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +204 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +66 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +138 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +128 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +333 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +119 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +84 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +129 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +84 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +162 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +25 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +37 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/TextStyle.js +34 -0
- package/dist/module/components/TextStyle.js.map +1 -0
- package/dist/module/components/Toggle.js +70 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +73 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +146 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +291 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +123 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +87 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +325 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +123 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +53 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +416 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +405 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +27 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +16 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/fonts/index.js +2 -0
- package/dist/module/fonts/index.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.js +5 -0
- package/dist/module/fonts/pluss60-icons.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.json +1097 -0
- package/dist/module/helper.js +436 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/index.js +13 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/session.js +54 -0
- package/dist/module/session.js.map +1 -0
- package/dist/module/styles.js +67 -0
- package/dist/module/styles.js.map +1 -0
- package/package.json +22 -5
- package/src/assets/icons/reactions/heart.png +0 -0
- package/src/assets/icons/reactions/party.png +0 -0
- package/src/assets/icons/reactions/sad.png +0 -0
- package/src/assets/icons/reactions/smile.png +0 -0
- package/src/components/CommentReply.js +0 -2
- package/src/constants.js +4 -4
- package/src/helper.js +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ImageUploader.js"],"names":["React","Component","View","ScrollView","TouchableOpacity","Text","Platform","Linking","Modal","Dimensions","StyleSheet","ImageBackground","connect","Icon","_","Camera","MediaLibrary","ImageManipulator","ImagePicker","ImageBrowser","ExpoImageManipulator","Header","Popup","PopupMenu","InlineButton","getValueOrDefault","getThumb300","isVideo","getMainBrandingColourFromState","BOXGREY","INACTIVE_BUTTON","TEXT_BLUEGREY","TEXT_DARK","LINEGREY","Config","fileActions","stockImagesLoaded","imageLibraryLoaded","SCREEN_WIDTH","get","width","SCREEN_HEIGHT","height","DEFAULT_ASPECT","DEFAULT_ALLOWS_EDITING","DEFAULT_ALLOWS_IOS_CAMERA_EDITING","DEFAULT_EXIF","DEFULAT_IMAGE_TYPE","DEFAULT_IMAGE_NAME","DEFAULT_VIDEO_NAME","DEFAULT_SIZE","DEFAULT_COMPRESSION","ImageUploader","constructor","props","hasPermission","getPermissionsAsync","granted","setState","loadingLocalFolders","localAlbums","getAlbumsAsync","includeSmartAlbums","title","id","error","console","log","loadingRemoteFolders","stockImages","getStockPhotos","libraryRes","getMediaFolders","user","site","data","mediaUri","uploadUri","uri","resizeImageAsync","res","uploadUserMediaWithProgress","progress","onUploadProgress","onUploadSuccess","env","baseUploadsUrl","key","e","onUploadFailed","actions","resize","size","saveOptions","format","compress","quality","base64","manipulateAsync","imageUri","fileName","getUploadUrl","userId","onUploadStarted","hideUploadMenu","resized","onlySelectImage","onImageSelected","imagesSelected","imagesUploaded","map","image","i","length","fileType","substring","lastIndexOf","cameraPermission","requestCameraPermissionsAsync","rollPermission","requestPermissionsAsync","status","showWarningPopup","state","loadLocalAlbums","multiple","allowVideo","allowsEditing","askPermissionsAsync","result","launchImageLibraryAsync","mediaTypes","MediaTypeOptions","Images","isEditingEnabled","aspect","exif","cancelled","handleImagePicked","Videos","handleVideoPicked","editingAllowed","OS","allowsEditingIOSCamera","launchCameraAsync","showUploadMenu","showPhotos","selected","showRemote","selectedAlbumId","showCropper","showSelectAlbum","videoSelected","onAttach","selectedType","callback","openCropper","mediaSelected","onLibrarySelected","media","mediaType","MediaType","video","localUri","handleMultiImagePicked","hidePhotos","deleteIndex","indexOf","splice","options","text","onPress","openCamera","push","openVideoCamera","openPhotos","hideLibrary","openLibrary","selectedItemNumber","styles","selectedItemContainer","selectedMarkerContainer","backgroundColor","colourBrandingMain","selectedItemText","selectedItemIcon","warning","componentDidMount","loadRemoteAlbums","camera","roll","innerWarning","closeWarningPopup","goToPermissionSettings","openURL","renderSelectionPreview","selectionPreviewContainer","previewItemContainer","previewItemImage","previewItemRemoveButton","onRemoveImage","previewItemRemoveContainer","previewItemRemoveIcon","renderSelectedAlbum","selectedAlbum","imageLibrary","find","album","selectedAlbumText","onSelectAlbum","selectAlbumButton","selectAlbumButtonText","selectAlbumButtonIcon","renderBrowser","imagesLimit","onSelectionChange","renderSelectedComponent","onSelected","browserContainer","itemContainer","renderAttachButton","canAttach","isEmpty","attachText","buttonContainer","renderSelectAlbumPopup","onSelectAlbumClosed","selectAlbumModal","selectAlbumContainer","selectAlbumTitleContainer","selectAlbumTitle","index","onAlbumSelected","albumOptionContainer","borderTopWidth","albumOptionText","marginHorizontal","color","renderPhotos","popupTitle","contentContainer","render","action","bind","bold","buildOptions","toggleCropper","create","flex","padding","position","top","right","borderRadius","alignItems","justifyContent","fontFamily","fontSize","marginBottom","paddingHorizontal","paddingTop","flexDirection","marginRight","bottom","left","zIndex","borderTopLeftRadius","borderTopRightRadius","maxHeight","borderColor","borderBottomWidth","textAlign","paddingVertical","paddingRight","paddingLeft","overflow","borderWidth","mapStateToProps","filter","folder","Public","Name","RowId","images","forwardRef"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,UAAf,EAA2BC,gBAA3B,EAA6CC,IAA7C,EAAmDC,QAAnD,EAA6DC,OAA7D,EAAsEC,KAAtE,EAA6EC,UAA7E,EAAyFC,UAAzF,EAAqGC,eAArG,QAA4H,cAA5H;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,SAASC,MAAT,QAAuB,aAAvB;AACA,OAAO,KAAKC,YAAZ,MAA8B,oBAA9B;AACA,OAAO,KAAKC,gBAAZ,MAAkC,wBAAlC;AACA,OAAO,KAAKC,WAAZ,MAA6B,mBAA7B;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,oBAAP,MAAiC,wDAAjC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,iBAAT,EAA4BC,WAA5B,EAAyCC,OAAzC,QAAw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CAACyQ,eAAD,EAAkB;AAAEjP,EAAAA,iBAAF;AAAqBC,EAAAA;AAArB,CAAlB,EAA6D,IAA7D,EAAmE;AAAEuP,EAAAA,UAAU,EAAE;AAAd,CAAnE,CAAP,CAAgGxO,aAAhG,CAAf","sourcesContent":["import React, { Component } from 'react';\nimport { View, ScrollView, TouchableOpacity, Text, Platform, Linking, Modal, Dimensions, StyleSheet, ImageBackground } from 'react-native';\nimport { connect } from 'react-redux';\nimport { Icon } from 'react-native-elements';\nimport _ from 'lodash';\nimport { Camera } from 'expo-camera';\nimport * as MediaLibrary from 'expo-media-library';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport * as ImagePicker from 'expo-image-picker';\nimport ImageBrowser from './expo-image-picker-multiple/ImageBrowser';\nimport ExpoImageManipulator from './react-native-expo-image-cropper/ExpoImageManipulator';\nimport Header from './Header';\nimport { Popup } from './Popup';\nimport { PopupMenu } from './PopupMenu';\nimport { InlineButton } from './InlineButton';\nimport { getValueOrDefault, getThumb300, isVideo } from '../helper';\nimport { getMainBrandingColourFromState, BOXGREY, INACTIVE_BUTTON, TEXT_BLUEGREY, TEXT_DARK, LINEGREY } from '../colours';\nimport Config from '../config';\nimport { fileActions } from '../apis';\nimport { stockImagesLoaded, imageLibraryLoaded } from '../actions';\n\nconst SCREEN_WIDTH = Dimensions.get('window').width;\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\nconst DEFAULT_ASPECT = [1, 1];\nconst DEFAULT_ALLOWS_EDITING = true;\nconst DEFAULT_ALLOWS_IOS_CAMERA_EDITING = false;\nconst DEFAULT_EXIF = true;\nconst DEFULAT_IMAGE_TYPE = 'jpeg';\nconst DEFAULT_IMAGE_NAME = 'image';\nconst DEFAULT_VIDEO_NAME = 'video';\nconst DEFAULT_SIZE = {\n width: 1400,\n};\nconst DEFAULT_COMPRESSION = 0.8;\n\nclass ImageUploader extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n showUploadMenu: false,\n warning: null,\n showPhotos: false,\n showRemote: false,\n selected: [],\n selectedType: '',\n onAttach: null,\n selectedAlbumId: '',\n showSelectAlbum: false,\n showCropper: false,\n localAlbums: [],\n loadingLocalFolders: false,\n loadingRemoteFolders: false,\n };\n }\n\n componentDidMount() {\n this.loadLocalAlbums();\n this.loadRemoteAlbums();\n }\n\n loadLocalAlbums = async () => {\n const hasPermission = await MediaLibrary.getPermissionsAsync();\n if (!hasPermission.granted) return;\n\n this.setState({ loadingLocalFolders: true }, async () => {\n try {\n const localAlbums = await MediaLibrary.getAlbumsAsync({ includeSmartAlbums: true });\n this.setState({\n loadingLocalFolders: false,\n localAlbums: [\n {\n title: 'All Photos',\n id: '',\n },\n ...localAlbums,\n ],\n });\n } catch (error) {\n console.log('loadLocalAlbums - error', error);\n this.setState({ loadingLocalFolders: false });\n }\n });\n };\n\n loadRemoteAlbums = () => {\n this.setState({ loadingRemoteFolders: true }, async () => {\n try {\n const stockImages = await fileActions.getStockPhotos();\n this.props.stockImagesLoaded(stockImages);\n const libraryRes = await fileActions.getMediaFolders(this.props.user.site);\n this.props.imageLibraryLoaded(libraryRes.data);\n } catch (error) {\n console.log('loadRemoteAlbums - error', error);\n } finally {\n this.setState({ loadingRemoteFolders: false });\n }\n });\n };\n\n showUploadMenu() {\n this.setState({\n showUploadMenu: true,\n });\n }\n\n hideUploadMenu() {\n this.setState({\n showUploadMenu: false,\n });\n }\n\n retryUpload = async (mediaUri, uploadUri) => {\n try {\n const uri = isVideo(uploadUri) ? mediaUri : (await this.resizeImageAsync(mediaUri)).uri;\n const res = await fileActions.uploadUserMediaWithProgress(uri, uploadUri, progress => {\n if (this.props.onUploadProgress) this.props.onUploadProgress(progress);\n });\n this.props.onUploadSuccess(Config.env.baseUploadsUrl + res.key, uploadUri);\n console.log('upload(retry) success', Config.env.baseUploadsUrl + res.key);\n } catch (e) {\n console.log('retryUpload error', e);\n this.props.onUploadFailed(uploadUri);\n }\n };\n\n resizeImageAsync = async uri => {\n const actions = [\n {\n resize: getValueOrDefault(this.props.size, DEFAULT_SIZE),\n },\n ];\n const saveOptions = {\n format: DEFULAT_IMAGE_TYPE,\n compress: getValueOrDefault(this.props.quality, DEFAULT_COMPRESSION),\n base64: true,\n };\n return await ImageManipulator.manipulateAsync(uri, actions, saveOptions);\n };\n\n handleImagePicked = async imageUri => {\n let uploadUri;\n try {\n const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_IMAGE_NAME)}.${DEFULAT_IMAGE_TYPE}`;\n uploadUri = fileActions.getUploadUrl(this.props.userId, fileName);\n\n this.props.onUploadStarted(uploadUri, imageUri);\n this.hideUploadMenu();\n\n const resized = await this.resizeImageAsync(imageUri);\n if (this.props.onlySelectImage) {\n this.props.onImageSelected(resized, fileName);\n return;\n }\n\n const res = await fileActions.uploadUserMediaWithProgress(resized.uri, uploadUri, progress => {\n if (this.props.onUploadProgress) this.props.onUploadProgress(progress);\n });\n\n this.props.onUploadSuccess(Config.env.baseUploadsUrl + res.key, uploadUri);\n console.log('upload success', Config.env.baseUploadsUrl + res.key);\n } catch (e) {\n console.log('handleImagePicked error', e);\n this.props.onUploadFailed(uploadUri);\n }\n };\n\n handleMultiImagePicked = async imagesSelected => {\n // Signal start of all images selected\n const imagesUploaded = imagesSelected.map(image => {\n const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_IMAGE_NAME)}.${DEFULAT_IMAGE_TYPE}`;\n const uploadUri = fileActions.getUploadUrl(this.props.userId, fileName);\n if (!this.props.onlySelectImage) this.props.onUploadStarted(uploadUri, image.uri);\n return { imageUri: image.uri, uploadUri, fileName };\n });\n this.hideUploadMenu();\n\n // Sequentially upload all imagesUploaded\n for (let i = 0; i < imagesUploaded.length; i++) {\n const image = imagesUploaded[i];\n const { imageUri, uploadUri, fileName } = image;\n try {\n const resized = await this.resizeImageAsync(imageUri);\n if (this.props.onlySelectImage) {\n this.props.onImageSelected(resized, fileName);\n return;\n }\n\n const res = await fileActions.uploadUserMediaWithProgress(resized.uri, uploadUri, progress => {\n if (this.props.onUploadProgress) this.props.onUploadProgress(progress);\n });\n this.props.onUploadSuccess(Config.env.baseUploadsUrl + res.key, uploadUri);\n console.log('upload success', Config.env.baseUploadsUrl + res.key);\n } catch (e) {\n console.log('handleMultiImagePicked error', e);\n this.props.onUploadFailed(uploadUri);\n }\n }\n };\n\n handleVideoPicked = async uri => {\n let uploadUri;\n try {\n const fileType = uri.substring(uri.lastIndexOf('.') + 1);\n const fileName = `${getValueOrDefault(this.props.fileName, DEFAULT_VIDEO_NAME)}.${fileType}`;\n uploadUri = fileActions.getUploadUrl(this.props.userId, fileName);\n\n this.props.onUploadStarted(uploadUri, uri);\n this.hideUploadMenu();\n\n const res = await fileActions.uploadUserMediaWithProgress(uri, uploadUri, progress => {\n if (this.props.onUploadProgress) this.props.onUploadProgress(progress);\n });\n\n this.props.onUploadSuccess(Config.env.baseUploadsUrl + res.key, uploadUri);\n console.log('upload success', Config.env.baseUploadsUrl + res.key);\n } catch (e) {\n console.log('handleVideoPicked error', e);\n this.props.onUploadFailed(uploadUri);\n }\n };\n\n showWarningPopup(camera, roll) {\n if (Platform.OS !== 'ios') {\n return;\n }\n let innerWarning = '';\n if (camera && roll) {\n innerWarning = 'both your camera and photo library';\n } else if (camera) {\n innerWarning = 'your camera';\n } else if (roll) {\n innerWarning = 'your photo library';\n } else {\n // nothing to warn about\n return;\n }\n this.setState({\n warning: `You must grant access to ${innerWarning}. Tap Go to settings to change your permission settings.`,\n });\n }\n\n closeWarningPopup() {\n this.setState({\n warning: null,\n });\n }\n\n goToPermissionSettings() {\n Linking.openURL('app-settings:');\n this.setState({\n warning: null,\n });\n }\n\n askPermissionsAsync = async () => {\n const cameraPermission = await Camera.requestCameraPermissionsAsync();\n const rollPermission = await MediaLibrary.requestPermissionsAsync();\n if (cameraPermission.status !== 'granted' || rollPermission.status !== 'granted') {\n this.showWarningPopup(cameraPermission.status !== 'granted', rollPermission.status !== 'granted');\n return false;\n }\n if (this.state.localAlbums?.length <= 0) this.loadLocalAlbums();\n\n return true;\n };\n\n isEditingEnabled = () => {\n return !this.props.multiple && !this.props.allowVideo && getValueOrDefault(this.props.allowsEditing, DEFAULT_ALLOWS_EDITING);\n };\n\n // NOTE: No longer used (replaced by openPhotos)\n openCameraRoll = async () => {\n if (!(await this.askPermissionsAsync())) return;\n\n const result = await ImagePicker.launchImageLibraryAsync({\n mediaTypes: ImagePicker.MediaTypeOptions.Images,\n allowsEditing: this.isEditingEnabled(),\n aspect: getValueOrDefault(this.props.aspect, DEFAULT_ASPECT),\n exif: true,\n base64: true,\n });\n\n if (!result.cancelled) this.handleImagePicked(result.uri);\n };\n\n // NOTE: No longer used (replaced by openPhotos)\n openVideoRoll = async () => {\n if (!(await this.askPermissionsAsync())) return;\n\n const result = await ImagePicker.launchImageLibraryAsync({\n mediaTypes: ImagePicker.MediaTypeOptions.Videos,\n allowsEditing: this.isEditingEnabled(),\n });\n\n if (!result.cancelled) this.handleVideoPicked(result.uri);\n };\n\n openCamera = async () => {\n if (!(await this.askPermissionsAsync())) return;\n\n let editingAllowed = this.isEditingEnabled();\n if (Platform.OS === 'ios') {\n editingAllowed = getValueOrDefault(\n this.props.allowsEditingIOSCamera,\n getValueOrDefault(this.props.allowsEditing, DEFAULT_ALLOWS_IOS_CAMERA_EDITING),\n );\n }\n const result = await ImagePicker.launchCameraAsync({\n allowsEditing: editingAllowed,\n aspect: getValueOrDefault(this.props.aspect, DEFAULT_ASPECT),\n exif: getValueOrDefault(this.props.exif, DEFAULT_EXIF),\n });\n\n if (!result.cancelled) this.handleImagePicked(result.uri);\n };\n\n openVideoCamera = async () => {\n if (!(await this.askPermissionsAsync())) return;\n\n const result = await ImagePicker.launchCameraAsync({\n allowsEditing: this.isEditingEnabled(),\n mediaTypes: ImagePicker.MediaTypeOptions.Videos,\n });\n\n if (!result.cancelled) this.handleVideoPicked(result.uri);\n };\n\n openLibrary = async () => {\n this.setState({\n showUploadMenu: false,\n showPhotos: true,\n selected: [],\n showRemote: true,\n selectedAlbumId: '',\n });\n };\n\n openPhotos = async () => {\n if (!(await this.askPermissionsAsync())) return;\n\n this.setState({\n showUploadMenu: false,\n showPhotos: true,\n selected: [],\n showRemote: false,\n selectedAlbumId: '',\n });\n };\n\n hidePhotos = () => {\n this.setState({ showPhotos: false });\n };\n\n openCropper = () => {\n this.setState({ showPhotos: false, showCropper: true });\n };\n\n toggleCropper = () => {\n this.setState({ showCropper: !this.state.showCropper });\n };\n\n onSelectAlbum = () => {\n this.setState({ showSelectAlbum: true });\n };\n\n onSelectAlbumClosed = () => {\n this.setState({ showSelectAlbum: false });\n };\n\n onAlbumSelected = selectedAlbumId => {\n this.setState({ showSelectAlbum: false, selectedAlbumId });\n };\n\n onSelectionChange = (selected, videoSelected, onAttach) => {\n this.setState({\n selected,\n selectedType: videoSelected ? 'video' : 'image',\n onAttach,\n });\n };\n\n onSelected = async callback => {\n if (this.isEditingEnabled()) {\n this.openCropper();\n } else {\n const mediaSelected = await callback;\n // console.log('mediaSelected', mediaSelected);\n if (this.state.showRemote) {\n if (this.props.onLibrarySelected) {\n mediaSelected.map(media => {\n this.props.onLibrarySelected(media.uri);\n });\n }\n } else {\n if (mediaSelected[0].mediaType === MediaLibrary.MediaType.video) {\n this.handleVideoPicked(mediaSelected[0].localUri);\n } else {\n this.handleMultiImagePicked(mediaSelected);\n }\n }\n\n this.hidePhotos();\n }\n };\n\n onRemoveImage = uri => {\n const selected = [...this.state.selected];\n const deleteIndex = selected.indexOf(uri);\n selected.splice(deleteIndex, 1);\n this.setState({ selected });\n };\n\n buildOptions = () => {\n const options = [\n {\n text: 'Take photo',\n onPress: this.openCamera,\n },\n ];\n if (this.props.allowVideo)\n options.push({\n text: 'Record video',\n onPress: this.openVideoCamera,\n });\n options.push({\n text: 'Camera Roll',\n onPress: this.openPhotos,\n });\n if (!this.props.hideLibrary)\n options.push({\n text: 'Image Library',\n onPress: this.openLibrary,\n });\n\n return options;\n };\n\n renderSelectionPreview() {\n const { selected, showRemote } = this.state;\n\n return (\n <View>\n <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={styles.selectionPreviewContainer}>\n {selected &&\n selected.map(uri => {\n const imageUri = showRemote ? getThumb300(uri) : uri;\n return (\n <View key={uri} style={styles.previewItemContainer}>\n <ImageBackground style={styles.previewItemImage} source={{ uri: imageUri }} />\n <TouchableOpacity style={styles.previewItemRemoveButton} onPress={() => this.onRemoveImage(uri)}>\n <View style={[styles.previewItemRemoveContainer, { backgroundColor: this.props.colourBrandingMain }]}>\n <Icon name=\"times\" type=\"font-awesome\" iconStyle={styles.previewItemRemoveIcon} />\n </View>\n </TouchableOpacity>\n </View>\n );\n })}\n </ScrollView>\n </View>\n );\n }\n\n renderSelectedAlbum() {\n const { localAlbums, selectedAlbumId, showRemote } = this.state;\n const selectedAlbum = (showRemote ? this.props.imageLibrary : localAlbums).find(album => album.id === selectedAlbumId);\n const selectedAlbumText = selectedAlbum ? selectedAlbum.title : '';\n\n return (\n <TouchableOpacity onPress={this.onSelectAlbum}>\n <View style={styles.selectAlbumButton}>\n <Text style={styles.selectAlbumButtonText}>{selectedAlbumText}</Text>\n <Icon name=\"angle-down\" type=\"font-awesome\" iconStyle={styles.selectAlbumButtonIcon} />\n </View>\n </TouchableOpacity>\n );\n }\n\n renderSelectedComponent = selectedItemNumber => {\n return (\n <View style={styles.selectedItemContainer}>\n <View style={[styles.selectedMarkerContainer, { backgroundColor: this.props.colourBrandingMain }]}>\n {this.props.multiple ? (\n <Text style={styles.selectedItemText}>{selectedItemNumber}</Text>\n ) : (\n <Icon name=\"check\" type=\"font-awesome\" iconStyle={styles.selectedItemIcon} />\n )}\n </View>\n </View>\n );\n };\n\n renderBrowser() {\n const { selected, selectedAlbumId, showRemote } = this.state;\n const { imagesLimit, multiple, allowVideo, imageLibrary } = this.props;\n const width = (SCREEN_WIDTH - 10 * 2) / 4;\n\n return (\n <ImageBrowser\n max={!multiple ? 1 : imagesLimit}\n loadCount={30}\n onChange={this.onSelectionChange}\n renderSelectedComponent={this.renderSelectedComponent}\n callback={this.onSelected}\n selected={selected}\n allowVideo={allowVideo}\n style={styles.browserContainer}\n itemStyle={styles.itemContainer}\n itemWidth={width}\n itemHeight={width}\n album={selectedAlbumId}\n remoteAlbums={showRemote ? imageLibrary : null}\n />\n );\n }\n\n renderAttachButton() {\n const { selected, selectedType } = this.state;\n const canAttach = selected.length > 0 && !_.isEmpty(selectedType);\n const attachText = `Attach ${canAttach ? selected.length : ''} ${canAttach ? selectedType : ''}${selected.length > 1 ? 's' : ''}`;\n\n return (\n <View style={styles.buttonContainer}>\n <InlineButton\n color={canAttach ? this.props.colourBrandingMain : INACTIVE_BUTTON}\n onPress={this.state.onAttach}\n fillTouchable\n large\n disabled={!canAttach}\n >\n {attachText}\n </InlineButton>\n </View>\n );\n }\n\n renderSelectAlbumPopup() {\n const { showSelectAlbum, localAlbums, showRemote } = this.state;\n if (!showSelectAlbum) return null;\n\n return (\n <Modal visible transparent animationType=\"slide\" onRequestClose={this.onSelectAlbumClosed}>\n <View style={styles.selectAlbumModal}>\n <View style={styles.selectAlbumContainer}>\n <View style={styles.selectAlbumTitleContainer}>\n <Text style={styles.selectAlbumTitle}>Select Album</Text>\n </View>\n <ScrollView>\n {(showRemote ? this.props.imageLibrary : localAlbums).map((album, index) => {\n return (\n <TouchableOpacity key={album.id} onPress={() => this.onAlbumSelected(album.id)}>\n <View style={[styles.albumOptionContainer, index === 0 && { borderTopWidth: 0 }]}>\n <Text style={styles.albumOptionText}>{album.title}</Text>\n </View>\n </TouchableOpacity>\n );\n })}\n </ScrollView>\n <TouchableOpacity onPress={this.onSelectAlbumClosed}>\n <View style={[styles.albumOptionContainer, { marginHorizontal: 0 }]}>\n <Text style={[styles.albumOptionText, { color: this.props.colourBrandingMain }]}>Cancel</Text>\n </View>\n </TouchableOpacity>\n </View>\n </View>\n </Modal>\n );\n }\n\n renderPhotos() {\n return (\n <Modal visible transparent animationType=\"slide\" onRequestClose={this.hidePhotos}>\n <Header leftIcon=\"angle-left\" onPressLeft={this.hidePhotos} text={this.props.popupTitle || 'Attach image'} />\n <View style={styles.contentContainer}>\n {this.renderSelectionPreview()}\n {this.renderSelectedAlbum()}\n {this.renderBrowser()}\n </View>\n {this.renderAttachButton()}\n {this.renderSelectAlbumPopup()}\n </Modal>\n );\n }\n\n render() {\n const { warning, showUploadMenu, showPhotos, showCropper, selected } = this.state;\n\n if (warning != null) {\n return (\n <Popup\n title=\"Permissions missing\"\n text={warning}\n options={[\n {\n text: 'Go to settings',\n action: this.goToPermissionSettings.bind(this),\n bold: true,\n },\n {\n text: 'Ignore',\n action: this.closeWarningPopup.bind(this),\n },\n ]}\n />\n );\n }\n\n if (showUploadMenu) {\n const options = this.buildOptions();\n return <PopupMenu onClose={this.hideUploadMenu.bind(this)} options={options} title={this.props.popupTitle} cancelText=\"Cancel\" />;\n }\n\n if (showPhotos) return this.renderPhotos();\n\n if (showCropper) {\n return (\n <ExpoImageManipulator\n photo={{ uri: selected[0] }}\n onToggleModal={this.toggleCropper}\n isVisible={showCropper}\n onPictureChoosed={data => {\n this.handleImagePicked(data.uri);\n }}\n />\n );\n }\n\n return null;\n }\n}\n\nconst styles = StyleSheet.create({\n contentContainer: {\n flex: 1,\n backgroundColor: BOXGREY,\n },\n browserContainer: {\n padding: 10,\n },\n itemContainer: {\n padding: 4,\n },\n selectedItemContainer: {\n flex: 1,\n backgroundColor: '#0008',\n },\n selectedMarkerContainer: {\n position: 'absolute',\n top: 6,\n right: 6,\n width: 20,\n height: 20,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n },\n selectedItemText: {\n fontFamily: 'sf-semibold',\n fontSize: 12,\n color: '#fff',\n marginBottom: 1,\n },\n selectedItemIcon: {\n fontSize: 12,\n color: '#fff',\n marginBottom: 1,\n },\n buttonContainer: {\n alignItems: 'center',\n justifyContent: 'center',\n height: 60,\n paddingHorizontal: 14,\n backgroundColor: '#fff',\n },\n selectAlbumButton: {\n paddingTop: 13,\n paddingHorizontal: 14,\n flexDirection: 'row',\n alignItems: 'center',\n },\n selectAlbumButtonText: {\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: TEXT_BLUEGREY,\n marginRight: 6,\n },\n selectAlbumButtonIcon: {\n fontSize: 20,\n color: TEXT_BLUEGREY,\n },\n selectAlbumModal: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n zIndex: 1000,\n },\n selectAlbumContainer: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: '#fff',\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n maxHeight: SCREEN_HEIGHT / 2,\n },\n selectAlbumTitleContainer: {\n padding: 16,\n borderColor: LINEGREY,\n borderBottomWidth: 1,\n },\n selectAlbumTitle: {\n fontFamily: 'sf-semibold',\n fontSize: 16,\n textAlign: 'center',\n color: TEXT_DARK,\n },\n albumOptionContainer: {\n marginHorizontal: 16,\n paddingVertical: 16,\n borderColor: LINEGREY,\n borderTopWidth: 1,\n },\n albumOptionText: {\n fontFamily: 'sf-regular',\n fontSize: 16,\n textAlign: 'center',\n color: TEXT_DARK,\n },\n selectionPreviewContainer: {\n paddingTop: 14,\n paddingRight: 2,\n paddingLeft: 14,\n },\n previewItemContainer: {\n marginRight: 12,\n },\n previewItemImage: {\n width: 50,\n height: 50,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 4,\n overflow: 'hidden',\n },\n previewItemRemoveButton: {\n position: 'absolute',\n top: -8,\n right: -8,\n },\n previewItemRemoveContainer: {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 10,\n width: 20,\n height: 20,\n borderWidth: 2,\n borderColor: '#fff',\n },\n previewItemRemoveIcon: {\n fontSize: 10,\n color: '#fff',\n marginBottom: 1,\n },\n});\n\nconst mapStateToProps = state => {\n const { user, media } = state;\n const imageLibrary = media.imageLibrary\n .filter(folder => !folder.Public)\n .map(album => {\n return {\n title: album.Name,\n id: album.RowId || '',\n images: album.RowId ? album.Images : media.stockImages,\n };\n });\n\n return {\n user,\n imageLibrary,\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, { stockImagesLoaded, imageLibraryLoaded }, null, { forwardRef: true })(ImageUploader);\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
|
|
4
|
+
class InlineButton extends Component {
|
|
5
|
+
renderContent() {
|
|
6
|
+
if (this.props.noText) {
|
|
7
|
+
return this.props.children;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
style: [styles.text, (this.props.large || this.props.fullWidth) && styles.textLarge, this.props.textStyle],
|
|
12
|
+
numberOfLines: this.props.numberOfLines || 1
|
|
13
|
+
}, this.props.children);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
renderExtra() {
|
|
17
|
+
if (this.props.extraContent) {
|
|
18
|
+
return this.props.extraContent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
26
|
+
style: [(this.props.fillTouchable || this.props.fullWidth) && {
|
|
27
|
+
flexDirection: 'row'
|
|
28
|
+
}, this.props.fullWidth && {
|
|
29
|
+
flex: 1
|
|
30
|
+
}, this.props.disabled && this.props.disabledOpacity && {
|
|
31
|
+
opacity: 0.4
|
|
32
|
+
}, this.props.touchableStyle],
|
|
33
|
+
onPress: this.props.onPress,
|
|
34
|
+
disabled: this.props.disabled
|
|
35
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
style: [styles.container, (this.props.large || this.props.fullWidth) && styles.containerLarge, (this.props.fillTouchable || this.props.fullWidth) && {
|
|
37
|
+
flex: 1
|
|
38
|
+
}, this.props.border && {
|
|
39
|
+
borderColor: this.props.border,
|
|
40
|
+
borderWidth: 1
|
|
41
|
+
}, this.props.style, {
|
|
42
|
+
backgroundColor: this.props.color
|
|
43
|
+
}]
|
|
44
|
+
}, this.renderContent()), this.renderExtra());
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const styles = {
|
|
50
|
+
container: {
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
paddingHorizontal: 16,
|
|
54
|
+
height: 28,
|
|
55
|
+
borderRadius: 4,
|
|
56
|
+
alignSelf: 'flex-start'
|
|
57
|
+
},
|
|
58
|
+
containerLarge: {
|
|
59
|
+
height: 36
|
|
60
|
+
},
|
|
61
|
+
text: {
|
|
62
|
+
color: '#fff',
|
|
63
|
+
fontFamily: 'sf-semibold',
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
paddingBottom: 1
|
|
66
|
+
},
|
|
67
|
+
textLarge: {
|
|
68
|
+
fontSize: 15
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export { InlineButton };
|
|
72
|
+
//# sourceMappingURL=InlineButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["InlineButton.js"],"names":["React","Component","View","Text","TouchableOpacity","InlineButton","renderContent","props","noText","children","styles","text","large","fullWidth","textLarge","textStyle","numberOfLines","renderExtra","extraContent","render","fillTouchable","flexDirection","flex","disabled","disabledOpacity","opacity","touchableStyle","onPress","container","containerLarge","border","borderColor","borderWidth","style","backgroundColor","color","alignItems","justifyContent","paddingHorizontal","height","borderRadius","alignSelf","fontFamily","fontSize","paddingBottom"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,gBAArB,QAA6C,cAA7C;;AAEA,MAAMC,YAAN,SAA2BJ,SAA3B,CAAqC;AACnCK,EAAAA,aAAa,GAAG;AACd,QAAI,KAAKC,KAAL,CAAWC,MA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D,EAGL,CAAC,KAAKtB,KAAL,CAAWa,aAAX,IAA4B,KAAKb,KAAL,CAAWM,SAAxC,KAAsD;AAAES,QAAAA,IAAI,EAAE;AAAR,OAHjD,EAIL,KAAKf,KAAL,CAAWuB,MAAX,IAAqB;AAAEC,QAAAA,WAAW,EAAE,KAAKxB,KAAL,CAAWuB,MAA1B;AAAkCE,QAAAA,WAAW,EAAE;AAA/C,OAJhB,EAKL,KAAKzB,KAAL,CAAW0B,KALN,EAML;AAAEC,QAAAA,eAAe,EAAE,KAAK3B,KAAL,CAAW4B;AAA9B,OANK;AADT,OAUG,KAAK7B,aAAL,EAVH,CAVF,EAsBG,KAAKW,WAAL,EAtBH,CADF;AA0BD;;AAjDkC;;AAoDrC,MAAMP,MAAM,GAAG;AACbkB,EAAAA,SAAS,EAAE;AACTQ,IAAAA,UAAU,EAAE,QADH;AAETC,IAAAA,cAAc,EAAE,QAFP;AAGTC,IAAAA,iBAAiB,EAAE,EAHV;AAITC,IAAAA,MAAM,EAAE,EAJC;AAKTC,IAAAA,YAAY,EAAE,CALL;AAMTC,IAAAA,SAAS,EAAE;AANF,GADE;AASbZ,EAAAA,cAAc,EAAE;AACdU,IAAAA,MAAM,EAAE;AADM,GATH;AAYb5B,EAAAA,IAAI,EAAE;AACJwB,IAAAA,KAAK,EAAE,MADH;AAEJO,IAAAA,UAAU,EAAE,aAFR;AAGJC,IAAAA,QAAQ,EAAE,EAHN;AAIJC,IAAAA,aAAa,EAAE;AAJX,GAZO;AAkBb9B,EAAAA,SAAS,EAAE;AACT6B,IAAAA,QAAQ,EAAE;AADD;AAlBE,CAAf;AAuBA,SAAStC,YAAT","sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, TouchableOpacity } from 'react-native';\n\nclass InlineButton extends Component {\n renderContent() {\n if (this.props.noText) {\n return this.props.children;\n }\n return (\n <Text\n style={[styles.text, (this.props.large || this.props.fullWidth) && styles.textLarge, this.props.textStyle]}\n numberOfLines={this.props.numberOfLines || 1}\n >\n {this.props.children}\n </Text>\n );\n }\n\n renderExtra() {\n if (this.props.extraContent) {\n return this.props.extraContent;\n }\n return null;\n }\n\n render() {\n return (\n <TouchableOpacity\n style={[\n (this.props.fillTouchable || this.props.fullWidth) && { flexDirection: 'row' },\n this.props.fullWidth && { flex: 1 },\n this.props.disabled && this.props.disabledOpacity && { opacity: 0.4 },\n this.props.touchableStyle,\n ]}\n onPress={this.props.onPress}\n disabled={this.props.disabled}\n >\n <View\n style={[\n styles.container,\n (this.props.large || this.props.fullWidth) && styles.containerLarge,\n (this.props.fillTouchable || this.props.fullWidth) && { flex: 1 },\n this.props.border && { borderColor: this.props.border, borderWidth: 1 },\n this.props.style,\n { backgroundColor: this.props.color },\n ]}\n >\n {this.renderContent()}\n </View>\n {this.renderExtra()}\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = {\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: 16,\n height: 28,\n borderRadius: 4,\n alignSelf: 'flex-start',\n },\n containerLarge: {\n height: 36,\n },\n text: {\n color: '#fff',\n fontFamily: 'sf-semibold',\n fontSize: 14,\n paddingBottom: 1,\n },\n textLarge: {\n fontSize: 15,\n },\n};\n\nexport { InlineButton };\n"]}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { TextInput, View, Text, TouchableOpacity } from 'react-native';
|
|
5
|
+
import { connect } from 'react-redux';
|
|
6
|
+
import { COLOUR_TEAL, COLOUR_TANGERINE, TEXT_DARK, TEXT_LIGHT, TEXT_MID, getMainBrandingColourFromState, getDarkBrandingColourFromState } from '../colours';
|
|
7
|
+
/*
|
|
8
|
+
Class Breakdown ------
|
|
9
|
+
- label: Description tag above the text input
|
|
10
|
+
- value: Users input
|
|
11
|
+
- onChangeText: Sets parent state to users input -- example input: onChangeText={emailLogin => this.setState({ emailLogin })}
|
|
12
|
+
- placeholder: placeholder text when no user input
|
|
13
|
+
- secureTextEntry: used for password input -- hides on front end
|
|
14
|
+
- textColour: define color of user input
|
|
15
|
+
- keyboardType: changes device keyboard exmaples == 'email-address', 'phone-pad'
|
|
16
|
+
- underlineColorAndroid: Android inputs have an underline.. define color here-- defaults to grey
|
|
17
|
+
- editable: locks user input.. use with loading states
|
|
18
|
+
- hasError: renders space for error feedback below input
|
|
19
|
+
- errorText: displays desired text within above view
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
class Input extends Component {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
|
|
26
|
+
_defineProperty(this, "state", {
|
|
27
|
+
height: 'auto'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
renderInputChage() {
|
|
32
|
+
if (this.props.toggleInput != null) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
34
|
+
activeOpacity: 0.9,
|
|
35
|
+
onPress: this.props.toggleInput.bind(this)
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
37
|
+
style: [{
|
|
38
|
+
fontFamily: 'sf-regular',
|
|
39
|
+
color: COLOUR_TEAL,
|
|
40
|
+
textAlign: 'right',
|
|
41
|
+
backgroundColor: 'transparent',
|
|
42
|
+
textDecorationLine: 'underline'
|
|
43
|
+
}, this.props.toggleInputStyle]
|
|
44
|
+
}, this.props.toggleInputText)));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
renderLabel() {
|
|
51
|
+
if (this.props.label) {
|
|
52
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
53
|
+
style: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
justifyContent: 'space-between'
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
58
|
+
style: [styles.labelStyle, this.props.labelStyle, this.props.hasLabelError && this.props.labelError && {
|
|
59
|
+
color: this.props.colourBrandingMain
|
|
60
|
+
}]
|
|
61
|
+
}, this.props.label), this.props.hasLabelError && /*#__PURE__*/React.createElement(View, {
|
|
62
|
+
style: [{
|
|
63
|
+
height: 5,
|
|
64
|
+
width: 5,
|
|
65
|
+
borderRadius: 3,
|
|
66
|
+
backgroundColor: COLOUR_TEAL,
|
|
67
|
+
alignSelf: 'center'
|
|
68
|
+
}, this.props.labelError && {
|
|
69
|
+
backgroundColor: this.props.colourBrandingMain
|
|
70
|
+
}]
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
renderErrorField() {
|
|
78
|
+
if (this.props.hasError) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
80
|
+
style: [{
|
|
81
|
+
justifyContent: 'center'
|
|
82
|
+
}, this.props.errorStyle && this.props.errorText !== ' ' && this.props.errorStyle]
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
84
|
+
style: [styles.errorText]
|
|
85
|
+
}, this.props.errorText));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
render() {
|
|
92
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
93
|
+
style: [styles.containerStyle, this.props.containerStyle]
|
|
94
|
+
}, this.renderLabel(), /*#__PURE__*/React.createElement(TextInput, {
|
|
95
|
+
secureTextEntry: this.props.secureTextEntry,
|
|
96
|
+
placeholder: this.props.placeholder,
|
|
97
|
+
placeholderTextColor: this.props.placeholderTextColor,
|
|
98
|
+
autoCorrect: this.props.autoCorrect != null ? this.props.autoCorrect : false,
|
|
99
|
+
multiline: this.props.multiline != null ? this.props.multiline : false,
|
|
100
|
+
autoGrow: this.props.autoGrow != null ? this.props.autoGrow : false,
|
|
101
|
+
style: [styles.inputStyle, {
|
|
102
|
+
textAlignVertical: this.props.autoGrow != null ? 'top' : 'center',
|
|
103
|
+
color: this.props.textColour,
|
|
104
|
+
borderBottomColor: this.props.borderBottomColour != null ? this.props.value.length > 0 || this.props.errorText !== ' ' || this.props.forceBottomBorder ? this.props.borderBottomColour : TEXT_MID : 'rgba(0,0,0,0)',
|
|
105
|
+
borderBottomWidth: this.props.borderBottomColour != null ? 1 : 0,
|
|
106
|
+
height: this.props.autoGrow != null ? Math.max(30, this.state.height) : 'auto'
|
|
107
|
+
}, this.props.textStyle],
|
|
108
|
+
value: this.props.value,
|
|
109
|
+
onChangeText: this.props.onChangeText,
|
|
110
|
+
keyboardType: this.props.keyboardType,
|
|
111
|
+
selectionColor: this.props.colourBrandingDark,
|
|
112
|
+
underlineColorAndroid: this.props.underlineColorAndroid != null ? this.props.underlineColorAndroid : 'rgba(0,0,0,0)',
|
|
113
|
+
editable: this.props.editable != null ? this.props.editable : true,
|
|
114
|
+
autoCapitalize: this.props.autoCapitalize != null ? this.props.autoCapitalize : 'sentences',
|
|
115
|
+
autoFocus: this.props.autoFocus,
|
|
116
|
+
onContentSizeChange: event => {
|
|
117
|
+
this.setState({
|
|
118
|
+
height: event.nativeEvent.contentSize.height
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}), this.renderInputChage(), this.renderErrorField());
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const styles = {
|
|
127
|
+
labelStyle: {
|
|
128
|
+
fontSize: 15,
|
|
129
|
+
backgroundColor: 'transparent',
|
|
130
|
+
fontFamily: 'sf-semibold',
|
|
131
|
+
color: TEXT_DARK
|
|
132
|
+
},
|
|
133
|
+
inputStyle: {
|
|
134
|
+
flex: 1,
|
|
135
|
+
marginBottom: 2,
|
|
136
|
+
paddingTop: 0,
|
|
137
|
+
fontSize: 18,
|
|
138
|
+
color: TEXT_DARK,
|
|
139
|
+
fontFamily: 'sf-regular',
|
|
140
|
+
borderBottomColor: TEXT_LIGHT
|
|
141
|
+
},
|
|
142
|
+
containerStyle: {
|
|
143
|
+
width: '100%',
|
|
144
|
+
flexDirection: 'column'
|
|
145
|
+
},
|
|
146
|
+
errorText: {
|
|
147
|
+
backgroundColor: 'transparent',
|
|
148
|
+
color: COLOUR_TANGERINE,
|
|
149
|
+
fontSize: 13,
|
|
150
|
+
fontFamily: 'sf-semibold',
|
|
151
|
+
marginTop: 0
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const mapStateToProps = state => {
|
|
156
|
+
return {
|
|
157
|
+
colourBrandingMain: getMainBrandingColourFromState(state),
|
|
158
|
+
colourBrandingDark: getDarkBrandingColourFromState(state)
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const input = connect(mapStateToProps, {})(Input);
|
|
163
|
+
export { input as Input };
|
|
164
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Input.js"],"names":["React","Component","TextInput","View","Text","TouchableOpacity","connect","COLOUR_TEAL","COLOUR_TANGERINE","TEXT_DARK","TEXT_LIGHT","TEXT_MID","getMainBrandingColourFromState","getDarkBrandingColourFromState","Input","height","renderInputChage","props","toggleInput","bind","fontFamily","color","textAlign","backgroundColor","textDecorationLine","toggleInputStyle","toggleInputText","renderLabel","label","flexDirection","justifyContent","styles","labelStyle","hasLabelError","labelError","colourBrandingMain","width","borderRadius","alignSelf","renderErrorField","hasError","errorStyle","errorText","render","containerStyle","secureTextEntry","placeholder","placeholderTextColor","autoCorrect","multiline","autoGrow","inputStyle","textAlignVertical","textColour","borderBottomColor","borderBottomColour","value","length","forceBottomBorder","borderBottomWidth","Math","max","state","textStyle","onChangeText","keyboardType","colourBrandingDark","underlineColorAndroid","editable","autoCapitalize","autoFocus","event","setState","nativeEvent","contentSize","fontSize","flex","marginBottom","paddingTop","marginTop","map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VH,IAAAA,UAAU,EAAE,aAHF;AAIVC,IAAAA,KAAK,EAAEZ;AAJG,GADC;AAOb0C,EAAAA,UAAU,EAAE;AACVyB,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,YAAY,EAAE,CAFJ;AAGVC,IAAAA,UAAU,EAAE,CAHF;AAIVH,IAAAA,QAAQ,EAAE,EAJA;AAKVtD,IAAAA,KAAK,EAAEZ,SALG;AAMVW,IAAAA,UAAU,EAAE,YANF;AAOVkC,IAAAA,iBAAiB,EAAE5C;AAPT,GAPC;AAgBbkC,EAAAA,cAAc,EAAE;AACdR,IAAAA,KAAK,EAAE,MADO;AAEdP,IAAAA,aAAa,EAAE;AAFD,GAhBH;AAoBba,EAAAA,SAAS,EAAE;AACTnB,IAAAA,eAAe,EAAE,aADR;AAETF,IAAAA,KAAK,EAAEb,gBAFE;AAGTmE,IAAAA,QAAQ,EAAE,EAHD;AAITvD,IAAAA,UAAU,EAAE,aAJH;AAKT2D,IAAAA,SAAS,EAAE;AALF;AApBE,CAAf;;AA6BA,MAAMC,eAAe,GAAGlB,KAAK,IAAI;AAC/B,SAAO;AACL3B,IAAAA,kBAAkB,EAAEvB,8BAA8B,CAACkD,KAAD,CAD7C;AAELI,IAAAA,kBAAkB,EAAErD,8BAA8B,CAACiD,KAAD;AAF7C,GAAP;AAID,CALD;;AAOA,MAAMmB,KAAK,GAAG3E,OAAO,CAAC0E,eAAD,EAAkB,EAAlB,CAAP,CAA6BlE,KAA7B,CAAd;AACA,SAASmE,KAAK,IAAInE,KAAlB","sourcesContent":["import React, { Component } from 'react';\nimport { TextInput, View, Text, TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport {\n COLOUR_TEAL,\n COLOUR_TANGERINE,\n TEXT_DARK,\n TEXT_LIGHT,\n TEXT_MID,\n getMainBrandingColourFromState,\n getDarkBrandingColourFromState,\n} from '../colours';\n\n/*\nClass Breakdown ------ \n - label: Description tag above the text input\n - value: Users input\n - onChangeText: Sets parent state to users input -- example input: onChangeText={emailLogin => this.setState({ emailLogin })}\n - placeholder: placeholder text when no user input\n - secureTextEntry: used for password input -- hides on front end\n - textColour: define color of user input\n - keyboardType: changes device keyboard exmaples == 'email-address', 'phone-pad' \n - underlineColorAndroid: Android inputs have an underline.. define color here-- defaults to grey\n - editable: locks user input.. use with loading states\n - hasError: renders space for error feedback below input\n - errorText: displays desired text within above view\n*/\n\nclass Input extends Component {\n state = {\n height: 'auto',\n };\n\n renderInputChage() {\n if (this.props.toggleInput != null) {\n return (\n <View>\n <TouchableOpacity activeOpacity={0.9} onPress={this.props.toggleInput.bind(this)}>\n <Text\n style={[\n {\n fontFamily: 'sf-regular',\n color: COLOUR_TEAL,\n textAlign: 'right',\n backgroundColor: 'transparent',\n textDecorationLine: 'underline',\n },\n this.props.toggleInputStyle,\n ]}\n >\n {this.props.toggleInputText}\n </Text>\n </TouchableOpacity>\n </View>\n );\n }\n return null;\n }\n\n renderLabel() {\n if (this.props.label) {\n return (\n <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text\n style={[\n styles.labelStyle,\n this.props.labelStyle,\n this.props.hasLabelError && this.props.labelError && { color: this.props.colourBrandingMain },\n ]}\n >\n {this.props.label}\n </Text>\n {this.props.hasLabelError && (\n <View\n style={[\n {\n height: 5,\n width: 5,\n borderRadius: 3,\n backgroundColor: COLOUR_TEAL,\n alignSelf: 'center',\n },\n this.props.labelError && { backgroundColor: this.props.colourBrandingMain },\n ]}\n />\n )}\n </View>\n );\n }\n return null;\n }\n\n renderErrorField() {\n if (this.props.hasError) {\n return (\n <View style={[{ justifyContent: 'center' }, this.props.errorStyle && this.props.errorText !== ' ' && this.props.errorStyle]}>\n <Text style={[styles.errorText]}>{this.props.errorText}</Text>\n </View>\n );\n }\n return null;\n }\n\n render() {\n return (\n <View style={[styles.containerStyle, this.props.containerStyle]}>\n {this.renderLabel()}\n <TextInput\n secureTextEntry={this.props.secureTextEntry}\n placeholder={this.props.placeholder}\n placeholderTextColor={this.props.placeholderTextColor}\n autoCorrect={this.props.autoCorrect != null ? this.props.autoCorrect : false}\n multiline={this.props.multiline != null ? this.props.multiline : false}\n autoGrow={this.props.autoGrow != null ? this.props.autoGrow : false}\n style={[\n styles.inputStyle,\n {\n textAlignVertical: this.props.autoGrow != null ? 'top' : 'center',\n color: this.props.textColour,\n borderBottomColor:\n this.props.borderBottomColour != null\n ? this.props.value.length > 0 || this.props.errorText !== ' ' || this.props.forceBottomBorder\n ? this.props.borderBottomColour\n : TEXT_MID\n : 'rgba(0,0,0,0)',\n borderBottomWidth: this.props.borderBottomColour != null ? 1 : 0,\n height: this.props.autoGrow != null ? Math.max(30, this.state.height) : 'auto',\n },\n this.props.textStyle,\n ]}\n value={this.props.value}\n onChangeText={this.props.onChangeText}\n keyboardType={this.props.keyboardType}\n selectionColor={this.props.colourBrandingDark}\n underlineColorAndroid={this.props.underlineColorAndroid != null ? this.props.underlineColorAndroid : 'rgba(0,0,0,0)'}\n editable={this.props.editable != null ? this.props.editable : true}\n autoCapitalize={this.props.autoCapitalize != null ? this.props.autoCapitalize : 'sentences'}\n autoFocus={this.props.autoFocus}\n onContentSizeChange={event => {\n this.setState({ height: event.nativeEvent.contentSize.height });\n }}\n />\n {this.renderInputChage()}\n {this.renderErrorField()}\n </View>\n );\n }\n}\n\nconst styles = {\n labelStyle: {\n fontSize: 15,\n backgroundColor: 'transparent',\n fontFamily: 'sf-semibold',\n color: TEXT_DARK,\n },\n inputStyle: {\n flex: 1,\n marginBottom: 2,\n paddingTop: 0,\n fontSize: 18,\n color: TEXT_DARK,\n fontFamily: 'sf-regular',\n borderBottomColor: TEXT_LIGHT,\n },\n containerStyle: {\n width: '100%',\n flexDirection: 'column',\n },\n errorText: {\n backgroundColor: 'transparent',\n color: COLOUR_TANGERINE,\n fontSize: 13,\n fontFamily: 'sf-semibold',\n marginTop: 0,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n colourBrandingDark: getDarkBrandingColourFromState(state),\n };\n};\n\nconst input = connect(mapStateToProps, {})(Input);\nexport { input as Input };\n"]}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { View, Animated } from 'react-native';
|
|
5
|
+
import { connect } from 'react-redux';
|
|
6
|
+
import { getMainBrandingColourFromState } from '../colours';
|
|
7
|
+
/* const arr = []
|
|
8
|
+
for (var i = 0; i < 3; i++) {
|
|
9
|
+
arr.push(i);
|
|
10
|
+
} */
|
|
11
|
+
|
|
12
|
+
class LoadingCircles extends Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "state", {
|
|
17
|
+
animatedSize: new Animated.Value(1),
|
|
18
|
+
animatedOpacity: new Animated.Value(0),
|
|
19
|
+
animatedSize2: new Animated.Value(1),
|
|
20
|
+
animatedOpacity2: new Animated.Value(0),
|
|
21
|
+
animatedSize3: new Animated.Value(1),
|
|
22
|
+
animatedOpacity3: new Animated.Value(0),
|
|
23
|
+
animatedSize4: new Animated.Value(1),
|
|
24
|
+
animatedOpacity4: new Animated.Value(0),
|
|
25
|
+
animatedSize5: new Animated.Value(1),
|
|
26
|
+
animatedOpacity5: new Animated.Value(0)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* constructor() {
|
|
31
|
+
super()
|
|
32
|
+
this.state.animatedSizes = [];
|
|
33
|
+
this.state.animatedOpacity = [];
|
|
34
|
+
arr.forEach((value) => {
|
|
35
|
+
this.state.animatedSizes[value] = new Animated.Value(1);
|
|
36
|
+
this.state.animatedOpacity[value] = new Animated.Value(0);
|
|
37
|
+
})
|
|
38
|
+
} */
|
|
39
|
+
componentDidMount() {
|
|
40
|
+
this.animate();
|
|
41
|
+
/* setTimeout(() => {
|
|
42
|
+
this.animate2();
|
|
43
|
+
}, 150);
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
this.animate3();
|
|
46
|
+
}, 300); */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
animate() {
|
|
50
|
+
Animated.sequence([Animated.parallel([Animated.timing(this.state.animatedSize, {
|
|
51
|
+
toValue: 20,
|
|
52
|
+
duration: 900,
|
|
53
|
+
useNativeDriver: false
|
|
54
|
+
}), Animated.timing(this.state.animatedOpacity, {
|
|
55
|
+
toValue: 1,
|
|
56
|
+
duration: 900,
|
|
57
|
+
useNativeDriver: false
|
|
58
|
+
}), Animated.timing(this.state.animatedSize2, {
|
|
59
|
+
toValue: 20,
|
|
60
|
+
duration: 900,
|
|
61
|
+
delay: 150,
|
|
62
|
+
useNativeDriver: false
|
|
63
|
+
}), Animated.timing(this.state.animatedOpacity2, {
|
|
64
|
+
toValue: 1,
|
|
65
|
+
duration: 900,
|
|
66
|
+
delay: 150,
|
|
67
|
+
useNativeDriver: false
|
|
68
|
+
}), Animated.timing(this.state.animatedSize3, {
|
|
69
|
+
toValue: 20,
|
|
70
|
+
duration: 900,
|
|
71
|
+
delay: 300,
|
|
72
|
+
useNativeDriver: false
|
|
73
|
+
}), Animated.timing(this.state.animatedOpacity3, {
|
|
74
|
+
toValue: 1,
|
|
75
|
+
duration: 900,
|
|
76
|
+
delay: 400,
|
|
77
|
+
useNativeDriver: false
|
|
78
|
+
}), Animated.timing(this.state.animatedSize4, {
|
|
79
|
+
toValue: 20,
|
|
80
|
+
duration: 900,
|
|
81
|
+
delay: 450,
|
|
82
|
+
useNativeDriver: false
|
|
83
|
+
}), Animated.timing(this.state.animatedOpacity4, {
|
|
84
|
+
toValue: 1,
|
|
85
|
+
duration: 900,
|
|
86
|
+
delay: 450,
|
|
87
|
+
useNativeDriver: false
|
|
88
|
+
}), Animated.timing(this.state.animatedSize5, {
|
|
89
|
+
toValue: 20,
|
|
90
|
+
duration: 900,
|
|
91
|
+
delay: 600,
|
|
92
|
+
useNativeDriver: false
|
|
93
|
+
}), Animated.timing(this.state.animatedOpacity5, {
|
|
94
|
+
toValue: 1,
|
|
95
|
+
duration: 900,
|
|
96
|
+
delay: 600,
|
|
97
|
+
useNativeDriver: false
|
|
98
|
+
})]), Animated.parallel([Animated.timing(this.state.animatedOpacity, {
|
|
99
|
+
toValue: 0,
|
|
100
|
+
duration: 500,
|
|
101
|
+
useNativeDriver: false
|
|
102
|
+
}), Animated.timing(this.state.animatedOpacity2, {
|
|
103
|
+
toValue: 0,
|
|
104
|
+
duration: 500,
|
|
105
|
+
useNativeDriver: false
|
|
106
|
+
}), Animated.timing(this.state.animatedOpacity3, {
|
|
107
|
+
toValue: 0,
|
|
108
|
+
duration: 500,
|
|
109
|
+
useNativeDriver: false
|
|
110
|
+
}), Animated.timing(this.state.animatedOpacity4, {
|
|
111
|
+
toValue: 0,
|
|
112
|
+
duration: 500,
|
|
113
|
+
useNativeDriver: false
|
|
114
|
+
}), Animated.timing(this.state.animatedOpacity5, {
|
|
115
|
+
toValue: 0,
|
|
116
|
+
duration: 500,
|
|
117
|
+
useNativeDriver: false
|
|
118
|
+
})]), Animated.parallel([Animated.timing(this.state.animatedSize, {
|
|
119
|
+
toValue: 1,
|
|
120
|
+
duration: 1,
|
|
121
|
+
useNativeDriver: false
|
|
122
|
+
}), Animated.timing(this.state.animatedSize2, {
|
|
123
|
+
toValue: 1,
|
|
124
|
+
duration: 1,
|
|
125
|
+
useNativeDriver: false
|
|
126
|
+
}), Animated.timing(this.state.animatedSize3, {
|
|
127
|
+
toValue: 1,
|
|
128
|
+
duration: 1,
|
|
129
|
+
useNativeDriver: false
|
|
130
|
+
}), Animated.timing(this.state.animatedSize4, {
|
|
131
|
+
toValue: 1,
|
|
132
|
+
duration: 1,
|
|
133
|
+
useNativeDriver: false
|
|
134
|
+
}), Animated.timing(this.state.animatedSize5, {
|
|
135
|
+
toValue: 1,
|
|
136
|
+
duration: 1,
|
|
137
|
+
useNativeDriver: false
|
|
138
|
+
})])]).start(() => {
|
|
139
|
+
this.animate();
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
render() {
|
|
144
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
145
|
+
style: styles.container
|
|
146
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
147
|
+
style: [styles.container, styles.absolute]
|
|
148
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
149
|
+
style: [styles.circle, {
|
|
150
|
+
borderColor: this.props.color || this.props.colourBrandingMain,
|
|
151
|
+
width: this.state.animatedSize,
|
|
152
|
+
height: this.state.animatedSize,
|
|
153
|
+
opacity: this.state.animatedOpacity
|
|
154
|
+
}]
|
|
155
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
156
|
+
style: [styles.container, styles.absolute]
|
|
157
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
158
|
+
style: [styles.circle, {
|
|
159
|
+
borderColor: this.props.color || this.props.colourBrandingMain,
|
|
160
|
+
width: this.state.animatedSize2,
|
|
161
|
+
height: this.state.animatedSize2,
|
|
162
|
+
opacity: this.state.animatedOpacity2
|
|
163
|
+
}]
|
|
164
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
165
|
+
style: [styles.container, styles.absolute]
|
|
166
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
167
|
+
style: [styles.circle, {
|
|
168
|
+
borderColor: this.props.color || this.props.colourBrandingMain,
|
|
169
|
+
width: this.state.animatedSize3,
|
|
170
|
+
height: this.state.animatedSize3,
|
|
171
|
+
opacity: this.state.animatedOpacity3
|
|
172
|
+
}]
|
|
173
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
174
|
+
style: [styles.container, styles.absolute]
|
|
175
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
176
|
+
style: [styles.circle, {
|
|
177
|
+
borderColor: this.props.color || this.props.colourBrandingMain,
|
|
178
|
+
width: this.state.animatedSize4,
|
|
179
|
+
height: this.state.animatedSize4,
|
|
180
|
+
opacity: this.state.animatedOpacity4
|
|
181
|
+
}]
|
|
182
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
183
|
+
style: [styles.container, styles.absolute]
|
|
184
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
185
|
+
style: [styles.circle, {
|
|
186
|
+
borderColor: this.props.color || this.props.colourBrandingMain,
|
|
187
|
+
width: this.state.animatedSize5,
|
|
188
|
+
height: this.state.animatedSize5,
|
|
189
|
+
opacity: this.state.animatedOpacity5
|
|
190
|
+
}]
|
|
191
|
+
})));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const styles = {
|
|
197
|
+
container: {
|
|
198
|
+
width: 30,
|
|
199
|
+
height: 30,
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
justifyContent: 'center'
|
|
202
|
+
},
|
|
203
|
+
circle: {
|
|
204
|
+
borderRadius: 15,
|
|
205
|
+
borderWidth: 1
|
|
206
|
+
},
|
|
207
|
+
absolute: {
|
|
208
|
+
position: 'absolute',
|
|
209
|
+
top: 0,
|
|
210
|
+
left: 0,
|
|
211
|
+
right: 0,
|
|
212
|
+
bottom: 0
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const mapStateToProps = state => {
|
|
217
|
+
return {
|
|
218
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
const loadingCircles = connect(mapStateToProps, {})(LoadingCircles);
|
|
223
|
+
export { loadingCircles as LoadingCircles };
|
|
224
|
+
//# sourceMappingURL=LoadingCircles.js.map
|