瀏覽代碼

ref(password-required) Update component to use new Dialog (#12900)

Convert component to TS
factor2
Robert Pintilii 2 年之前
父節點
當前提交
533deea5fd
No account linked to committer's email address

+ 2
- 1
react/features/base/dialog/middleware.web.ts 查看文件

21
 import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog';
21
 import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog';
22
 // @ts-ignore
22
 // @ts-ignore
23
 import RemoteControlAuthorizationDialog from '../../remote-control/components/RemoteControlAuthorizationDialog';
23
 import RemoteControlAuthorizationDialog from '../../remote-control/components/RemoteControlAuthorizationDialog';
24
+import PasswordRequiredPrompt from '../../room-lock/components/PasswordRequiredPrompt.web';
24
 import SalesforceLinkDialog from '../../salesforce/components/web/SalesforceLinkDialog';
25
 import SalesforceLinkDialog from '../../salesforce/components/web/SalesforceLinkDialog';
25
 import ShareAudioDialog from '../../screen-share/components/web/ShareAudioDialog';
26
 import ShareAudioDialog from '../../screen-share/components/web/ShareAudioDialog';
26
 import ShareScreenWarningDialog from '../../screen-share/components/web/ShareScreenWarningDialog';
27
 import ShareScreenWarningDialog from '../../screen-share/components/web/ShareScreenWarningDialog';
50
     SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog,
51
     SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog,
51
     GrantModeratorDialog, KickRemoteParticipantDialog, MuteRemoteParticipantsVideoDialog, VideoQualityDialog,
52
     GrantModeratorDialog, KickRemoteParticipantDialog, MuteRemoteParticipantsVideoDialog, VideoQualityDialog,
52
     VirtualBackgroundDialog, LoginDialog, WaitForOwnerDialog, DesktopPicker, RemoteControlAuthorizationDialog,
53
     VirtualBackgroundDialog, LoginDialog, WaitForOwnerDialog, DesktopPicker, RemoteControlAuthorizationDialog,
53
-    LogoutDialog, SalesforceLinkDialog, ParticipantVerificationDialog ];
54
+    LogoutDialog, SalesforceLinkDialog, ParticipantVerificationDialog, PasswordRequiredPrompt ];
54
 
55
 
55
 // This function is necessary while the transition from @atlaskit dialog to our component is ongoing.
56
 // This function is necessary while the transition from @atlaskit dialog to our component is ongoing.
56
 const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component);
57
 const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component);

react/features/room-lock/components/PasswordRequiredPrompt.web.js → react/features/room-lock/components/PasswordRequiredPrompt.web.tsx 查看文件

1
-// @flow
2
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
3
-import type { Dispatch } from 'redux';
4
-
5
-import { setPassword } from '../../base/conference';
6
-import { Dialog } from '../../base/dialog';
7
-import { translate } from '../../base/i18n';
8
-import { connect } from '../../base/redux';
2
+import { WithTranslation } from 'react-i18next';
3
+import { connect } from 'react-redux';
4
+
5
+import { IStore } from '../../app/types';
6
+import { setPassword } from '../../base/conference/actions';
7
+import { IJitsiConference } from '../../base/conference/reducer';
8
+import { translate } from '../../base/i18n/functions';
9
+import Dialog from '../../base/ui/components/web/Dialog';
9
 import Input from '../../base/ui/components/web/Input';
10
 import Input from '../../base/ui/components/web/Input';
10
 import { _cancelPasswordRequiredPrompt } from '../actions';
11
 import { _cancelPasswordRequiredPrompt } from '../actions';
11
 
12
 
13
  * The type of the React {@code Component} props of
14
  * The type of the React {@code Component} props of
14
  * {@link PasswordRequiredPrompt}.
15
  * {@link PasswordRequiredPrompt}.
15
  */
16
  */
