From a277421ecb032d205ab9d069bb45c28abc43e28e Mon Sep 17 00:00:00 2001 From: Radium Zheng Date: Wed, 18 Jul 2018 10:30:54 +1000 Subject: [PATCH] WIP: Convert inline dialog to modal dialog --- react/features/local-recording/actionTypes.js | 10 ----- react/features/local-recording/actions.js | 14 ------- .../components/LocalRecordingButton.js | 25 +++-------- .../components/LocalRecordingInfoDialog.js | 42 +++++++++++-------- .../local-recording/components/index.js | 3 ++ react/features/local-recording/reducer.js | 7 ---- .../toolbox/components/web/Toolbox.js | 6 +-- 7 files changed, 36 insertions(+), 71 deletions(-) diff --git a/react/features/local-recording/actionTypes.js b/react/features/local-recording/actionTypes.js index c154100ff..fffcac5a2 100644 --- a/react/features/local-recording/actionTypes.js +++ b/react/features/local-recording/actionTypes.js @@ -19,16 +19,6 @@ export const LOCAL_RECORDING_ENGAGED = Symbol('LOCAL_RECORDING_ENGAGED'); */ export const LOCAL_RECORDING_UNENGAGED = Symbol('LOCAL_RECORDING_UNENGAGED'); -/** - * Action to show/hide {@code LocalRecordingInfoDialog}. - * - * { - * type: LOCAL_RECORDING_TOGGLE_DIALOG - * } - */ -export const LOCAL_RECORDING_TOGGLE_DIALOG - = Symbol('LOCAL_RECORDING_TOGGLE_DIALOG'); - /** * Action to update {@code LocalRecordingInfoDialog} with stats from all * clients. diff --git a/react/features/local-recording/actions.js b/react/features/local-recording/actions.js index 8f184dbc3..eee9f509b 100644 --- a/react/features/local-recording/actions.js +++ b/react/features/local-recording/actions.js @@ -3,7 +3,6 @@ import { LOCAL_RECORDING_ENGAGED, LOCAL_RECORDING_UNENGAGED, - LOCAL_RECORDING_TOGGLE_DIALOG, LOCAL_RECORDING_STATS_UPDATE } from './actionTypes'; @@ -42,19 +41,6 @@ export function localRecordingUnengaged() { }; } -/** - * Toggles the open/close state of {@code LocalRecordingInfoDialog}. - * - * @returns {{ - * type: LOCAL_RECORDING_TOGGLE_DIALOG - * }} - */ -export function toggleLocalRecordingInfoDialog() { - return { - type: LOCAL_RECORDING_TOGGLE_DIALOG - }; -} - /** * Updates the the local recording stats from each client, * to be displayed on {@code LocalRecordingInfoDialog}. diff --git a/react/features/local-recording/components/LocalRecordingButton.js b/react/features/local-recording/components/LocalRecordingButton.js index 6e8ec2dab..a10b7547c 100644 --- a/react/features/local-recording/components/LocalRecordingButton.js +++ b/react/features/local-recording/components/LocalRecordingButton.js @@ -1,13 +1,10 @@ /* @flow */ -import InlineDialog from '@atlaskit/inline-dialog'; import React, { Component } from 'react'; import { translate } from '../../base/i18n'; import { ToolbarButton } from '../../toolbox'; -import LocalRecordingInfoDialog from './LocalRecordingInfoDialog'; - /** * The type of the React {@code Component} state of * {@link LocalRecordingButton}. @@ -64,22 +61,12 @@ class LocalRecordingButton extends Component { ? 'icon-rec toggled' : 'icon-rec'}`; return ( -
- - } - isOpen = { isDialogShown } - onClose = { this._onCloseDialog } - position = { 'top right' }> - - -
+ ); } diff --git a/react/features/local-recording/components/LocalRecordingInfoDialog.js b/react/features/local-recording/components/LocalRecordingInfoDialog.js index 828d226cf..0a6a15390 100644 --- a/react/features/local-recording/components/LocalRecordingInfoDialog.js +++ b/react/features/local-recording/components/LocalRecordingInfoDialog.js @@ -4,6 +4,7 @@ import moment from 'moment'; import React, { Component } from 'react'; import { connect } from 'react-redux'; +import { Dialog } from '../../base/dialog'; import { translate } from '../../base/i18n'; import { PARTICIPANT_ROLE, @@ -279,27 +280,32 @@ class LocalRecordingInfoDialog extends Component { } return ( -
-
- - {`${t('localRecording.participantStats')}:`} - -
- { this._renderStats() } -
- + ); } diff --git a/react/features/local-recording/components/index.js b/react/features/local-recording/components/index.js index 635a59d0a..d1a07a50b 100644 --- a/react/features/local-recording/components/index.js +++ b/react/features/local-recording/components/index.js @@ -1 +1,4 @@ export { default as LocalRecordingButton } from './LocalRecordingButton'; +export { + default as LocalRecordingInfoDialog +} from './LocalRecordingInfoDialog'; diff --git a/react/features/local-recording/reducer.js b/react/features/local-recording/reducer.js index 619590320..c6447c7bb 100644 --- a/react/features/local-recording/reducer.js +++ b/react/features/local-recording/reducer.js @@ -4,7 +4,6 @@ import { ReducerRegistry } from '../base/redux'; import { LOCAL_RECORDING_ENGAGED, LOCAL_RECORDING_STATS_UPDATE, - LOCAL_RECORDING_TOGGLE_DIALOG, LOCAL_RECORDING_UNENGAGED } from './actionTypes'; import { recordingController } from './controller'; @@ -25,12 +24,6 @@ ReducerRegistry.register('features/local-recording', (state = {}, action) => { isEngaged: false, recordingEngagedAt: null }; - case LOCAL_RECORDING_TOGGLE_DIALOG: - return { - ...state, - showDialog: state.showDialog === undefined - || state.showDialog === false - }; case LOCAL_RECORDING_STATS_UPDATE: return { ...state, diff --git a/react/features/toolbox/components/web/Toolbox.js b/react/features/toolbox/components/web/Toolbox.js index 5dfca6513..7b20341df 100644 --- a/react/features/toolbox/components/web/Toolbox.js +++ b/react/features/toolbox/components/web/Toolbox.js @@ -29,8 +29,8 @@ import { } from '../../../invite'; import { openKeyboardShortcutsDialog } from '../../../keyboard-shortcuts'; import { - toggleLocalRecordingInfoDialog, - LocalRecordingButton + LocalRecordingButton, + LocalRecordingInfoDialog } from '../../../local-recording'; import { LiveStreamButton, @@ -873,7 +873,7 @@ class Toolbox extends Component { * @returns {void} */ _onToolbarToggleLocalRecordingInfoDialog() { - this.props.dispatch(toggleLocalRecordingInfoDialog()); + this.props.dispatch(openDialog(LocalRecordingInfoDialog)); } /**