瀏覽代碼

fix(authentication): removed cancel event from overlay effect (#9274)

* fix(authentication) resolved #9263 issue

* fix(authentication) hide dialog close icon

* fix(authentication) fixed lint error about missing prop
j8
Calinteodor 3 年之前
父節點
當前提交
c4677be87a
沒有連結到貢獻者的電子郵件帳戶。

+ 13
- 2
react/features/authentication/components/web/LoginDialog.js 查看文件

@@ -10,7 +10,10 @@ import { Dialog } from '../../../base/dialog';
10 10
 import { translate, translateToHTML } from '../../../base/i18n';
11 11
 import { JitsiConnectionErrors } from '../../../base/lib-jitsi-meet';
12 12
 import { connect as reduxConnect } from '../../../base/redux';
13
-import { authenticateAndUpgradeRole, cancelLogin } from '../../actions.web';
13
+import {
14
+    authenticateAndUpgradeRole,
15
+    cancelLogin
16
+} from '../../actions.web';
14 17
 
15 18
 /**
16 19
  * The type of the React {@code Component} props of {@link LoginDialog}.
@@ -121,8 +124,15 @@ class LoginDialog extends Component<Props, State> {
121 124
      */
122 125
     _onCancelLogin() {
123 126
         const { dispatch } = this.props;
127
+        const cancelButton = document.getElementById('modal-dialog-cancel-button');
124 128
 
125
-        dispatch(cancelLogin());
129
+        if (cancelButton) {
130
+            cancelButton.onclick = () => {
131
+                dispatch(cancelLogin());
132
+            };
133
+        }
134
+
135
+        return false;
126 136
     }
127 137
 
128 138
     _onLogin: () => void;
@@ -242,6 +252,7 @@ class LoginDialog extends Component<Props, State> {
242 252
 
243 253
         return (
244 254
             <Dialog
255
+                hideCloseIconButton = { true }
245 256
                 okDisabled = {
246 257
                     connecting
247 258
                     || loginStarted

+ 9
- 1
react/features/authentication/components/web/WaitForOwnerDialog.js 查看文件

@@ -63,8 +63,15 @@ class WaitForOwnerDialog extends PureComponent<Props> {
63 63
      */
64 64
     _onCancelWaitForOwner() {
65 65
         const { dispatch } = this.props;
66
+        const cancelButton = document.getElementById('modal-dialog-cancel-button');
66 67
 
67
-        dispatch(cancelWaitForOwner());
68
+        if (cancelButton) {
69
+            cancelButton.onclick = () => {
70
+                dispatch(cancelWaitForOwner());
71
+            };
72
+        }
73
+
74
+        return false;
68 75
     }
69 76
 
70 77
     _onIAmHost: () => void;
@@ -94,6 +101,7 @@ class WaitForOwnerDialog extends PureComponent<Props> {
94 101
 
95 102
         return (
96 103
             <Dialog
104
+                hideCloseIconButton = { true }
97 105
                 okKey = { t('dialog.IamHost') }
98 106
                 onCancel = { this._onCancelWaitForOwner }
99 107
                 onSubmit = { this._onIAmHost }

+ 7
- 3
react/features/base/dialog/components/web/ModalHeader.js 查看文件

@@ -30,6 +30,7 @@ type Props = {
30 30
     id: string,
31 31
     appearance?: 'danger' | 'warning',
32 32
     heading: string,
33
+    hideCloseIconButton: boolean,
33 34
     onClose: Function,
34 35
     showKeyline: boolean,
35 36
     isHeadingMultiline: boolean,
@@ -60,6 +61,7 @@ export default class ModalHeader extends React.Component<Props> {
60 61
             id,
61 62
             appearance,
62 63
             heading,
64
+            hideCloseIconButton,
63 65
             onClose,
64 66
             showKeyline,
65 67
             isHeadingMultiline,
@@ -81,9 +83,11 @@ export default class ModalHeader extends React.Component<Props> {
81 83
                         {heading}
82 84
                     </TitleText>
83 85
                 </Title>
84
-                <Icon
85
-                    onClick = { onClose }
86
-                    src = { IconClose } />
86
+                {
87
+                    !hideCloseIconButton && <Icon
88
+                        onClick = { onClose }
89
+                        src = { IconClose } />
90
+                }
87 91
             </Header>
88 92
         );
89 93
     }

+ 12
- 1
react/features/base/dialog/components/web/StatelessDialog.js 查看文件

@@ -53,6 +53,11 @@ type Props = {
53 53
      */
54 54
     hideCancelButton: boolean,
55 55
 
56
+    /**
57
+     * If true, the close icon button will not be displayed.
58
+     */
59
+    hideCloseIconButton: boolean,
60
+
56 61
     /**
57 62
      * If true, no footer will be displayed.
58 63
      */
@@ -90,6 +95,10 @@ type Props = {
90 95
  * Web dialog that uses atlaskit modal-dialog to display dialogs.
91 96
  */
92 97
 class StatelessDialog extends Component<Props> {
98
+    static defaultProps = {
99
+        hideCloseIconButton: false
100
+    };
101
+
93 102
     /**
94 103
      * The functional component to be used for rendering the modal footer.
95 104
      */
@@ -125,6 +134,7 @@ class StatelessDialog extends Component<Props> {
125 134
         const {
126 135
             customHeader,
127 136
             children,
137
+            hideCloseIconButton,
128 138
             t /* The following fixes a flow error: */ = _.identity,
129 139
             titleString,
130 140
             titleKey,
@@ -138,7 +148,8 @@ class StatelessDialog extends Component<Props> {
138 148
                     Header: customHeader ? customHeader : props => (
139 149
                         <ModalHeader
140 150
                             { ...props }
141
-                            heading = { titleString || t(titleKey) } />
151
+                            heading = { titleString || t(titleKey) }
152
+                            hideCloseIconButton = { hideCloseIconButton } />
142 153
                     )
143 154
                 }}
144 155
                 footer = { this._renderFooter }

Loading…
取消
儲存