Procházet zdrojové kódy

WIP: Convert inline dialog to modal dialog

j8
Radium Zheng před 6 roky
rodič
revize
a277421ecb

+ 0
- 10
react/features/local-recording/actionTypes.js Zobrazit soubor

@@ -19,16 +19,6 @@ export const LOCAL_RECORDING_ENGAGED = Symbol('LOCAL_RECORDING_ENGAGED');
19 19
  */
20 20
 export const LOCAL_RECORDING_UNENGAGED = Symbol('LOCAL_RECORDING_UNENGAGED');
21 21
 
22
-/**
23
- * Action to show/hide {@code LocalRecordingInfoDialog}.
24
- *
25
- * {
26
- *     type: LOCAL_RECORDING_TOGGLE_DIALOG
27
- * }
28
- */
29
-export const LOCAL_RECORDING_TOGGLE_DIALOG
30
-    = Symbol('LOCAL_RECORDING_TOGGLE_DIALOG');
31
-
32 22
 /**
33 23
  * Action to update {@code LocalRecordingInfoDialog} with stats from all
34 24
  * clients.

+ 0
- 14
react/features/local-recording/actions.js Zobrazit soubor

@@ -3,7 +3,6 @@
3 3
 import {
4 4
     LOCAL_RECORDING_ENGAGED,
5 5
     LOCAL_RECORDING_UNENGAGED,
6
-    LOCAL_RECORDING_TOGGLE_DIALOG,
7 6
     LOCAL_RECORDING_STATS_UPDATE
8 7
 } from './actionTypes';
9 8
 
@@ -42,19 +41,6 @@ export function localRecordingUnengaged() {
42 41
     };
43 42
 }
44 43
 
45
-/**
46
- * Toggles the open/close state of {@code LocalRecordingInfoDialog}.
47
- *
48
- * @returns {{
49
- *     type: LOCAL_RECORDING_TOGGLE_DIALOG
50
- * }}
51
- */
52
-export function toggleLocalRecordingInfoDialog() {
53
-    return {
54
-        type: LOCAL_RECORDING_TOGGLE_DIALOG
55
-    };
56
-}
57
-
58 44
 /**
59 45
  * Updates the the local recording stats from each client,
60 46
  * to be displayed on {@code LocalRecordingInfoDialog}.

+ 6
- 19
react/features/local-recording/components/LocalRecordingButton.js Zobrazit soubor

@@ -1,13 +1,10 @@
1 1
 /* @flow */
2 2
 
3
-import InlineDialog from '@atlaskit/inline-dialog';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
7 6
 import { ToolbarButton } from '../../toolbox';
8 7
 
