Parcourir la source

ref: DialInSummary to JitsiModal

master
Bettenbuk Zoltan il y a 5 ans
Parent
révision
0c2e13a453

+ 0
- 9
react/features/invite/actionTypes.js Voir le fichier

41
  */
41
  */
42
 export const SET_CALLEE_INFO_VISIBLE = 'SET_CALLEE_INFO_VISIBLE';
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
  * The type of redux action which sets the invite dialog visible or invisible.
46
  * The type of redux action which sets the invite dialog visible or invisible.

+ 0
- 25
react/features/invite/actions.any.js Voir le fichier

11
     BEGIN_ADD_PEOPLE,
11
     BEGIN_ADD_PEOPLE,
12
     REMOVE_PENDING_INVITE_REQUESTS,
12
     REMOVE_PENDING_INVITE_REQUESTS,
13
     SET_CALLEE_INFO_VISIBLE,
13
     SET_CALLEE_INFO_VISIBLE,
14
-    SET_DIAL_IN_SUMMARY_VISIBLE,
15
     SET_INVITE_DIALOG_VISIBLE,
14
     SET_INVITE_DIALOG_VISIBLE,
16
     UPDATE_DIAL_IN_NUMBERS_FAILED,
15
     UPDATE_DIAL_IN_NUMBERS_FAILED,
17
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
16
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
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
  * Removes all pending invite requests.
260
  * Removes all pending invite requests.
277
         type: REMOVE_PENDING_INVITE_REQUESTS
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 Voir le fichier

7
 
7
 
8
 import { openDialog } from '../../../../base/dialog';
8
 import { openDialog } from '../../../../base/dialog';
9
 import { translate } from '../../../../base/i18n';
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
 import { connect } from '../../../../base/redux';
12
 import { connect } from '../../../../base/redux';
16
 
13
 
17
-import { hideDialInSummary } from '../../../actions';
14
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../../constants';
18
 import { getDialInfoPageURLForURIString } from '../../../functions';
15
 import { getDialInfoPageURLForURIString } from '../../../functions';
19
 
16
 
20
 import DialInSummaryErrorDialog from './DialInSummaryErrorDialog';
17
 import DialInSummaryErrorDialog from './DialInSummaryErrorDialog';
43
     constructor(props: Props) {
40
     constructor(props: Props) {
44
         super(props);
41
         super(props);
45
 
42
 
46
-        this._onCloseView = this._onCloseView.bind(this);
47
         this._onError = this._onError.bind(this);
43
         this._onError = this._onError.bind(this);
48
         this._onNavigate = this._onNavigate.bind(this);
44
         this._onNavigate = this._onNavigate.bind(this);
49
         this._renderLoading = this._renderLoading.bind(this);
45
         this._renderLoading = this._renderLoading.bind(this);
58
         const { _summaryUrl } = this.props;
54
         const { _summaryUrl } = this.props;
59
 
55
 
60
         return (
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
     _onError: () => void;
74
     _onError: () => void;
99
 
75
 
100
     /**
76
     /**
103
      * @returns {void}
79
      * @returns {void}
104
      */
80
      */
105
     _onError() {
81
     _onError() {
106
-        this.props.dispatch(hideDialInSummary());
82
+        this.props.dispatch(setActiveModalId());
107
         this.props.dispatch(openDialog(DialInSummaryErrorDialog));
83
         this.props.dispatch(openDialog(DialInSummaryErrorDialog));
108
     }
84
     }
109
 
85
 
122
 
98
 
123
         if (url.startsWith('tel:')) {
99
         if (url.startsWith('tel:')) {
124
             Linking.openURL(url);
100
             Linking.openURL(url);
125
-            this.props.dispatch(hideDialInSummary());
101
+
102
+            this.props.dispatch(setActiveModalId());
126
         }
103
         }
127
 
104
 
128
         return url === getDialInfoPageURLForURIString(this.props._summaryUrl);
105
         return url === getDialInfoPageURLForURIString(this.props._summaryUrl);
156
  */
133
  */
157
 function _mapStateToProps(state) {
134
 function _mapStateToProps(state) {
158
     return {
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 Voir le fichier

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

+ 5
- 0
react/features/invite/constants.js Voir le fichier

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
  * The identifier of the sound to be played when the status of an outgoing call
7
  * The identifier of the sound to be played when the status of an outgoing call
3
  * is expired.
8
  * is expired.

+ 0
- 6
react/features/invite/reducer.js Voir le fichier

6
     ADD_PENDING_INVITE_REQUEST,
6
     ADD_PENDING_INVITE_REQUEST,
7
     REMOVE_PENDING_INVITE_REQUESTS,
7
     REMOVE_PENDING_INVITE_REQUESTS,
8
     SET_CALLEE_INFO_VISIBLE,
8
     SET_CALLEE_INFO_VISIBLE,
9
-    SET_DIAL_IN_SUMMARY_VISIBLE,
10
     SET_INVITE_DIALOG_VISIBLE,
9
     SET_INVITE_DIALOG_VISIBLE,
11
     UPDATE_DIAL_IN_NUMBERS_FAILED,
10
     UPDATE_DIAL_IN_NUMBERS_FAILED,
12
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
11
     UPDATE_DIAL_IN_NUMBERS_SUCCESS
50
             initialCalleeInfo: action.initialCalleeInfo
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
     case SET_INVITE_DIALOG_VISIBLE:
53
     case SET_INVITE_DIALOG_VISIBLE:
60
         return {
54
         return {

+ 3
- 2
react/features/recent-list/components/RecentList.native.js Voir le fichier

5
 
5
 
6
 import { getDefaultURL } from '../../app';
6
 import { getDefaultURL } from '../../app';
7
 import { translate } from '../../base/i18n';
7
 import { translate } from '../../base/i18n';
8
+import { setActiveModalId } from '../../base/modal';
8
 import { NavigateSectionList, type Section } from '../../base/react';
9
 import { NavigateSectionList, type Section } from '../../base/react';
9
 import { connect } from '../../base/redux';
10
 import { connect } from '../../base/redux';
10
 import { ColorPalette } from '../../base/styles';
11
 import { ColorPalette } from '../../base/styles';
11
-import { showDialInSummary } from '../../invite';
12
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../invite/constants';
12
 
13
 
13
 import { deleteRecentListEntry } from '../actions';
14
 import { deleteRecentListEntry } from '../actions';
14
 import { isRecentListEnabled, toDisplayableList } from '../functions';
15
 import { isRecentListEnabled, toDisplayableList } from '../functions';
124
      * @returns {void}
125
      * @returns {void}
125
      */
126
      */
126
     _onShowDialInInfo(itemId) {
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
 

Chargement…
Annuler
Enregistrer