Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref: DialInSummary to JitsiModal

Bettenbuk Zoltan0c2e13a453cb
diff --git a/react/features/invite/actionTypes.js b/react/features/invite/actionTypes.js
index 7481da176a..05841bf6f6 100644
--- a/react/features/invite/actionTypes.js
+++ b/react/features/invite/actionTypes.js
@@ -41,15 +41,6 @@ export const REMOVE_PENDING_INVITE_REQUESTS
*/
export const SET_CALLEE_INFO_VISIBLE = 'SET_CALLEE_INFO_VISIBLE';
-/**
- * The type of Redux action to set the visibility of the dial in summary.
- *
- * {
- * type: SET_DIAL_IN_SUMMARY_VISIBLE,
- * visible: boolean
- * }
- */
-export const SET_DIAL_IN_SUMMARY_VISIBLE = 'SET_DIAL_IN_SUMMARY_VISIBLE';
/**
* The type of redux action which sets the invite dialog visible or invisible.
diff --git a/react/features/invite/actions.any.js b/react/features/invite/actions.any.js
index 1086dc90bc..0f51301aa9 100644
--- a/react/features/invite/actions.any.js
+++ b/react/features/invite/actions.any.js
@@ -11,7 +11,6 @@ import {
BEGIN_ADD_PEOPLE,
REMOVE_PENDING_INVITE_REQUESTS,
SET_CALLEE_INFO_VISIBLE,
- SET_DIAL_IN_SUMMARY_VISIBLE,
SET_INVITE_DIALOG_VISIBLE,
UPDATE_DIAL_IN_NUMBERS_FAILED,
UPDATE_DIAL_IN_NUMBERS_SUCCESS
@@ -256,14 +255,6 @@ export function addPendingInviteRequest(
};
}
-/**
- * Action to hide the dial in summary.
- *
- * @returns {showDialInSummary}
- */
-export function hideDialInSummary() {
- return showDialInSummary(undefined);
-}
/**
* Removes all pending invite requests.
@@ -277,19 +268,3 @@ export function removePendingInviteRequests() {
type: REMOVE_PENDING_INVITE_REQUESTS
};
}
-
-/**
- * Action to set the dial in summary url (and show it).
- *
- * @param {?string} locationUrl - The location URL to show the dial in summary for.
- * @returns {{
- * type: SET_DIAL_IN_SUMMARY_VISIBLE,
- * summaryUrl: ?string
- * }}
- */
-export function showDialInSummary(locationUrl: ?string) {
- return {
- type: SET_DIAL_IN_SUMMARY_VISIBLE,
- summaryUrl: locationUrl
- };
-}
diff --git a/react/features/invite/components/dial-in-summary/native/DialInSummary.js b/react/features/invite/components/dial-in-summary/native/DialInSummary.js
index e9f4cdb855..82d0c81e29 100644
--- a/react/features/invite/components/dial-in-summary/native/DialInSummary.js
+++ b/react/features/invite/components/dial-in-summary/native/DialInSummary.js
@@ -7,14 +7,11 @@ import { type Dispatch } from 'redux';
import { openDialog } from '../../../../base/dialog';
import { translate } from '../../../../base/i18n';
-import {
- HeaderWithNavigation,
- LoadingIndicator,
- SlidingView
-} from '../../../../base/react';
+import { JitsiModal, setActiveModalId } from '../../../../base/modal';
+import { LoadingIndicator } from '../../../../base/react';
import { connect } from '../../../../base/redux';
-import { hideDialInSummary } from '../../../actions';
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../../constants';
import { getDialInfoPageURLForURIString } from '../../../functions';
import DialInSummaryErrorDialog from './DialInSummaryErrorDialog';
@@ -43,7 +40,6 @@ class DialInSummary extends Component<Props> {
constructor(props: Props) {
super(props);
- this._onCloseView = this._onCloseView.bind(this);
this._onError = this._onError.bind(this);
this._onNavigate = this._onNavigate.bind(this);
this._renderLoading = this._renderLoading.bind(this);
@@ -58,43 +54,23 @@ class DialInSummary extends Component<Props> {
const { _summaryUrl } = this.props;
return (
- <SlidingView
- onHide = { this._onCloseView }
- position = 'bottom'
- show = { Boolean(_summaryUrl) } >
- <View style = { styles.webViewWrapper }>
- <HeaderWithNavigation
- headerLabelKey = 'info.label'
- onPressBack = { this._onCloseView } />
- <WebView
- onError = { this._onError }
- onShouldStartLoadWithRequest = { this._onNavigate }
- renderLoading = { this._renderLoading }
- source = {{ uri: getDialInfoPageURLForURIString(_summaryUrl) }}
- startInLoadingState = { true }
- style = { styles.webView } />
- </View>
- </SlidingView>
+ <JitsiModal
+ headerProps = {{
+ headerLabelKey: 'info.label'
+ }}
+ modalId = { DIAL_IN_SUMMARY_VIEW_ID }
+ style = { styles.backDrop } >
+ <WebView
+ onError = { this._onError }
+ onShouldStartLoadWithRequest = { this._onNavigate }
+ renderLoading = { this._renderLoading }
+ source = {{ uri: getDialInfoPageURLForURIString(_summaryUrl) }}
+ startInLoadingState = { true }
+ style = { styles.webView } />
+ </JitsiModal>
);
}
- _onCloseView: () => boolean;
-
- /**
- * Closes the view.
- *
- * @returns {boolean}
- */
- _onCloseView() {
- if (this.props._summaryUrl) {
- this.props.dispatch(hideDialInSummary());
-
- return true;
- }
-
- return false;
- }
-
_onError: () => void;
/**
@@ -103,7 +79,7 @@ class DialInSummary extends Component<Props> {
* @returns {void}
*/
_onError() {
- this.props.dispatch(hideDialInSummary());
+ this.props.dispatch(setActiveModalId());
this.props.dispatch(openDialog(DialInSummaryErrorDialog));
}
@@ -122,7 +98,8 @@ class DialInSummary extends Component<Props> {
if (url.startsWith('tel:')) {
Linking.openURL(url);
- this.props.dispatch(hideDialInSummary());
+
+ this.props.dispatch(setActiveModalId());
}
return url === getDialInfoPageURLForURIString(this.props._summaryUrl);
@@ -156,7 +133,7 @@ class DialInSummary extends Component<Props> {
*/
function _mapStateToProps(state) {
return {
- _summaryUrl: state['features/invite'].summaryUrl
+ _summaryUrl: (state['features/base/modal'].modalProps || {}).summaryUrl
};
}
diff --git a/react/features/invite/components/dial-in-summary/native/styles.js b/react/features/invite/components/dial-in-summary/native/styles.js
index 3d76db05a9..9bfcaa56b5 100644
--- a/react/features/invite/components/dial-in-summary/native/styles.js
+++ b/react/features/invite/components/dial-in-summary/native/styles.js
@@ -4,8 +4,14 @@ import { ColorPalette } from '../../../../base/styles';
export const INDICATOR_COLOR = ColorPalette.lightGrey;
+const WV_BACKGROUND = 'rgb(71, 71, 71)';
+
export default {
+ backDrop: {
+ backgroundColor: WV_BACKGROUND
+ },
+
indicatorWrapper: {
alignItems: 'center',
backgroundColor: ColorPalette.white,
@@ -14,11 +20,7 @@ export default {
},
webView: {
+ backgroundColor: WV_BACKGROUND,
flex: 1
- },
-
- webViewWrapper: {
- flex: 1,
- flexDirection: 'column'
}
};
diff --git a/react/features/invite/constants.js b/react/features/invite/constants.js
index 61f686dd18..9108f769d9 100644
--- a/react/features/invite/constants.js
+++ b/react/features/invite/constants.js
@@ -1,3 +1,8 @@
+
+/**
+ * Modal ID for the DialInSummary modal.
+ */
+export const DIAL_IN_SUMMARY_VIEW_ID = 'DIAL_IN_SUMMARY_VIEW_ID';
/**
* The identifier of the sound to be played when the status of an outgoing call
* is expired.
diff --git a/react/features/invite/reducer.js b/react/features/invite/reducer.js
index 4e11f58918..e86e850e68 100644
--- a/react/features/invite/reducer.js
+++ b/react/features/invite/reducer.js
@@ -6,7 +6,6 @@ import {
ADD_PENDING_INVITE_REQUEST,
REMOVE_PENDING_INVITE_REQUESTS,
SET_CALLEE_INFO_VISIBLE,
- SET_DIAL_IN_SUMMARY_VISIBLE,
SET_INVITE_DIALOG_VISIBLE,
UPDATE_DIAL_IN_NUMBERS_FAILED,
UPDATE_DIAL_IN_NUMBERS_SUCCESS
@@ -50,11 +49,6 @@ ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
initialCalleeInfo: action.initialCalleeInfo
};
- case SET_DIAL_IN_SUMMARY_VISIBLE:
- return {
- ...state,
- summaryUrl: action.summaryUrl
- };
case SET_INVITE_DIALOG_VISIBLE:
return {
diff --git a/react/features/recent-list/components/RecentList.native.js b/react/features/recent-list/components/RecentList.native.js
index 5d5416115d..8434cf2376 100644
--- a/react/features/recent-list/components/RecentList.native.js
+++ b/react/features/recent-list/components/RecentList.native.js
@@ -5,10 +5,11 @@ import type { Dispatch } from 'redux';
import { getDefaultURL } from '../../app';
import { translate } from '../../base/i18n';
+import { setActiveModalId } from '../../base/modal';
import { NavigateSectionList, type Section } from '../../base/react';
import { connect } from '../../base/redux';
import { ColorPalette } from '../../base/styles';
-import { showDialInSummary } from '../../invite';
+import { DIAL_IN_SUMMARY_VIEW_ID } from '../../invite/constants';
import { deleteRecentListEntry } from '../actions';
import { isRecentListEnabled, toDisplayableList } from '../functions';
@@ -124,7 +125,7 @@ class RecentList extends AbstractRecentList<Props> {
* @returns {void}
*/
_onShowDialInInfo(itemId) {
- this.props.dispatch(showDialInSummary(itemId.url));
+ this.props.dispatch(setActiveModalId(DIAL_IN_SUMMARY_VIEW_ID, { summaryUrl: itemId.url }));
}
}