9
-import LocalRecordingInfoDialog from './LocalRecordingInfoDialog';
10
-
11 8
 /**
12 9
  * The type of the React {@code Component} state of
13 10
  * {@link LocalRecordingButton}.
@@ -64,22 +61,12 @@ class LocalRecordingButton extends Component<Props> {
64 61
                 ? 'icon-rec toggled' : 'icon-rec'}`;
65 62
 
66 63
         return (
67
-            <div className = 'toolbox-button-wth-dialog'>
68
-                <InlineDialog
69
-                    content = {
70
-                        <LocalRecordingInfoDialog />
71
-                    }
72
-                    isOpen = { isDialogShown }
73
-                    onClose = { this._onCloseDialog }
74
-                    position = { 'top right' }>
75
-                    <ToolbarButton
76
-                        accessibilityLabel
77
-                            = { t('toolbar.accessibilityLabel.localRecording') }
78
-                        iconName = { iconClasses }
79
-                        onClick = { this._onClick }
80
-                        tooltip = { t('localRecording.dialogTitle') } />
81
-                </InlineDialog>
82
-            </div>
64
+            <ToolbarButton
65
+                accessibilityLabel
66
+                    = { t('toolbar.accessibilityLabel.localRecording') }
67
+                iconName = { iconClasses }
68
+                onClick = { this._onClick }
69
+                tooltip = { t('localRecording.dialogTitle') } />
83 70
         );
84 71
     }
85 72
 

+ 24
- 18
react/features/local-recording/components/LocalRecordingInfoDialog.js Zobrazit soubor

@@ -4,6 +4,7 @@ import moment from 'moment';
4 4
 import React, { Component } from 'react';
5 5
 import { connect } from 'react-redux';
6 6
 
7
+import { Dialog } from '../../base/dialog';
7 8
 import { translate } from '../../base/i18n';
8 9
 import {
9 10
     PARTICIPANT_ROLE,
@@ -279,27 +280,32 @@ class LocalRecordingInfoDialog extends Component<Props, State> {
279 280
         }
280 281
 
281 282
         return (
282
-            <div>
283
-                <div>
284
-                    <span className = 'info-label'>
285
-                        {`${t('localRecording.participantStats')}:`}
286
-                    </span>
287
-                </div>
288
-                { this._renderStats() }
289
-                <div className = 'info-dialog-action-links'>
290
-                    <div className = 'info-dialog-action-link'>
291
-                        { isEngaged ? <a
292
-                            onClick = { this._onStop }>
293
-                            { t('localRecording.stop') }
294
-                        </a>
295
-                            : <a
296
-                                onClick = { this._onStart }>
297
-                                { t('localRecording.start') }
283
+            <Dialog
284
+                cancelTitleKey = { 'dialog.close' }
285
+                submitDisabled = { true }
286
+                titleKey = 'localRecording.dialogTitle'>
287
+                <div className = 'local-recording'>
288
+                    <div>
289
+                        <span className = 'info-label'>
290
+                            {`${t('localRecording.participantStats')}:`}
291
+                        </span>
292
+                    </div>
293
+                    { this._renderStats() }
294
+                    <div className = 'info-dialog-action-links'>
295
+                        <div className = 'info-dialog-action-link'>
296
+                            { isEngaged ? <a
297
+                                onClick = { this._onStop }>
298
+                                { t('localRecording.stop') }
298 299
                             </a>
299
-                        }
300
+                                : <a
301
+                                    onClick = { this._onStart }>
302
+                                    { t('localRecording.start') }
303
+                                </a>
304
+                            }
305
+                        </div>
300 306
                     </div>
301 307
                 </div>
302
-            </div>
308
+            </Dialog>
303 309
         );
304 310
     }
305 311
 

+ 3
- 0
react/features/local-recording/components/index.js Zobrazit soubor

@@ -1 +1,4 @@
1 1
 export { default as LocalRecordingButton } from './LocalRecordingButton';
2
+export {
3
+    default as LocalRecordingInfoDialog
4
+} from './LocalRecordingInfoDialog';

+ 0
- 7
react/features/local-recording/reducer.js Zobrazit soubor

@@ -4,7 +4,6 @@ import { ReducerRegistry } from '../base/redux';
4 4
 import {
5 5
     LOCAL_RECORDING_ENGAGED,
6 6
     LOCAL_RECORDING_STATS_UPDATE,
7
-    LOCAL_RECORDING_TOGGLE_DIALOG,
8 7
     LOCAL_RECORDING_UNENGAGED
9 8
 } from './actionTypes';
10 9
 import { recordingController } from './controller';
@@ -25,12 +24,6 @@ ReducerRegistry.register('features/local-recording', (state = {}, action) => {
25 24
             isEngaged: false,
26 25
             recordingEngagedAt: null
27 26
         };
28
-    case LOCAL_RECORDING_TOGGLE_DIALOG:
29
-        return {
30
-            ...state,
31
-            showDialog: state.showDialog === undefined
32
-                || state.showDialog === false
33
-        };
34 27
     case LOCAL_RECORDING_STATS_UPDATE:
35 28
         return {
36 29
             ...state,

+ 3
- 3
react/features/toolbox/components/web/Toolbox.js Zobrazit soubor

@@ -29,8 +29,8 @@ import {
29 29
 } from '../../../invite';
30 30
 import { openKeyboardShortcutsDialog } from '../../../keyboard-shortcuts';
31 31
 import {
32
-    toggleLocalRecordingInfoDialog,
33
-    LocalRecordingButton
32
+    LocalRecordingButton,
33
+    LocalRecordingInfoDialog
34 34
 } from '../../../local-recording';
35 35
 import {
36 36
     LiveStreamButton,
@@ -873,7 +873,7 @@ class Toolbox extends Component<Props> {
873 873
      * @returns {void}
874 874
      */
875 875
     _onToolbarToggleLocalRecordingInfoDialog() {
876
-        this.props.dispatch(toggleLocalRecordingInfoDialog());
876
+        this.props.dispatch(openDialog(LocalRecordingInfoDialog));
877 877
     }
878 878
 
879 879
     /**

Načítá se…
Zrušit
Uložit