Browse Source

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 years ago
parent
commit
c4677be87a
No account linked to committer's email address

+ 13
- 2
react/features/authentication/components/web/LoginDialog.js View File

10
 import { translate, translateToHTML } from '../../../base/i18n';
10
 import { translate, translateToHTML } from '../../../base/i18n';
11
 import { JitsiConnectionErrors } from '../../../base/lib-jitsi-meet';
11
 import { JitsiConnectionErrors } from '../../../base/lib-jitsi-meet';
12
 import { connect as reduxConnect } from '../../../base/redux';
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
  * The type of the React {@code Component} props of {@link LoginDialog}.
19
  * The type of the React {@code Component} props of {@link LoginDialog}.
121
      */
124
      */
122
     _onCancelLogin() {
125
     _onCancelLogin() {
123
         const { dispatch } = this.props;
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
     _onLogin: () => void;
138
     _onLogin: () => void;
242
 
252
 
243
         return (
253
         return (
244
             <Dialog
254
             <Dialog
255
+                hideCloseIconButton = { true }
245
                 okDisabled = {
256
                 okDisabled = {
246
                     connecting
257
                     connecting
247
                     || loginStarted
258
                     || loginStarted

+ 9
- 1
react/features/authentication/components/web/WaitForOwnerDialog.js View File

63
      */
63
      */
64
     _onCancelWaitForOwner() {
64
     _onCancelWaitForOwner() {
65
         const { dispatch } = this.props;
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
     _onIAmHost: () => void;
77
     _onIAmHost: () => void;
94
 
101
 
95
         return (
102
         return (
96
             <Dialog
103
             <Dialog
104
+                hideCloseIconButton = { true }
97
                 okKey = { t('dialog.IamHost') }
105
                 okKey = { t('dialog.IamHost') }
98
                 onCancel = { this._onCancelWaitForOwner }
106
                 onCancel = { this._onCancelWaitForOwner }
99
                 onSubmit = { this._onIAmHost }
107
                 onSubmit = { this._onIAmHost }

+ 7
- 3
react/features/base/dialog/components/web/ModalHeader.js View File

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

+ 12
- 1
react/features/base/dialog/components/web/StatelessDialog.js View File

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

Loading…
Cancel
Save