summaryrefslogtreecommitdiff
path: root/client/src/lib/components/webViewModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/lib/components/webViewModal.js')
-rw-r--r--client/src/lib/components/webViewModal.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/client/src/lib/components/webViewModal.js b/client/src/lib/components/webViewModal.js
new file mode 100644
index 0000000..0796470
--- /dev/null
+++ b/client/src/lib/components/webViewModal.js
@@ -0,0 +1,56 @@
+import React, { Component } from 'react'
+import {
+ StyleSheet,
+ WebView,
+ View,
+ ActivityIndicator,
+} from 'react-native'
+import Modal from 'react-native-modal'
+
+import Close from './close'
+
+export default class WebViewModal extends Component {
+ render() {
+ return (
+ <Modal isVisible={!!this.props.url} style={styles.modal}>
+ <WebView
+ source={{uri: this.props.url || 'about:blank'}}
+ style={styles.webview}
+ startInLoadingState={true}
+ renderLoading={() => {
+ return (
+ <View style={styles.loadingContainer}>
+ <ActivityIndicator size="large" color="white" />
+ </View>
+ )
+ }}
+ />
+ <Close onPress={this.props.onClose} />
+ </Modal>
+ )
+ }
+}
+
+const styles = StyleSheet.create({
+ modal: {
+ marginLeft: 0,
+ marginRight: 0,
+ marginBottom: 0,
+ marginTop: 0,
+ paddingTop: 60,
+ backgroundColor: 'black',
+ },
+ webview: {
+ flex: 1,
+ justifyContent: 'flex-start',
+ alignItems: 'flex-start',
+ },
+ loadingContainer: {
+ backgroundColor: 'black',
+ flex: 1,
+ height: '100%',
+ width: '100%',
+ justifyContent: 'center',
+ alignItems: 'center',
+ },
+})