@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":["MediaPlayer.js"],"names":["React","Component","Platform","View","StyleSheet","Dimensions","ScreenOrientation","DeviceMotion","YoutubePlayer","getYoutubeMeta","Vimeo","WebView","Video","VideoPlayer","Spinner","SCREEN_HEIGHT","get","height","SCREEN_WIDTH","width","EXPO_VIDEO_PROPS","rate","isMuted","volume","RETRY_RECOVER","RETRY_LOADING","MediaPlayer","constructor","props","setupForPlaying","lockAsync","OS","OrientationLock","DEFAULT","ALL","motionAvailalble","isAvailableAsync","setUpdateInterval","addListener","onMotionChange","checkStreamLoaded","clearInterval","removeAllListeners","PORTRAIT_UP","url","replace","split","undefined","ids","result","match","source","useVideoPlayer","isUrlLink","startsWith","isYoutube","includes","isVimeo","heightFactor","metadata","getYoutubeVideoId","setState","playbackLoaded","readyToRender","playbackId","wait","force","retryLoading","console","log","setTimeout","playbackBuffering","state","videoPlayer","loadAsync","uri","getStreamPlaybackUrl","overrideFileExtensionAndroid","deviceRotation","beta","gamma","absGamma","Math","abs","absBeta","isGammaNegative","sign","changeEvent","rotation","deviceOrientation","orientation","isLandscape","orientationQueue","push","length","slice","every","i","orientationChanged","setInterval","checkReloadStream","status","isLoaded","isBuffering","isPlaying","error","playbackPlaying","shouldPlay","e","forceWebview","youtubeId","autoPlay","ref","youtubePlayer","onYoutubeReady","onYoutubeError","cc_lang_pref","showClosedCaptions","vimeoId","marginLeft","marginRight","embedUrl","styles","webView","vp","RESIZE_MODE_CONTAIN","onStreamLoadStart","onStreamLoaded","onStreamError","onStreamStatusUpdate","resizeMode","onVideoPlayError","onVideoPlayStatusUpdate","render","player","showLoading","getYoutubePlayer","getVimeoId","getVimeoPlayer","getStreamPlayer","getVideoPlayer","getWebviewPlayer","container","loadingContainer","create","backgroundColor","alignItems","justifyContent","flex","position","top","left","right","bottom"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,QAAT,EAAmBC,IAAnB,EAAyBC,UAAzB,EAAqCC,UAArC,QAAuD,cAAvD;AACA,OAAO,KAAKC,iBAAZ,MAAmC,yBAAnC;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,OAAOC,aAAP,IAAwBC,cAAxB,QAA8C,6BAA9C;AACA,SAASC,KAAT,QAAsB,2BAAtB;AACA,OAAOC,OAAP,MAAoB,sBAApB;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,OAAOC,WAAP,MAAwB,mBAAxB;AACA,SAASC,OAAT,QAAwB,WAAxB;AAEA,MAAMC,aAAa,GAAGV,UAAU,CAACW,GAAX,CAAe,QAAf,EAAyBC,MAA/C;AACA,MAAMC,YAAY,GAAGb,UAAU,CAACW,GAAX,CAAe,QAAf,EAAyBG,KAA9C;AACA,MAAMC,gBAAgB,GAAG;AAAEC,EAAAA,IAAI,EAAE,CAAR;AAAWC,E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, StyleSheet, Dimensions } from 'react-native';\nimport * as ScreenOrientation from 'expo-screen-orientation';\nimport { DeviceMotion } from 'expo-sensors';\nimport YoutubePlayer, { getYoutubeMeta } from 'react-native-youtube-iframe';\nimport { Vimeo } from 'react-native-vimeo-iframe';\nimport WebView from 'react-native-webview';\nimport { Video } from 'expo-av';\nimport VideoPlayer from 'expo-video-player';\nimport { Spinner } from './Spinner';\n\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\nconst SCREEN_WIDTH = Dimensions.get('window').width;\nconst EXPO_VIDEO_PROPS = { rate: 1, isMuted: false, volume: 1 };\nconst RETRY_RECOVER = 30000;\nconst RETRY_LOADING = 10000;\n\nclass MediaPlayer extends Component {\n constructor(props) {\n super(props);\n this.state = {\n deviceOrientation: null,\n isLandscape: false,\n isUrlLink: true,\n isYoutube: false,\n isVimeo: false,\n forceWebview: false,\n heightFactor: 0,\n playbackLoaded: false,\n playbackBuffering: false,\n playbackPlaying: false,\n readyToRender: false,\n };\n this.youtubePlayer = null;\n this.videoPlayer = null;\n this.checkStreamLoaded = null;\n this.retryLoading = false;\n this.orientationQueue = [];\n }\n\n componentDidMount = async () => {\n await this.setupForPlaying();\n\n ScreenOrientation.lockAsync(Platform.OS === 'ios' ? ScreenOrientation.OrientationLock.DEFAULT : ScreenOrientation.OrientationLock.ALL);\n const motionAvailalble = await DeviceMotion.isAvailableAsync();\n // console.log('motionAvailalble', motionAvailalble);\n if (motionAvailalble) {\n DeviceMotion.setUpdateInterval(500);\n DeviceMotion.addListener(this.onMotionChange);\n }\n };\n\n componentWillUnmount = () => {\n if (this.checkStreamLoaded) clearInterval(this.checkStreamLoaded);\n DeviceMotion.removeAllListeners();\n ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);\n };\n\n getYoutubeVideoId = url => {\n url = url.replace(/(>|<)/gi, '').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if (url[2] !== undefined) {\n const ids = url[2].split(/[^0-9a-z_\\-]/i);\n return ids[0];\n } else {\n return '';\n }\n };\n\n getVimeoId = url => {\n const result = url.match(\n /(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/(?:[^\\/]*)\\/videos\\/|album\\/(?:\\d+)\\/video\\/|video\\/|)(\\d+)(?:[a-zA-Z0-9_\\-]+)?/i,\n );\n return result[1];\n };\n\n setupForPlaying = async () => {\n // Extract live stream info\n const { source, useVideoPlayer } = this.props;\n const isUrlLink = source && source.startsWith('http');\n const isYoutube = source && (source.includes('youtube.com/watch?v=') || source.includes('youtu.be/'));\n const isVimeo = source && source.includes('vimeo.com/');\n let heightFactor = 0;\n\n if (isYoutube) {\n const metadata = await getYoutubeMeta(this.getYoutubeVideoId(source));\n heightFactor = metadata.height / metadata.width;\n } else if (useVideoPlayer) {\n heightFactor = 0;\n } else {\n heightFactor = 0.565;\n }\n\n this.setState({ isUrlLink, isYoutube, isVimeo, playbackLoaded: isYoutube || isVimeo, heightFactor, readyToRender: true });\n };\n\n getStreamPlaybackUrl = () => {\n // return 'https://stream.mux.com/Ym4nKktRpGuZNBBBlzhxpyRwZLpvMlPRchcu01x6Ur600.m3u8';\n return `https://stream.mux.com/${this.props.playbackId}.m3u8`;\n };\n\n checkReloadStream = (wait = RETRY_LOADING, force = false) => {\n if (!force && this.retryLoading) return;\n\n console.log(`Check loading in ${wait} milliseconds...`);\n this.retryLoading = true;\n setTimeout(async () => {\n const { playbackLoaded, playbackBuffering } = this.state;\n try {\n if (playbackLoaded === false || playbackBuffering === true) {\n console.log('Reloading started');\n await this.videoPlayer.loadAsync(\n { uri: this.getStreamPlaybackUrl(), overrideFileExtensionAndroid: 'm3u8' },\n EXPO_VIDEO_PROPS,\n false,\n );\n } else {\n console.log('Already loaded - not reloading');\n }\n this.retryLoading = false;\n } catch {}\n }, wait);\n };\n\n isLandscape = deviceRotation => {\n const { beta, gamma } = deviceRotation;\n const absGamma = Math.abs(gamma);\n const absBeta = Math.abs(beta);\n const isGammaNegative = Math.sign(gamma) === -1;\n\n if (absGamma <= 0.04 && absBeta <= 0.24) {\n //Portrait mode, on a flat surface.\n return false;\n } else if ((absGamma <= 1.0 || absGamma >= 2.3) && absBeta >= 0.5) {\n //General Portrait mode, accounting for forward and back tilt on the top of the phone.\n return false;\n } else {\n if (isGammaNegative) {\n //Landscape mode with the top of the phone to the left.\n return true;\n } else {\n //Landscape mode with the top of the phone to the right.\n return true;\n }\n }\n };\n\n onMotionChange = async changeEvent => {\n const deviceRotation = changeEvent.rotation;\n const deviceOrientation = changeEvent.orientation;\n const isLandscape = this.isLandscape(deviceRotation);\n this.orientationQueue.push(isLandscape);\n if (this.orientationQueue.length > 2) this.orientationQueue = this.orientationQueue.slice(-2);\n // console.log('onMotionChange - orientationQueue', this.orientationQueue);\n if (\n isLandscape !== this.state.isLandscape &&\n isLandscape === (Math.abs(deviceOrientation) === 90) &&\n this.orientationQueue.every(i => i === isLandscape)\n ) {\n this.setState({ isLandscape }, () => {\n // console.log('isLandscape', this.state.isLandscape);\n if (this.props.orientationChanged) this.props.orientationChanged(this.state.isLandscape);\n });\n }\n };\n\n onStreamLoadStart = () => {\n console.log('Stream load started');\n this.checkStreamLoaded = setInterval(() => {\n const { playbackLoaded } = this.state;\n if (playbackLoaded === false) {\n console.log('Stream loading failed unexpectedly');\n this.checkReloadStream(1000, true);\n } else {\n clearInterval(this.checkStreamLoaded);\n }\n }, RETRY_RECOVER);\n };\n\n onStreamLoaded = status => {\n console.log(`Stream loaded - isLoaded:${status.isLoaded}, isBuffering:${status.isBuffering}, isPlaying:${status.isPlaying}`);\n };\n\n onStreamError = error => {\n console.log('Stream error', error);\n };\n\n onStreamStatusUpdate = status => {\n this.setState(\n {\n playbackLoaded: status.isLoaded,\n playbackBuffering: status.isBuffering,\n playbackPlaying: status.isPlaying,\n },\n () => {\n const { playbackLoaded, playbackBuffering, playbackPlaying, shouldPlay } = this.state;\n // console.log(`Status updated - isLoaded:${playbackLoaded}, isBuffering:${playbackBuffering}, isPlaying:${playbackPlaying}`);\n if (playbackLoaded === false && playbackBuffering === undefined && playbackPlaying === undefined) {\n this.checkReloadStream();\n } else if (playbackLoaded === true && playbackBuffering === true) {\n this.checkReloadStream(RETRY_RECOVER);\n }\n },\n );\n };\n\n onYoutubeError = e => {\n // console.log('onYoutubeError', e);\n this.setState({ forceWebview: true });\n };\n\n onYoutubeReady = () => {\n // console.log('onYoutubeReady');\n };\n\n onVideoPlayStatusUpdate = status => {\n // console.log('onVideoPlayStatusUpdate', status);\n };\n\n onVideoPlayError = error => {\n // console.log('onVideoPlayError', error);\n this.setState({ forceWebview: true });\n };\n\n getYoutubePlayer = (youtubeId, width, height, autoPlay) => (\n <YoutubePlayer\n ref={ref => (this.youtubePlayer = ref)}\n height={height}\n width={width}\n videoId={youtubeId}\n play={autoPlay}\n // onChangeState={event => console.log('onChangeState', event)}\n onReady={this.onYoutubeReady}\n onError={this.onYoutubeError}\n // onPlaybackQualityChange={q => console.log('onPlaybackQualityChange', q)}\n volume={50}\n playbackRate={1}\n playerParams={{\n cc_lang_pref: 'us',\n showClosedCaptions: true,\n }}\n />\n );\n\n getVimeoPlayer = (vimeoId, width, height, autoPlay) => (\n <View style={{ width, height }}>\n <Vimeo\n style={{ marginLeft: -8, marginRight: -5 }}\n videoId={vimeoId}\n // onReady={() => console.log('Video is ready')}\n // onPlay={() => console.log('Video is playing')}\n // onPlayProgress={data => console.log('Video progress data:', data)}\n // onFinish={() => console.log('Video is finished')}\n loop={false}\n autoPlay={autoPlay}\n controls={true}\n speed={true}\n time={'0m0s'}\n />\n </View>\n );\n\n getWebviewPlayer = embedUrl => (\n <WebView\n startInLoadingState\n javaScriptEnabled\n scrollEnabled={false}\n automaticallyAdjustContentInsets={false}\n mediaPlaybackRequiresUserAction\n style={styles.webView}\n source={{ uri: embedUrl }}\n />\n );\n\n getStreamPlayer = (embedUrl, width, height, autoPlay) => (\n <Video\n ref={vp => {\n this.videoPlayer = vp;\n }}\n source={{ uri: embedUrl }}\n {...EXPO_VIDEO_PROPS}\n shouldPlay={autoPlay}\n resizeMode={Video.RESIZE_MODE_CONTAIN}\n useNativeControls\n style={{ width, height }}\n onLoadStart={this.onStreamLoadStart}\n onLoad={this.onStreamLoaded}\n onError={this.onStreamError}\n onPlaybackStatusUpdate={this.onStreamStatusUpdate}\n />\n );\n\n getVideoPlayer = (embedUrl, width, height, autoPlay) => (\n <VideoPlayer\n videoProps={{\n shouldPlay: autoPlay,\n resizeMode: Video.RESIZE_MODE_CONTAIN,\n source: { uri: embedUrl },\n }}\n showFullscreenButton={false}\n errorCallback={this.onVideoPlayError}\n playbackCallback={this.onVideoPlayStatusUpdate}\n height={height}\n width={width}\n />\n );\n\n render() {\n let width, height;\n const { playbackId, source, autoPlay, useVideoPlayer } = this.props;\n const {\n readyToRender,\n isLandscape,\n heightFactor,\n isUrlLink,\n isYoutube,\n isVimeo,\n forceWebview,\n playbackLoaded,\n playbackBuffering,\n } = this.state;\n if (!readyToRender) return null;\n\n if (isLandscape) {\n width = SCREEN_HEIGHT;\n height = SCREEN_WIDTH;\n } else {\n width = SCREEN_WIDTH;\n height = heightFactor ? SCREEN_WIDTH * heightFactor : SCREEN_HEIGHT;\n }\n\n let embedUrl, player, showLoading;\n if (!forceWebview) {\n if (isYoutube) {\n const youtubeId = this.getYoutubeVideoId(source);\n embedUrl = youtubeId ? `https://www.youtube.com/embed/${youtubeId}` : source;\n player = this.getYoutubePlayer(youtubeId, width, height, autoPlay);\n } else if (isVimeo) {\n const vimeoId = this.getVimeoId(source);\n embedUrl = source;\n player = this.getVimeoPlayer(vimeoId, width, height, autoPlay);\n } else if (playbackId) {\n embedUrl = this.getStreamPlaybackUrl();\n player = this.getStreamPlayer(embedUrl, width, height, autoPlay);\n showLoading = true;\n } else if (useVideoPlayer) {\n embedUrl = source;\n player = this.getVideoPlayer(embedUrl, width, height, autoPlay);\n }\n }\n if (!player && isUrlLink) {\n embedUrl = source;\n player = this.getWebviewPlayer(embedUrl);\n }\n\n // console.log({\n // Streaming: embedUrl,\n // Landscape: isLandscape,\n // Loaded: playbackLoaded,\n // Buffering: playbackBuffering,\n // LoadingIndicator: showLoading,\n // Width: width,\n // Height: height,\n // HeightFactor: heightFactor,\n // });\n return (\n <View style={styles.container}>\n {player}\n {showLoading && (!playbackLoaded || playbackBuffering) && (\n <View style={styles.loadingContainer}>\n <Spinner color={'#fff'} />\n </View>\n )}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: '#000',\n alignItems: 'center',\n justifyContent: 'center',\n },\n webView: {\n flex: 1,\n },\n loadingContainer: {\n position: 'absolute',\n top: 50,\n left: 0,\n right: 0,\n bottom: 50,\n justifyContent: 'center',\n alignItems: 'center',\n },\n});\n\nexport default MediaPlayer;\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, Modal, TouchableWithoutFeedback, KeyboardAvoidingView, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
class MiddlePopup extends PureComponent {
|
|
5
|
+
render() {
|
|
6
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
7
|
+
visible: this.props.visible,
|
|
8
|
+
transparent: true,
|
|
9
|
+
animationType: "fade",
|
|
10
|
+
onRequestClose: this.props.onClose
|
|
11
|
+
}, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
12
|
+
behavior: this.props.keyboardAvoid && Platform.OS === 'ios' && 'padding',
|
|
13
|
+
style: styles.popup
|
|
14
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
15
|
+
onPress: this.props.onClose
|
|
16
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
17
|
+
style: styles.popupOverlay
|
|
18
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: [styles.popupContent, this.props.style]
|
|
20
|
+
}, this.props.children)));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const styles = {
|
|
26
|
+
popup: {
|
|
27
|
+
flex: 1,
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
alignItems: 'center'
|
|
30
|
+
},
|
|
31
|
+
popupOverlay: {
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
backgroundColor: 'rgba(19, 19, 26, .25)',
|
|
34
|
+
top: 0,
|
|
35
|
+
left: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
bottom: 0
|
|
38
|
+
},
|
|
39
|
+
popupContent: {
|
|
40
|
+
borderRadius: 12,
|
|
41
|
+
backgroundColor: '#fff',
|
|
42
|
+
alignItems: 'center'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export { MiddlePopup };
|
|
46
|
+
//# sourceMappingURL=MiddlePopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MiddlePopup.js"],"names":["React","PureComponent","View","Modal","TouchableWithoutFeedback","KeyboardAvoidingView","Platform","MiddlePopup","render","props","visible","onClose","keyboardAvoid","OS","styles","popup","popupOverlay","popupContent","style","children","flex","justifyContent","alignItems","position","backgroundColor","top","left","right","bottom","borderRadius"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,wBAAtB,EAAgDC,oBAAhD,EAAsEC,QAAtE,QAAsF,cAAtF;;AAEA,MAAMC,WAAN,SAA0BN,aAA1B,CAAwC;AACtCO,EAAAA,MAAM,GAAG;AACP,wBACE,oBAAC,KAAD;AAAO,MAAA,OAAO,EAAE,KAAKC,KAAL,CAAWC,OAA3B;AAAoC,MAAA,WAAW,MAA/C;AAAgD,MAAA,aAAa,EAAC,MAA9D;AAAqE,MAAA,cAAc,EAAE,KAAKD,KAAL,CAAWE;AAAhG,oBACE,oBAAC,oBAAD;AAAsB,MAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWG,aAAX,IAA4BN,QAAQ,CAACO,EAAT,KAAgB,KAA5C,IAAqD,SAArF;AAAgG,MAAA,KAAK,EAAEC,MAAM,CAACC;AAA9G,oBACE,oBAAC,wBAAD;AAA0B,MAAA,OAAO,EAAE,KAAKN,KAAL,CAAWE;AAA9C,oBACE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAEG,MAAM,CAACE;AAApB,MADF,CADF,eAIE,oBAAC,IAAD;AAAM,MAAA,KAAK,EAAE,CAACF,MAAM,CAACG,YAAR,EAAsB,KAAKR,KAAL,CAAWS,KAAjC;AAAb,OAAuD,KAAKT,KAAL,CAAWU,QAAlE,CAJF,CADF,CADF;AAUD;;AAZqC;;AAexC,MAAML,MAAM,GAAG;AACbC,EAAAA,KAAK,EAAE;AACLK,IAAAA,IAAI,EAAE,CADD;AAELC,IAAAA,cAAc,EAAE,QAFX;AAGLC,IAAAA,UAAU,EAAE;AAHP,GADM;AAMbN,EAAAA,YAAY,EAAE;AACZO,IAAAA,QAAQ,EAAE,UADE;AAEZC,IAAAA,eAAe,EAAE,uBAFL;AAGZC,IAAAA,GAAG,EAAE,CAHO;AAIZC,IAAAA,IAAI,EAAE,CAJM;AAKZC,IAAAA,KAAK,EAAE,CALK;AAMZC,IAAAA,MAAM,EAAE;AANI,GAND;AAcbX,EAAAA,YAAY,EAAE;AACZY,IAAAA,YAAY,EAAE,EADF;AAEZL,IAAAA,eAAe,EAAE,MAFL;AAGZF,IAAAA,UAAU,EAAE;AAHA;AAdD,CAAf;AAqBA,SAASf,WAAT","sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, Modal, TouchableWithoutFeedback, KeyboardAvoidingView, Platform } from 'react-native';\n\nclass MiddlePopup extends PureComponent {\n render() {\n return (\n <Modal visible={this.props.visible} transparent animationType=\"fade\" onRequestClose={this.props.onClose}>\n <KeyboardAvoidingView behavior={this.props.keyboardAvoid && Platform.OS === 'ios' && 'padding'} style={styles.popup}>\n <TouchableWithoutFeedback onPress={this.props.onClose}>\n <View style={styles.popupOverlay} />\n </TouchableWithoutFeedback>\n <View style={[styles.popupContent, this.props.style]}>{this.props.children}</View>\n </KeyboardAvoidingView>\n </Modal>\n );\n }\n}\n\nconst styles = {\n popup: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n popupOverlay: {\n position: 'absolute',\n backgroundColor: 'rgba(19, 19, 26, .25)',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n },\n popupContent: {\n borderRadius: 12,\n backgroundColor: '#fff',\n alignItems: 'center',\n },\n};\n\nexport { MiddlePopup };\n"]}
|
|
@@ -0,0 +1,188 @@
|
|
|
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, Text, TouchableOpacity, Modal, Dimensions } from 'react-native';
|
|
5
|
+
import { Icon } from 'react-native-elements';
|
|
6
|
+
import { WebView } from 'react-native-webview';
|
|
7
|
+
import { Pl60Icon } from '../fonts';
|
|
8
|
+
import { Spinner } from './Spinner';
|
|
9
|
+
import { StatusBarHeight } from '../helper';
|
|
10
|
+
const SCREEN_HEIGHT = Dimensions.get('window').height;
|
|
11
|
+
|
|
12
|
+
class PDFPopup extends Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "state", {
|
|
17
|
+
loaded: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onLoadStarted() {
|
|
22
|
+
this.setState({
|
|
23
|
+
loaded: false
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
onLoadEnded() {
|
|
28
|
+
this.setState({
|
|
29
|
+
loaded: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
onChangeIndex(index) {
|
|
34
|
+
this.props.onChangeIndex(index);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getUrl() {
|
|
38
|
+
const linkPrefix = 'http://drive.google.com/viewerng/viewer?embedded=true&url=';
|
|
39
|
+
return `${linkPrefix}${this.props.source}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
closePopup() {
|
|
43
|
+
this.props.onClose();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
renderFooter() {
|
|
47
|
+
if (this.props.pdfCount && this.props.pdfCount === 1) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.footerContent
|
|
53
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
54
|
+
onPress: this.onChangeIndex.bind(this, -1),
|
|
55
|
+
activeOpacity: 0.6
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
+
type: "font-awesome",
|
|
58
|
+
name: "angle-left",
|
|
59
|
+
iconStyle: [styles.chevron]
|
|
60
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
61
|
+
style: styles.footerText
|
|
62
|
+
}, this.props.selectedIndex + 1, " / ", this.props.pdfCount), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
63
|
+
onPress: this.onChangeIndex.bind(this, 1),
|
|
64
|
+
activeOpacity: 0.6
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
66
|
+
type: "font-awesome",
|
|
67
|
+
name: "angle-right",
|
|
68
|
+
iconStyle: [styles.chevron]
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
render() {
|
|
73
|
+
if (!this.props.source) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
78
|
+
visible: this.props.visible,
|
|
79
|
+
transparent: true,
|
|
80
|
+
animationType: "slide",
|
|
81
|
+
onRequestClose: this.closePopup.bind(this)
|
|
82
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
83
|
+
style: {
|
|
84
|
+
flex: 1,
|
|
85
|
+
backgroundColor: '#000',
|
|
86
|
+
paddingTop: StatusBarHeight(0)
|
|
87
|
+
}
|
|
88
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
89
|
+
style: styles.headerContent
|
|
90
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
91
|
+
onPress: this.closePopup.bind(this),
|
|
92
|
+
activeOpacity: 0.6
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Pl60Icon, {
|
|
94
|
+
name: "close",
|
|
95
|
+
style: [styles.menuIcon]
|
|
96
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
style: styles.titleContainer
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
99
|
+
style: styles.title
|
|
100
|
+
}, this.props.title))), /*#__PURE__*/React.createElement(View, {
|
|
101
|
+
style: {
|
|
102
|
+
flex: 1,
|
|
103
|
+
backgroundColor: '#fff'
|
|
104
|
+
}
|
|
105
|
+
}, this.state.loaded ? null : /*#__PURE__*/React.createElement(Spinner, {
|
|
106
|
+
style: {
|
|
107
|
+
height: SCREEN_HEIGHT - StatusBarHeight(145),
|
|
108
|
+
flex: 0
|
|
109
|
+
}
|
|
110
|
+
}), /*#__PURE__*/React.createElement(WebView, {
|
|
111
|
+
ref: "PDFWebView",
|
|
112
|
+
source: {
|
|
113
|
+
uri: this.getUrl()
|
|
114
|
+
},
|
|
115
|
+
renderError: e => {
|
|
116
|
+
console.log('errored');
|
|
117
|
+
console.log(e);
|
|
118
|
+
},
|
|
119
|
+
style: [{
|
|
120
|
+
flex: 1,
|
|
121
|
+
backgroundColor: '#fff'
|
|
122
|
+
}],
|
|
123
|
+
onLoadStart: this.onLoadStarted.bind(this),
|
|
124
|
+
onLoadEnd: this.onLoadEnded.bind(this)
|
|
125
|
+
})), this.renderFooter()));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const styles = {
|
|
131
|
+
container: {
|
|
132
|
+
flex: 1,
|
|
133
|
+
position: 'relative',
|
|
134
|
+
backgroundColor: '#000'
|
|
135
|
+
},
|
|
136
|
+
innerContainer: {
|
|
137
|
+
flex: 1,
|
|
138
|
+
paddingLeft: 15,
|
|
139
|
+
paddingRight: 15
|
|
140
|
+
},
|
|
141
|
+
menuIcon: {
|
|
142
|
+
fontSize: 25,
|
|
143
|
+
padding: 15,
|
|
144
|
+
width: 55,
|
|
145
|
+
textAlign: 'center',
|
|
146
|
+
color: '#fff',
|
|
147
|
+
zIndex: 3
|
|
148
|
+
},
|
|
149
|
+
headerContent: {
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
height: 70
|
|
153
|
+
},
|
|
154
|
+
titleContainer: {
|
|
155
|
+
flex: 1,
|
|
156
|
+
paddingRight: 55
|
|
157
|
+
},
|
|
158
|
+
title: {
|
|
159
|
+
color: '#fff',
|
|
160
|
+
fontFamily: 'sf-semibold',
|
|
161
|
+
fontSize: 16,
|
|
162
|
+
textAlign: 'center'
|
|
163
|
+
},
|
|
164
|
+
footerContent: {
|
|
165
|
+
flexDirection: 'row',
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
justifyContent: 'center',
|
|
168
|
+
height: 70 //alignSelf: 'flex-end'
|
|
169
|
+
|
|
170
|
+
},
|
|
171
|
+
chevron: {
|
|
172
|
+
fontSize: 25,
|
|
173
|
+
padding: 15,
|
|
174
|
+
width: 55,
|
|
175
|
+
textAlign: 'center',
|
|
176
|
+
color: '#fff',
|
|
177
|
+
zIndex: 3
|
|
178
|
+
},
|
|
179
|
+
footerText: {
|
|
180
|
+
fontFamily: 'sf-regular',
|
|
181
|
+
fontSize: 14,
|
|
182
|
+
color: '#fff',
|
|
183
|
+
width: 150,
|
|
184
|
+
textAlign: 'center'
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
export { PDFPopup };
|
|
188
|
+
//# sourceMappingURL=PDFPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PDFPopup.js"],"names":["React","Component","View","Text","TouchableOpacity","Modal","Dimensions","Icon","WebView","Pl60Icon","Spinner","StatusBarHeight","SCREEN_HEIGHT","get","height","PDFPopup","loaded","onLoadStarted","setState","onLoadEnded","onChangeIndex","index","props","getUrl","linkPrefix","source","closePopup","onClose","renderFooter","pdfCount","styles","footerContent","bind","chevron","footerText","selectedIndex","render","visible","flex","backgroundColor","paddingTop","headerContent","menuIcon","titleContainer","title","state","uri","e","console","log","container","position","innerContainer","paddingLeft","paddingRight","fontSize","padding","width","textAlign","color","zIndex","flexDirection","alignItems","fontFamily","justifyContent"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,gBAArB,EAAuCC,KAAvC,EAA8CC,UAA9C,QAAgE,cAAhE;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,eAAT,QAAgC,WAAhC;AAEA,MAAMC,aAAa,GAAGN,UAAU,CAACO,GAAX,CAAe,QAAf,EAAyBC,MAA/C;;AAEA,MAAMC,QAAN,SAAuBd,SAAvB,CAAiC;AAAA;AAAA;;AAAA,mCACvB;AACNe,MAAAA,MAAM,EAAE;AADF,KADuB;AAAA;;AAK/BC,EAAAA,aAAa,GAAG;AACd,SAAKC,QAAL,CAAc;AACZF,MAAAA,MAAM,EAAE;AADI,KAAd;AAGD;;AAEDG,EAAAA,WAAW,GAAG;AACZ,SAAKD,QAAL,CAAc;AACZF,MAAAA,MAAM,EAAE;AADI,KAAd;AAGD;;AAEDI,EAAAA,aAAa,CAACC,KAAD,EAAQ;AACnB,SAAKC,KAAL,CAAWF,aAAX,CAAyBC,KAAzB;AACD;;AAEDE,E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I,EAAE,CADQ;AAEdgB,IAAAA,YAAY,EAAE;AAFA,GAxBH;AA4BbV,EAAAA,KAAK,EAAE;AACLe,IAAAA,KAAK,EAAE,MADF;AAELI,IAAAA,UAAU,EAAE,aAFP;AAGLR,IAAAA,QAAQ,EAAE,EAHL;AAILG,IAAAA,SAAS,EAAE;AAJN,GA5BM;AAkCb3B,EAAAA,aAAa,EAAE;AACb8B,IAAAA,aAAa,EAAE,KADF;AAEbC,IAAAA,UAAU,EAAE,QAFC;AAGbE,IAAAA,cAAc,EAAE,QAHH;AAIblD,IAAAA,MAAM,EAAE,EAJK,CAKb;;AALa,GAlCF;AAyCbmB,EAAAA,OAAO,EAAE;AACPsB,IAAAA,QAAQ,EAAE,EADH;AAEPC,IAAAA,OAAO,EAAE,EAFF;AAGPC,IAAAA,KAAK,EAAE,EAHA;AAIPC,IAAAA,SAAS,EAAE,QAJJ;AAKPC,IAAAA,KAAK,EAAE,MALA;AAMPC,IAAAA,MAAM,EAAE;AAND,GAzCI;AAiDb1B,EAAAA,UAAU,EAAE;AACV6B,IAAAA,UAAU,EAAE,YADF;AAEVR,IAAAA,QAAQ,EAAE,EAFA;AAGVI,IAAAA,KAAK,EAAE,MAHG;AAIVF,IAAAA,KAAK,EAAE,GAJG;AAKVC,IAAAA,SAAS,EAAE;AALD;AAjDC,CAAf;AA0DA,SAAS3C,QAAT","sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, TouchableOpacity, Modal, Dimensions } from 'react-native';\nimport { Icon } from 'react-native-elements';\nimport { WebView } from 'react-native-webview';\nimport { Pl60Icon } from '../fonts';\nimport { Spinner } from './Spinner';\nimport { StatusBarHeight } from '../helper';\n\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\n\nclass PDFPopup extends Component {\n state = {\n loaded: false,\n };\n\n onLoadStarted() {\n this.setState({\n loaded: false,\n });\n }\n\n onLoadEnded() {\n this.setState({\n loaded: true,\n });\n }\n\n onChangeIndex(index) {\n this.props.onChangeIndex(index);\n }\n\n getUrl() {\n const linkPrefix = 'http://drive.google.com/viewerng/viewer?embedded=true&url=';\n return `${linkPrefix}${this.props.source}`;\n }\n\n closePopup() {\n this.props.onClose();\n }\n\n renderFooter() {\n if (this.props.pdfCount && this.props.pdfCount === 1) {\n return null;\n }\n return (\n <View style={styles.footerContent}>\n <TouchableOpacity onPress={this.onChangeIndex.bind(this, -1)} activeOpacity={0.6}>\n <Icon type=\"font-awesome\" name=\"angle-left\" iconStyle={[styles.chevron]} />\n </TouchableOpacity>\n <Text style={styles.footerText}>\n {this.props.selectedIndex + 1} / {this.props.pdfCount}\n </Text>\n <TouchableOpacity onPress={this.onChangeIndex.bind(this, 1)} activeOpacity={0.6}>\n <Icon type=\"font-awesome\" name=\"angle-right\" iconStyle={[styles.chevron]} />\n </TouchableOpacity>\n </View>\n );\n }\n\n render() {\n if (!this.props.source) {\n return null;\n }\n return (\n <Modal visible={this.props.visible} transparent animationType=\"slide\" onRequestClose={this.closePopup.bind(this)}>\n <View\n style={{\n flex: 1,\n backgroundColor: '#000',\n paddingTop: StatusBarHeight(0),\n }}\n >\n <View style={styles.headerContent}>\n <TouchableOpacity onPress={this.closePopup.bind(this)} activeOpacity={0.6}>\n <Pl60Icon name=\"close\" style={[styles.menuIcon]} />\n </TouchableOpacity>\n <View style={styles.titleContainer}>\n <Text style={styles.title}>{this.props.title}</Text>\n </View>\n </View>\n <View style={{ flex: 1, backgroundColor: '#fff' }}>\n {this.state.loaded ? null : <Spinner style={{ height: SCREEN_HEIGHT - StatusBarHeight(145), flex: 0 }} />}\n <WebView\n ref=\"PDFWebView\"\n source={{\n uri: this.getUrl(),\n }}\n renderError={e => {\n console.log('errored');\n console.log(e);\n }}\n style={[\n {\n flex: 1,\n backgroundColor: '#fff',\n },\n ]}\n onLoadStart={this.onLoadStarted.bind(this)}\n onLoadEnd={this.onLoadEnded.bind(this)}\n />\n </View>\n {this.renderFooter()}\n </View>\n </Modal>\n );\n }\n}\n\nconst styles = {\n container: {\n flex: 1,\n position: 'relative',\n backgroundColor: '#000',\n },\n innerContainer: {\n flex: 1,\n paddingLeft: 15,\n paddingRight: 15,\n },\n menuIcon: {\n fontSize: 25,\n padding: 15,\n width: 55,\n textAlign: 'center',\n color: '#fff',\n zIndex: 3,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n height: 70,\n },\n titleContainer: {\n flex: 1,\n paddingRight: 55,\n },\n title: {\n color: '#fff',\n fontFamily: 'sf-semibold',\n fontSize: 16,\n textAlign: 'center',\n },\n footerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 70,\n //alignSelf: 'flex-end'\n },\n chevron: {\n fontSize: 25,\n padding: 15,\n width: 55,\n textAlign: 'center',\n color: '#fff',\n zIndex: 3,\n },\n footerText: {\n fontFamily: 'sf-regular',\n fontSize: 14,\n color: '#fff',\n width: 150,\n textAlign: 'center',\n },\n};\n\nexport { PDFPopup };\n"]}
|