From 0c2e13a453cbe473364e100972802ad7a39d71f6 Mon Sep 17 00:00:00 2001 From: Bettenbuk Zoltan Date: Mon, 6 Apr 2020 17:25:30 +0200 Subject: [PATCH] ref: DialInSummary to JitsiModal --- react/features/invite/actionTypes.js | 9 --- react/features/invite/actions.any.js | 25 ------- .../dial-in-summary/native/DialInSummary.js | 65 ++++++------------- .../dial-in-summary/native/styles.js | 12 ++-- react/features/invite/constants.js | 5 ++ react/features/invite/reducer.js | 6 -- .../components/RecentList.native.js | 5 +- 7 files changed, 36 insertions(+), 91 deletions(-) diff --git a/react/features/invite/actionTypes.js b/react/features/invite/actionTypes.js index 7481da176..05841bf6f 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 1086dc90b..0f51301aa 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 e9f4cdb85..82d0c81e2 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 { 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 { const { _summaryUrl } = this.props; return ( - - - - - - + + + ); } - _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 { * @returns {void} */ _onError() { - this.props.dispatch(hideDialInSummary()); + this.props.dispatch(setActiveModalId()); this.props.dispatch(openDialog(DialInSummaryErrorDialog)); } @@ -122,7 +98,8 @@ class DialInSummary extends Component { 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 { */ 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 3d76db05a..9bfcaa56b 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 61f686dd1..9108f769d 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 4e11f5891..e86e850e6 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 5d5416115..8434cf237 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 { * @returns {void} */ _onShowDialInInfo(itemId) { - this.props.dispatch(showDialInSummary(itemId.url)); + this.props.dispatch(setActiveModalId(DIAL_IN_SUMMARY_VIEW_ID, { summaryUrl: itemId.url })); } }