Bläddra i källkod

ref: DialInSummary to JitsiModal

master
Bettenbuk Zoltan 5 år sedan
förälder
incheckning
0c2e13a453

+ 0
- 9
react/features/invite/actionTypes.js Visa fil

@@ -41,15 +41,6 @@ export const REMOVE_PENDING_INVITE_REQUESTS
41 41
  */
42 42
 export const SET_CALLEE_INFO_VISIBLE = 'SET_CALLEE_INFO_VISIBLE';
43 43
 
44
-/**
45
- * The type of Redux action to set the visibility of the dial in summary.
46
- *
47
- * {
48
- *     type: SET_DIAL_IN_SUMMARY_VISIBLE,
49
- *     visible: boolean
50
- * }
51
- */
52
-export const SET_DIAL_IN_SUMMARY_VISIBLE = 'SET_DIAL_IN_SUMMARY_VISIBLE';
53 44
 
54 45
 /**
55 46
  * The type of redux action which sets the invite dialog visible or invisible.

+ 0
- 25
react/features/invite/actions.any.js Visa fil

@@ -11,7 +11,6 @@ import {
11 11
     BEGIN_ADD_PEOPLE,
12 12
     REMOVE_PENDING_INVITE_REQUESTS,
13 13
     SET_CALLEE_INFO_VISIBLE,
14
-    SET_DIAL_IN_SUMMARY_VISIBLE,
15 14
     SET_INVITE_DIALOG_VISIBLE,
16 15
     UPDATE_DIAL_IN_NUMBERS_FAILED,
17 16
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
@@ -256,14 +255,6 @@ export function addPendingInviteRequest(
256 255
     };
257 256
 }
258 257
 
259
-/**
260
- * Action to hide the dial in summary.
261
- *
262
- * @returns {showDialInSummary}
263
- */
264
-export function hideDialInSummary() {
265
-    return showDialInSummary(undefined);
266
-}
267 258
 
268 259
 /**
269 260
  * Removes all pending invite requests.
@@ -277,19 +268,3 @@ export function removePendingInviteRequests() {
277 268
         type: REMOVE_PENDING_INVITE_REQUESTS
278 269
     };
279 270
 }
280
-
281
-/**
282
- * Action to set the dial in summary url (and show it).
283
- *
284
- * @param {?string} locationUrl - The location URL to show the dial in summary for.
285
- * @returns {{
286
- *     type: SET_DIAL_IN_SUMMARY_VISIBLE,
287
- *     summaryUrl: ?string
288
- * }}
289
- */
290
-export function showDialInSummary(locationUrl: ?string) {
291
-    return {
292
-        type: SET_DIAL_IN_SUMMARY_VISIBLE,
293
-        summaryUrl: locationUrl
294
-    };
295
-}

+ 21
- 44
react/features/invite/components/dial-in-summary/native/DialInSummary.js Visa fil

@@ -7,14 +7,11 @@ import { type Dispatch } from 'redux';
7 7
 
8 8
 import { openDialog } from '../../../../base/dialog';
9 9
 import { translate } from '../../../../base/i18n';
10
-import {
11
-    HeaderWithNavigation,
12
-    LoadingIndicator,
13
-    SlidingView
14
-} from '../../../../base/react';
10
+import { JitsiModal, setActiveModalId } from '../../../../base/modal';
11
+import { LoadingIndicator } from '../../../../base/react';
15 12
 import { connect } from '../../../../base/redux';
16 13
 
17
-import { hideDialInSummary } from '../../../actions';
14
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../../constants';
18 15
 import { getDialInfoPageURLForURIString } from '../../../functions';
19 16
 
20 17
 import DialInSummaryErrorDialog from './DialInSummaryErrorDialog';
