|
@@ -1,16 +1,18 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import React, { PureComponent } from 'react';
|
4
|
|
-import { SafeAreaView, View } from 'react-native';
|
|
4
|
+import { View } from 'react-native';
|
5
|
5
|
import { WebView } from 'react-native-webview';
|
6
|
6
|
import type { Dispatch } from 'redux';
|
7
|
7
|
|
8
|
8
|
import { ColorSchemeRegistry } from '../../../base/color-scheme';
|
9
|
9
|
import { translate } from '../../../base/i18n';
|
10
|
|
-import { HeaderWithNavigation, LoadingIndicator, SlidingView } from '../../../base/react';
|
|
10
|
+import { JitsiModal } from '../../../base/modal';
|
|
11
|
+import { LoadingIndicator } from '../../../base/react';
|
11
|
12
|
import { connect } from '../../../base/redux';
|
12
|
13
|
|
13
|
14
|
import { toggleDocument } from '../../actions';
|
|
15
|
+import { SHARE_DOCUMENT_VIEW_ID } from '../../constants';
|
14
|
16
|
import { getSharedDocumentUrl } from '../../functions';
|
15
|
17
|
|
16
|
18
|
import styles, { INDICATOR_COLOR } from './styles';
|
|
@@ -69,42 +71,24 @@ class SharedDocument extends PureComponent<Props> {
|
69
|
71
|
* @inheritdoc
|
70
|
72
|
*/
|
71
|
73
|
render() {
|
72
|
|
- const { _documentUrl, _isOpen } = this.props;
|
73
|
|
- const webViewStyles = this._getWebViewStyles();
|
|
74
|
+ const { _documentUrl } = this.props;
|
74
|
75
|
|
75
|
76
|
return (
|
76
|
|
- <SlidingView
|
77
|
|
- onHide = { this._onClose }
|
78
|
|
- position = 'bottom'
|
79
|
|
- show = { _isOpen } >
|
80
|
|
- <View style = { styles.webViewWrapper }>
|
81
|
|
- <HeaderWithNavigation
|
82
|
|
- headerLabelKey = 'documentSharing.title'
|
83
|
|
- onPressBack = { this._onClose } />
|
84
|
|
- <SafeAreaView style = { webViewStyles }>
|
85
|
|
- <WebView
|
86
|
|
- onError = { this._onError }
|
87
|
|
- renderLoading = { this._renderLoading }
|
88
|
|
- source = {{ uri: _documentUrl }}
|
89
|
|
- startInLoadingState = { true } />
|
90
|
|
- </SafeAreaView>
|
91
|
|
- </View>
|
92
|
|
- </SlidingView>
|
|
77
|
+ <JitsiModal
|
|
78
|
+ headerProps = {{
|
|
79
|
+ headerLabelKey: 'documentSharing.title'
|
|
80
|
+ }}
|
|
81
|
+ modalId = { SHARE_DOCUMENT_VIEW_ID }
|
|
82
|
+ style = { styles.webView }>
|
|
83
|
+ <WebView
|
|
84
|
+ onError = { this._onError }
|
|
85
|
+ renderLoading = { this._renderLoading }
|
|
86
|
+ source = {{ uri: _documentUrl }}
|
|
87
|
+ startInLoadingState = { true } />
|
|
88
|
+ </JitsiModal>
|
93
|
89
|
);
|
94
|
90
|
}
|
95
|
91
|
|
96
|
|
- /**
|
97
|
|
- * Computes the styles required for the WebView component.
|
98
|
|
- *
|
99
|
|
- * @returns {Object}
|
100
|
|
- */
|
101
|
|
- _getWebViewStyles() {
|
102
|
|
- return {
|
103
|
|
- ...styles.webView,
|
104
|
|
- backgroundColor: this.props._headerStyles.screenHeader.backgroundColor
|
105
|
|
- };
|
106
|
|
- }
|
107
|
|
-
|
108
|
92
|
_onClose: () => boolean
|
109
|
93
|
|
110
|
94
|
/**
|