16
-type Props = {
17
+interface IProps extends WithTranslation {
17
 
18
 
18
     /**
19
     /**
19
      * The JitsiConference which requires a password.
20
      * The JitsiConference which requires a password.
20
      */
21
      */
21
-    conference: Object,
22
+    conference: IJitsiConference;
22
 
23
 
23
     /**
24
     /**
24
      * The redux store's {@code dispatch} function.
25
      * The redux store's {@code dispatch} function.
25
      */
26
      */
26
-    dispatch: Dispatch<any>,
27
-
28
-    /**
29
-     * The translate function.
30
-     */
31
-    t: Function
32
-};
27
+    dispatch: IStore['dispatch'];
28
+}
33
 
29
 
34
 /**
30
 /**
35
  * The type of the React {@code Component} state of
31
  * The type of the React {@code Component} state of
40
     /**
36
     /**
41
      * The password entered by the local participant.
37
      * The password entered by the local participant.
42
      */
38
      */
43
-    password: string
44
-}
39
+    password?: string;
40
+};
45
 
41
 
46
 /**
42
 /**
47
  * Implements a React Component which prompts the user when a password is
43
  * Implements a React Component which prompts the user when a password is
48
  * required to join a conference.
44
  * required to join a conference.
49
  */
45
  */
50
-class PasswordRequiredPrompt extends Component<Props, State> {
46
+class PasswordRequiredPrompt extends Component<IProps, State> {
51
     state = {
47
     state = {
52
         password: ''
48
         password: ''
53
     };
49
     };
58
      * @param {Object} props - The read-only properties with which the new
54
      * @param {Object} props - The read-only properties with which the new
59
      * instance is to be initialized.
55
      * instance is to be initialized.
60
      */
56
      */
61
-    constructor(props: Props) {
57
+    constructor(props: IProps) {
62
         super(props);
58
         super(props);
63
 
59
 
64
         // Bind event handlers so they are only bound once per instance.
60
         // Bind event handlers so they are only bound once per instance.
76
     render() {
72
     render() {
77
         return (
73
         return (
78
             <Dialog
74
             <Dialog
79
-                disableBlanketClickDismiss = { true }
80
-                isModal = { false }
75
+                disableBackdropClose = { true }
81
                 onCancel = { this._onCancel }
76
                 onCancel = { this._onCancel }
82
                 onSubmit = { this._onSubmit }
77
                 onSubmit = { this._onSubmit }
83
-                titleKey = 'dialog.passwordRequired'
84
-                width = 'small'>
78
+                titleKey = 'dialog.passwordRequired'>
85
                 { this._renderBody() }
79
                 { this._renderBody() }
86
             </Dialog>
80
             </Dialog>
87
         );
81
         );
98
             <div>
92
             <div>
99
                 <Input
93
                 <Input
100
                     autoFocus = { true }
94
                     autoFocus = { true }
95
+                    className = 'dialog-bottom-margin'
101
                     label = { this.props.t('dialog.passwordLabel') }
96
                     label = { this.props.t('dialog.passwordLabel') }
102
                     name = 'lockKey'
97
                     name = 'lockKey'
103
                     onChange = { this._onPasswordChanged }
98
                     onChange = { this._onPasswordChanged }
107
         );
102
         );
108
     }
103
     }
109
 
104
 
110
-    _onPasswordChanged: ({ target: { value: * }}) => void;
111
-
112
     /**
105
     /**
113
      * Notifies this dialog that password has changed.
106
      * Notifies this dialog that password has changed.
114
      *
107
      *
122
         });
115
         });
123
     }
116
     }
124
 
117
 
125
-    _onCancel: () => boolean;
126
-
127
     /**
118
     /**
128
      * Dispatches action to cancel and dismiss this dialog.
119
      * Dispatches action to cancel and dismiss this dialog.
129
      *
120
      *
138
         return true;
129
         return true;
139
     }
130
     }
140
 
131
 
141
-    _onSubmit: () => boolean;
142
-
143
     /**
132
     /**
144
      * Dispatches action to submit value from this dialog.
133
      * Dispatches action to submit value from this dialog.
145
      *
134
      *

Loading…
取消
儲存