@@ -43,7 +40,6 @@ class DialInSummary extends Component<Props> {
43 40
     constructor(props: Props) {
44 41
         super(props);
45 42
 
46
-        this._onCloseView = this._onCloseView.bind(this);
47 43
         this._onError = this._onError.bind(this);
48 44
         this._onNavigate = this._onNavigate.bind(this);
49 45
         this._renderLoading = this._renderLoading.bind(this);
@@ -58,43 +54,23 @@ class DialInSummary extends Component<Props> {
58 54
         const { _summaryUrl } = this.props;
59 55
 
60 56
         return (
61
-            <SlidingView
62
-                onHide = { this._onCloseView }
63
-                position = 'bottom'
64
-                show = { Boolean(_summaryUrl) } >
65
-                <View style = { styles.webViewWrapper }>
66
-                    <HeaderWithNavigation
67
-                        headerLabelKey = 'info.label'
68
-                        onPressBack = { this._onCloseView } />
69
-                    <WebView
70
-                        onError = { this._onError }
71
-                        onShouldStartLoadWithRequest = { this._onNavigate }
72
-                        renderLoading = { this._renderLoading }
73
-                        source = {{ uri: getDialInfoPageURLForURIString(_summaryUrl) }}
74
-                        startInLoadingState = { true }
75
-                        style = { styles.webView } />
76
-                </View>
77
-            </SlidingView>
57
+            <JitsiModal
58
+                headerProps = {{
59
+                    headerLabelKey: 'info.label'
60
+                }}
61
+                modalId = { DIAL_IN_SUMMARY_VIEW_ID }
62
+                style = { styles.backDrop } >
63
+                <WebView
64
+                    onError = { this._onError }
65
+                    onShouldStartLoadWithRequest = { this._onNavigate }
66
+                    renderLoading = { this._renderLoading }
67
+                    source = {{ uri: getDialInfoPageURLForURIString(_summaryUrl) }}
68
+                    startInLoadingState = { true }
69
+                    style = { styles.webView } />
70
+            </JitsiModal>
78 71
         );
79 72
     }
80 73
 
81
-    _onCloseView: () => boolean;
82
-
83
-    /**
84
-     * Closes the view.
85
-     *
86
-     * @returns {boolean}
87
-     */
88
-    _onCloseView() {
89
-        if (this.props._summaryUrl) {
90
-            this.props.dispatch(hideDialInSummary());
91
-
92
-            return true;
93
-        }
94
-
95
-        return false;
96
-    }
97
-
98 74
     _onError: () => void;
99 75
 
100 76
     /**
@@ -103,7 +79,7 @@ class DialInSummary extends Component<Props> {
103 79
      * @returns {void}
104 80
      */
105 81
     _onError() {
106
-        this.props.dispatch(hideDialInSummary());
82
+        this.props.dispatch(setActiveModalId());
107 83
         this.props.dispatch(openDialog(DialInSummaryErrorDialog));
108 84
     }
109 85
 
@@ -122,7 +98,8 @@ class DialInSummary extends Component<Props> {
122 98
 
123 99
         if (url.startsWith('tel:')) {
124 100
             Linking.openURL(url);
125
-            this.props.dispatch(hideDialInSummary());
101
+
102
+            this.props.dispatch(setActiveModalId());
126 103
         }
127 104
 
128 105
         return url === getDialInfoPageURLForURIString(this.props._summaryUrl);
@@ -156,7 +133,7 @@ class DialInSummary extends Component<Props> {
156 133
  */
157 134
 function _mapStateToProps(state) {
158 135
     return {
159
-        _summaryUrl: state['features/invite'].summaryUrl
136
+        _summaryUrl: (state['features/base/modal'].modalProps || {}).summaryUrl
160 137
     };
161 138
 }
162 139
 

+ 7
- 5
react/features/invite/components/dial-in-summary/native/styles.js Visa fil

@@ -4,8 +4,14 @@ import { ColorPalette } from '../../../../base/styles';
4 4
 
5 5
 export const INDICATOR_COLOR = ColorPalette.lightGrey;
6 6
 
7
+const WV_BACKGROUND = 'rgb(71, 71, 71)';
8
+
7 9
 export default {
8 10
 
11
+    backDrop: {
12
+        backgroundColor: WV_BACKGROUND
13
+    },
14
+
9 15
     indicatorWrapper: {
10 16
         alignItems: 'center',
11 17
         backgroundColor: ColorPalette.white,
@@ -14,11 +20,7 @@ export default {
14 20
     },
15 21
 
16 22
     webView: {
23
+        backgroundColor: WV_BACKGROUND,
17 24
         flex: 1
18
-    },
19
-
20
-    webViewWrapper: {
21
-        flex: 1,
22
-        flexDirection: 'column'
23 25
     }
24 26
 };

+ 5
- 0
react/features/invite/constants.js Visa fil

@@ -1,3 +1,8 @@
1
+
2
+/**
3
+ * Modal ID for the DialInSummary modal.
4
+ */
5
+export const DIAL_IN_SUMMARY_VIEW_ID = 'DIAL_IN_SUMMARY_VIEW_ID';
1 6
 /**
2 7
  * The identifier of the sound to be played when the status of an outgoing call
3 8
  * is expired.

+ 0
- 6
react/features/invite/reducer.js Visa fil

@@ -6,7 +6,6 @@ import {
6 6
     ADD_PENDING_INVITE_REQUEST,
7 7
     REMOVE_PENDING_INVITE_REQUESTS,
8 8
     SET_CALLEE_INFO_VISIBLE,
9
-    SET_DIAL_IN_SUMMARY_VISIBLE,
10 9
     SET_INVITE_DIALOG_VISIBLE,
11 10
     UPDATE_DIAL_IN_NUMBERS_FAILED,
12 11
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
@@ -50,11 +49,6 @@ ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
50 49
             initialCalleeInfo: action.initialCalleeInfo
51 50
         };
52 51
 
53
-    case SET_DIAL_IN_SUMMARY_VISIBLE:
54
-        return {
55
-            ...state,
56
-            summaryUrl: action.summaryUrl
57
-        };
58 52
 
59 53
     case SET_INVITE_DIALOG_VISIBLE:
60 54
         return {

+ 3
- 2
react/features/recent-list/components/RecentList.native.js Visa fil

@@ -5,10 +5,11 @@ import type { Dispatch } from 'redux';
5 5
 
6 6
 import { getDefaultURL } from '../../app';
7 7
 import { translate } from '../../base/i18n';
8
+import { setActiveModalId } from '../../base/modal';
8 9
 import { NavigateSectionList, type Section } from '../../base/react';
9 10
 import { connect } from '../../base/redux';
10 11
 import { ColorPalette } from '../../base/styles';
11
-import { showDialInSummary } from '../../invite';
12
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../invite/constants';
12 13
 
13 14
 import { deleteRecentListEntry } from '../actions';
14 15
 import { isRecentListEnabled, toDisplayableList } from '../functions';
@@ -124,7 +125,7 @@ class RecentList extends AbstractRecentList<Props> {
124 125
      * @returns {void}
125 126
      */
126 127
     _onShowDialInInfo(itemId) {
127
-        this.props.dispatch(showDialInSummary(itemId.url));
128
+        this.props.dispatch(setActiveModalId(DIAL_IN_SUMMARY_VIEW_ID, { summaryUrl: itemId.url }));
128 129
     }
129 130
 }
130 131
 

Laddar…
Avbryt
Spara