Przeglądaj źródła

ref(prejoin) Refactor styles (#13187)

Move styles from SCSS to JSS
Convert class to function component
factor2
Robert Pintilii 2 lat temu
rodzic
commit
5a64bd76fb
No account linked to committer's email address

+ 23
- 0
css/premeeting/_lobby.scss Wyświetl plik

@@ -208,3 +208,26 @@
208 208
 .lobby-button-margin {
209 209
     margin-bottom: 16px;
210 210
 }
211
+
212
+.lobby-prejoin-error {
213
+    background-color: #E04757;
214
+    border-radius: 6px;
215
+    box-sizing: border-box;
216
+    color: white;
217
+    font-size: 12px;
218
+    line-height: 16px;
219
+    margin-bottom: 16px;
220
+    margin-top: -8px;
221
+    padding: 4px;
222
+    text-align: center;
223
+    width: 100%;
224
+}
225
+
226
+.lobby-prejoin-input {
227
+    margin-bottom: 16px;
228
+    width: 100%;
229
+
230
+    & input {
231
+        text-align: center;
232
+    }
233
+}

+ 0
- 1
css/premeeting/_main.scss Wyświetl plik

@@ -1,4 +1,3 @@
1 1
 @import 'lobby';
2 2
 @import 'premeeting-screens';
3
-@import 'prejoin';
4 3
 @import 'prejoin-third-party';

+ 0
- 73
css/premeeting/_prejoin.scss Wyświetl plik

@@ -1,73 +0,0 @@
1
-.prejoin {
2
-    &-input-area {
3
-        width: 100%;
4
-    }
5
-
6
-    &-avatar {
7
-        margin: 8px auto 16px;
8
-
9
-        &-name {
10
-            color: white;
11
-            font-size: 16px;
12
-            font-weight: 600;
13
-            line-height: 26px;
14
-            margin-bottom: 32px;
15
-            text-align: center;
16
-        }
17
-
18
-        &-container {
19
-            align-items: center;
20
-            display: flex;
21
-            flex-direction: column;
22
-        }
23
-    }
24
-
25
-    &-error {
26
-        background-color: #E04757;
27
-        border-radius: 6px;
28
-        box-sizing: border-box;
29
-        color: white;
30
-        font-size: 12px;
31
-        line-height: 16px;
32
-        margin-bottom: 16px;
33
-        margin-top: -8px;
34
-        padding: 4px;
35
-        text-align: center;
36
-        width: 100%;
37
-    }
38
-}
39
-
40
-.prejoin-preview {
41
-    &-dropdown-btns {
42
-        padding: 8px 0;
43
-        width: 300px;
44
-        background-color: #E0E0E0;
45
-        border-radius: 3px;
46
-        position: relative;
47
-        top: -16px;
48
-    }
49
-
50
-    &-dropdown-container {
51
-        position: relative;
52
-        width: 100%;
53
-
54
-        /**
55
-        * Override default InlineDialog behaviour, since it does not play nicely with relative widths
56
-        */
57
-        & > div:nth-child(2) {
58
-            background: #E0E0E0;
59
-            padding: 0;
60
-            position: absolute !important;
61
-            width: 100%;
62
-        }
63
-    }
64
-}
65
-
66
-.prejoin-input {
67
-    margin-bottom: 16px;
68
-    width: 100%;
69
-
70
-    & input {
71
-        text-align: center;
72
-    }
73
-}

+ 3
- 3
react/features/lobby/components/web/LobbyScreen.js Wyświetl plik

@@ -187,7 +187,7 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
187 187
 
188 188
         return (
189 189
             <Input
190
-                className = 'prejoin-input'
190
+                className = 'lobby-prejoin-input'
191 191
                 onChange = { this._onChangeDisplayName }
192 192
                 placeholder = { t('lobby.nameField') }
193 193
                 testId = 'lobby.nameField'
@@ -206,7 +206,7 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
206 206
         return (
207 207
             <>
208 208
                 <Input
209
-                    className = { `prejoin-input ${_passwordJoinFailed ? 'error' : ''}` }
209
+                    className = { `lobby-prejoin-input ${_passwordJoinFailed ? 'error' : ''}` }
210 210
                     onChange = { this._onChangePassword }
211 211
                     placeholder = { t('lobby.passwordField') }
212 212
                     testId = 'lobby.password'
@@ -214,7 +214,7 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
214 214
                     value = { this.state.password } />
215 215
 
216 216
                 {_passwordJoinFailed && <div
217
-                    className = 'prejoin-error'
217
+                    className = 'lobby-prejoin-error'
218 218
                     data-testid = 'lobby.errorMessage'>{t('lobby.invalidPassword')}</div>}
219 219
             </>
220 220
         );

+ 210
- 197
react/features/prejoin/components/web/Prejoin.tsx Wyświetl plik

@@ -1,11 +1,12 @@
1
-import React, { Component } from 'react';
2
-import { WithTranslation } from 'react-i18next';
1
+/* eslint-disable react/jsx-no-bind */
2
+import React, { useRef, useState } from 'react';
3
+import { useTranslation } from 'react-i18next';
3 4
 import { connect } from 'react-redux';
5
+import { makeStyles } from 'tss-react/mui';
4 6
 
5 7
 import { IReduxState } from '../../../app/types';
6 8
 import Avatar from '../../../base/avatar/components/Avatar';
7 9
 import { isNameReadOnly } from '../../../base/config/functions.web';
8
-import { translate } from '../../../base/i18n/functions';
9 10
 import { IconArrowDown, IconArrowUp, IconPhoneRinging, IconVolumeOff } from '../../../base/icons/svg';
10 11
 import { isVideoMutedByUser } from '../../../base/media/functions';
11 12
 import { getLocalParticipant } from '../../../base/participants/functions';
@@ -14,6 +15,7 @@ import ActionButton from '../../../base/premeeting/components/web/ActionButton';
14 15
 import PreMeetingScreen from '../../../base/premeeting/components/web/PreMeetingScreen';
15 16
 import { updateSettings } from '../../../base/settings/actions';
16 17
 import { getDisplayName } from '../../../base/settings/functions.web';
18
+import { withPixelLineHeight } from '../../../base/styles/functions.web';
17 19
 import { getLocalJitsiVideoTrack } from '../../../base/tracks/functions.web';
18 20
 import Button from '../../../base/ui/components/web/Button';
19 21
 import Input from '../../../base/ui/components/web/Input';
@@ -33,7 +35,7 @@ import {
33 35
 
34 36
 import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
35 37
 
36
-interface IProps extends WithTranslation {
38
+interface IProps {
37 39
 
38 40
     /**
39 41
      * Indicates whether the display  name is editable.
@@ -116,45 +118,90 @@ interface IProps extends WithTranslation {
116 118
     videoTrack?: Object;
117 119
 }
118 120
 
119
-interface IState {
120
-
121
-    /**
122
-     * Flag controlling the visibility of the 'join by phone' buttons.
123
-     */
124
-    showJoinByPhoneButtons: boolean;
125
-}
126
-
127
-/**
128
- * This component is displayed before joining a meeting.
129
- */
130
-class Prejoin extends Component<IProps, IState> {
131
-    showDisplayNameField: boolean;
132
-
133
-    /**
134
-     * Initializes a new {@code Prejoin} instance.
135
-     *
136
-     * @inheritdoc
137
-     */
138
-    constructor(props: IProps) {
139
-        super(props);
140
-
141
-        this.state = {
142
-            showJoinByPhoneButtons: false
143
-        };
144
-
145
-        this._closeDialog = this._closeDialog.bind(this);
146
-        this._showDialog = this._showDialog.bind(this);
147
-        this._onJoinButtonClick = this._onJoinButtonClick.bind(this);
148
-        this._onDropdownClose = this._onDropdownClose.bind(this);
149
-        this._onOptionsClick = this._onOptionsClick.bind(this);
150
-        this._setName = this._setName.bind(this);
151
-        this._onJoinConferenceWithoutAudioKeyPress = this._onJoinConferenceWithoutAudioKeyPress.bind(this);
152
-        this._showDialogKeyPress = this._showDialogKeyPress.bind(this);
153
-        this._getExtraJoinButtons = this._getExtraJoinButtons.bind(this);
154
-        this._onInputKeyPress = this._onInputKeyPress.bind(this);
155
-
156
-        this.showDisplayNameField = props.canEditDisplayName || props.showErrorOnJoin;
157
-    }
121
+const useStyles = makeStyles()(theme => {
122
+    return {
123
+        inputContainer: {
124
+            width: '100%'
125
+        },
126
+
127
+        input: {
128
+            width: '100%',
129
+            marginBottom: theme.spacing(3),
130
+
131
+            '& input': {
132
+                textAlign: 'center'
133
+            }
134
+        },
135
+
136
+        avatarContainer: {
137
+            display: 'flex',
138
+            alignItems: 'center',
139
+            flexDirection: 'column'
140
+        },
141
+
142
+        avatar: {
143
+            margin: `${theme.spacing(2)} auto ${theme.spacing(3)}`
144
+        },
145
+
146
+        avatarName: {
147
+            ...withPixelLineHeight(theme.typography.bodyShortBoldLarge),
148
+            color: theme.palette.text01,
149
+            marginBottom: theme.spacing(5),
150
+            textAlign: 'center'
151
+        },
152
+
153
+        error: {
154
+            backgroundColor: theme.palette.actionDanger,
155
+            color: theme.palette.text01,
156
+            borderRadius: theme.shape.borderRadius,
157
+            width: '100%',
158
+            ...withPixelLineHeight(theme.typography.labelRegular),
159
+            boxSizing: 'border-box',
160
+            padding: theme.spacing(1),
161
+            textAlign: 'center',
162
+            marginTop: `-${theme.spacing(2)}`,
163
+            marginBottom: theme.spacing(3)
164
+        },
165
+
166
+        dropdownContainer: {
167
+            position: 'relative',
168
+            width: '100%'
169
+        },
170
+
171
+        dropdownButtons: {
172
+            width: '300px',
173
+            padding: '8px 0',
174
+            backgroundColor: theme.palette.action02,
175
+            color: theme.palette.text04,
176
+            borderRadius: theme.shape.borderRadius,
177
+            position: 'relative',
178
+            top: `-${theme.spacing(3)}`
179
+        }
180
+    };
181
+});
182
+
183
+const Prejoin = ({
184
+    canEditDisplayName,
185
+    deviceStatusVisible,
186
+    hasJoinByPhoneButton,
187
+    joinConference,
188
+    joinConferenceWithoutAudio,
189
+    joiningInProgress,
190
+    name,
191
+    participantId,
192
+    prejoinConfig,
193
+    readOnlyName,
194
+    setJoinByPhoneDialogVisiblity,
195
+    showCameraPreview,
196
+    showDialog,
197
+    showErrorOnJoin,
198
+    updateSettings: dispatchUpdateSettings,
199
+    videoTrack
200
+}: IProps) => {
201
+    const showDisplayNameField = useRef(canEditDisplayName || showErrorOnJoin);
202
+    const [ showJoinByPhoneButtons, setShowJoinByPhoneButtons ] = useState(false);
203
+    const { classes } = useStyles();
204
+    const { t } = useTranslation();
158 205
 
159 206
     /**
160 207
      * Handler for the join button.
@@ -162,23 +209,21 @@ class Prejoin extends Component<IProps, IState> {
162 209
      * @param {Object} e - The synthetic event.
163 210
      * @returns {void}
164 211
      */
165
-    _onJoinButtonClick() {
166
-        if (this.props.showErrorOnJoin) {
212
+    const onJoinButtonClick = () => {
213
+        if (showErrorOnJoin) {
167 214
             return;
168 215
         }
169
-        this.props.joinConference();
170
-    }
216
+        joinConference();
217
+    };
171 218
 
172 219
     /**
173 220
      * Closes the dropdown.
174 221
      *
175 222
      * @returns {void}
176 223
      */
177
-    _onDropdownClose() {
178
-        this.setState({
179
-            showJoinByPhoneButtons: false
180
-        });
181
-    }
224
+    const onDropdownClose = () => {
225
+        setShowJoinByPhoneButtons(false);
226
+    };
182 227
 
183 228
     /**
184 229
      * Displays the join by phone buttons dropdown.
@@ -186,13 +231,11 @@ class Prejoin extends Component<IProps, IState> {
186 231
      * @param {Object} e - The synthetic event.
187 232
      * @returns {void}
188 233
      */
189
-    _onOptionsClick(e?: React.KeyboardEvent | React.MouseEvent | undefined) {
234
+    const onOptionsClick = (e?: React.KeyboardEvent | React.MouseEvent | undefined) => {
190 235
         e?.stopPropagation();
191 236
 
192
-        this.setState({
193
-            showJoinByPhoneButtons: !this.state.showJoinByPhoneButtons
194
-        });
195
-    }
237
+        setShowJoinByPhoneButtons(show => !show);
238
+    };
196 239
 
197 240
     /**
198 241
      * Sets the guest participant name.
@@ -200,30 +243,30 @@ class Prejoin extends Component<IProps, IState> {
200 243
      * @param {string} displayName - Participant name.
201 244
      * @returns {void}
202 245
      */
203
-    _setName(displayName: string) {
204
-        this.props.updateSettings({
246
+    const setName = (displayName: string) => {
247
+        dispatchUpdateSettings({
205 248
             displayName
206 249
         });
207
-    }
250
+    };
208 251
 
209 252
     /**
210 253
      * Closes the join by phone dialog.
211 254
      *
212 255
      * @returns {undefined}
213 256
      */
214
-    _closeDialog() {
215
-        this.props.setJoinByPhoneDialogVisiblity(false);
216
-    }
257
+    const closeDialog = () => {
258
+        setJoinByPhoneDialogVisiblity(false);
259
+    };
217 260
 
218 261
     /**
219 262
      * Displays the dialog for joining a meeting by phone.
220 263
      *
221 264
      * @returns {undefined}
222 265
      */
223
-    _showDialog() {
224
-        this.props.setJoinByPhoneDialogVisiblity(true);
225
-        this._onDropdownClose();
226
-    }
266
+    const doShowDialog = () => {
267
+        setJoinByPhoneDialogVisiblity(true);
268
+        onDropdownClose();
269
+    };
227 270
 
228 271
     /**
229 272
      * KeyPress handler for accessibility.
@@ -232,12 +275,12 @@ class Prejoin extends Component<IProps, IState> {
232 275
      *
233 276
      * @returns {void}
234 277
      */
235
-    _showDialogKeyPress(e: React.KeyboardEvent) {
278
+    const showDialogKeyPress = (e: React.KeyboardEvent) => {
236 279
         if (e.key === ' ' || e.key === 'Enter') {
237 280
             e.preventDefault();
238
-            this._showDialog();
281
+            doShowDialog();
239 282
         }
240
-    }
283
+    };
241 284
 
242 285
     /**
243 286
      * KeyPress handler for accessibility.
@@ -246,30 +289,28 @@ class Prejoin extends Component<IProps, IState> {
246 289
      *
247 290
      * @returns {void}
248 291
      */
249
-    _onJoinConferenceWithoutAudioKeyPress(e: React.KeyboardEvent) {
250
-        if (this.props.joinConferenceWithoutAudio
292
+    const onJoinConferenceWithoutAudioKeyPress = (e: React.KeyboardEvent) => {
293
+        if (joinConferenceWithoutAudio
251 294
             && (e.key === ' '
252 295
                 || e.key === 'Enter')) {
253 296
             e.preventDefault();
254
-            this.props.joinConferenceWithoutAudio();
297
+            joinConferenceWithoutAudio();
255 298
         }
256
-    }
299
+    };
257 300
 
258 301
     /**
259 302
      * Gets the list of extra join buttons.
260 303
      *
261 304
      * @returns {Object} - The list of extra buttons.
262 305
      */
263
-    _getExtraJoinButtons() {
264
-        const { joinConferenceWithoutAudio, t } = this.props;
265
-
306
+    const getExtraJoinButtons = () => {
266 307
         const noAudio = {
267 308
             key: 'no-audio',
268 309
             testId: 'prejoin.joinWithoutAudio',
269 310
             icon: IconVolumeOff,
270 311
             label: t('prejoin.joinWithoutAudio'),
271 312
             onClick: joinConferenceWithoutAudio,
272
-            onKeyPress: this._onJoinConferenceWithoutAudioKeyPress
313
+            onKeyPress: onJoinConferenceWithoutAudioKeyPress
273 314
         };
274 315
 
275 316
         const byPhone = {
@@ -277,15 +318,15 @@ class Prejoin extends Component<IProps, IState> {
277 318
             testId: 'prejoin.joinByPhone',
278 319
             icon: IconPhoneRinging,
279 320
             label: t('prejoin.joinAudioByPhone'),
280
-            onClick: this._showDialog,
281
-            onKeyPress: this._showDialogKeyPress
321
+            onClick: doShowDialog,
322
+            onKeyPress: showDialogKeyPress
282 323
         };
283 324
 
284 325
         return {
285 326
             noAudio,
286 327
             byPhone
287 328
         };
288
-    }
329
+    };
289 330
 
290 331
     /**
291 332
      * Handle keypress on input.
@@ -293,127 +334,99 @@ class Prejoin extends Component<IProps, IState> {
293 334
      * @param {KeyboardEvent} e - Keyboard event.
294 335
      * @returns {void}
295 336
      */
296
-    _onInputKeyPress(e: React.KeyboardEvent) {
297
-        const { joinConference } = this.props;
298
-
337
+    const onInputKeyPress = (e: React.KeyboardEvent) => {
299 338
         if (e.key === 'Enter') {
300 339
             joinConference();
301 340
         }
302
-    }
341
+    };
303 342
 
304
-    /**
305
-     * Implements React's {@link Component#render()}.
306
-     *
307
-     * @inheritdoc
308
-     * @returns {ReactElement}
309
-     */
310
-    render() {
311
-        const {
312
-            deviceStatusVisible,
313
-            hasJoinByPhoneButton,
314
-            joinConferenceWithoutAudio,
315
-            joiningInProgress,
316
-            name,
317
-            participantId,
318
-            prejoinConfig,
319
-            readOnlyName,
320
-            showCameraPreview,
321
-            showDialog,
322
-            showErrorOnJoin,
323
-            t,
324
-            videoTrack
325
-        } = this.props;
326
-        const { _closeDialog, _onDropdownClose, _onJoinButtonClick,
327
-            _onOptionsClick, _setName, _onInputKeyPress } = this;
328
-
329
-        const extraJoinButtons = this._getExtraJoinButtons();
330
-        let extraButtonsToRender = Object.values(extraJoinButtons).filter((val: any) =>
331
-            !(prejoinConfig?.hideExtraJoinButtons || []).includes(val.key)
332
-        );
333
-
334
-        if (!hasJoinByPhoneButton) {
335
-            extraButtonsToRender = extraButtonsToRender.filter((btn: any) => btn.key !== 'by-phone');
336
-        }
337
-        const hasExtraJoinButtons = Boolean(extraButtonsToRender.length);
338
-        const { showJoinByPhoneButtons } = this.state;
339
-
340
-        return (
341
-            <PreMeetingScreen
342
-                showDeviceStatus = { deviceStatusVisible }
343
-                title = { t('prejoin.joinMeeting') }
344
-                videoMuted = { !showCameraPreview }
345
-                videoTrack = { videoTrack }>
346
-                <div
347
-                    className = 'prejoin-input-area'
348
-                    data-testid = 'prejoin.screen'>
349
-                    {this.showDisplayNameField ? (<Input
350
-                        autoComplete = { 'name' }
351
-                        autoFocus = { true }
352
-                        className = 'prejoin-input'
353
-                        error = { showErrorOnJoin }
354
-                        onChange = { _setName }
355
-                        onKeyPress = { _onInputKeyPress }
356
-                        placeholder = { t('dialog.enterDisplayName') }
357
-                        readOnly = { readOnlyName }
358
-                        value = { name } />
359
-                    ) : (
360
-                        <div className = 'prejoin-avatar-container'>
361
-                            <Avatar
362
-                                className = 'prejoin-avatar'
363
-                                displayName = { name }
364
-                                participantId = { participantId }
365
-                                size = { 72 } />
366
-                            <div className = 'prejoin-avatar-name'>{name}</div>
367
-                        </div>
368
-                    )}
369
-
370
-                    {showErrorOnJoin && <div
371
-                        className = 'prejoin-error'
372
-                        data-testid = 'prejoin.errorMessage'>{t('prejoin.errorMissingName')}</div>}
373
-
374
-                    <div className = 'prejoin-preview-dropdown-container'>
375
-                        <Popover
376
-                            content = { hasExtraJoinButtons && <div className = 'prejoin-preview-dropdown-btns'>
377
-                                {extraButtonsToRender.map(({ key, ...rest }) => (
378
-                                    <Button
379
-                                        disabled = { joiningInProgress }
380
-                                        fullWidth = { true }
381
-                                        key = { key }
382
-                                        type = { BUTTON_TYPES.SECONDARY }
383
-                                        { ...rest } />
384
-                                ))}
385
-                            </div> }
386
-                            onPopoverClose = { _onDropdownClose }
387
-                            position = 'bottom'
388
-                            trigger = 'click'
389
-                            visible = { showJoinByPhoneButtons }>
390
-                            <ActionButton
391
-                                OptionsIcon = { showJoinByPhoneButtons ? IconArrowUp : IconArrowDown }
392
-                                ariaDropDownLabel = { t('prejoin.joinWithoutAudio') }
393
-                                ariaLabel = { t('prejoin.joinMeeting') }
394
-                                ariaPressed = { showJoinByPhoneButtons }
395
-                                disabled = { joiningInProgress }
396
-                                hasOptions = { hasExtraJoinButtons }
397
-                                onClick = { _onJoinButtonClick }
398
-                                onOptionsClick = { _onOptionsClick }
399
-                                role = 'button'
400
-                                tabIndex = { 0 }
401
-                                testId = 'prejoin.joinMeeting'
402
-                                type = 'primary'>
403
-                                { t('prejoin.joinMeeting') }
404
-                            </ActionButton>
405
-                        </Popover>
343
+    const extraJoinButtons = getExtraJoinButtons();
344
+    let extraButtonsToRender = Object.values(extraJoinButtons).filter((val: any) =>
345
+        !(prejoinConfig?.hideExtraJoinButtons || []).includes(val.key)
346
+    );
347
+
348
+    if (!hasJoinByPhoneButton) {
349
+        extraButtonsToRender = extraButtonsToRender.filter((btn: any) => btn.key !== 'by-phone');
350
+    }
351
+    const hasExtraJoinButtons = Boolean(extraButtonsToRender.length);
352
+
353
+    return (
354
+        <PreMeetingScreen
355
+            showDeviceStatus = { deviceStatusVisible }
356
+            title = { t('prejoin.joinMeeting') }
357
+            videoMuted = { !showCameraPreview }
358
+            videoTrack = { videoTrack }>
359
+            <div
360
+                className = { classes.inputContainer }
361
+                data-testid = 'prejoin.screen'>
362
+                {showDisplayNameField.current ? (<Input
363
+                    autoComplete = { 'name' }
364
+                    autoFocus = { true }
365
+                    className = { classes.input }
366
+                    error = { showErrorOnJoin }
367
+                    onChange = { setName }
368
+                    onKeyPress = { onInputKeyPress }
369
+                    placeholder = { t('dialog.enterDisplayName') }
370
+                    readOnly = { readOnlyName }
371
+                    value = { name } />
372
+                ) : (
373
+                    <div className = { classes.avatarContainer }>
374
+                        <Avatar
375
+                            className = { classes.avatar }
376
+                            displayName = { name }
377
+                            participantId = { participantId }
378
+                            size = { 72 } />
379
+                        <div className = { classes.avatarName }>{name}</div>
406 380
                     </div>
407
-                </div>
408
-                { showDialog && (
409
-                    <JoinByPhoneDialog // @ts-ignore
410
-                        joinConferenceWithoutAudio = { joinConferenceWithoutAudio }
411
-                        onClose = { _closeDialog } />
412 381
                 )}
413
-            </PreMeetingScreen>
414
-        );
415
-    }
416
-}
382
+
383
+                {showErrorOnJoin && <div
384
+                    className = { classes.error }
385
+                    data-testid = 'prejoin.errorMessage'>{t('prejoin.errorMissingName')}</div>}
386
+
387
+                <div className = { classes.dropdownContainer }>
388
+                    <Popover
389
+                        content = { hasExtraJoinButtons && <div className = { classes.dropdownButtons }>
390
+                            {extraButtonsToRender.map(({ key, ...rest }) => (
391
+                                <Button
392
+                                    disabled = { joiningInProgress }
393
+                                    fullWidth = { true }
394
+                                    key = { key }
395
+                                    type = { BUTTON_TYPES.SECONDARY }
396
+                                    { ...rest } />
397
+                            ))}
398
+                        </div> }
399
+                        onPopoverClose = { onDropdownClose }
400
+                        position = 'bottom'
401
+                        trigger = 'click'
402
+                        visible = { showJoinByPhoneButtons }>
403
+                        <ActionButton
404
+                            OptionsIcon = { showJoinByPhoneButtons ? IconArrowUp : IconArrowDown }
405
+                            ariaDropDownLabel = { t('prejoin.joinWithoutAudio') }
406
+                            ariaLabel = { t('prejoin.joinMeeting') }
407
+                            ariaPressed = { showJoinByPhoneButtons }
408
+                            disabled = { joiningInProgress }
409
+                            hasOptions = { hasExtraJoinButtons }
410
+                            onClick = { onJoinButtonClick }
411
+                            onOptionsClick = { onOptionsClick }
412
+                            role = 'button'
413
+                            tabIndex = { 0 }
414
+                            testId = 'prejoin.joinMeeting'
415
+                            type = 'primary'>
416
+                            {t('prejoin.joinMeeting')}
417
+                        </ActionButton>
418
+                    </Popover>
419
+                </div>
420
+            </div>
421
+            {showDialog && (
422
+                <JoinByPhoneDialog
423
+                    joinConferenceWithoutAudio = { joinConferenceWithoutAudio }
424
+                    onClose = { closeDialog } />
425
+            )}
426
+        </PreMeetingScreen>
427
+    );
428
+};
429
+
417 430
 
418 431
 /**
419 432
  * Maps (parts of) the redux state to the React {@code Component} props.
@@ -450,4 +463,4 @@ const mapDispatchToProps = {
450 463
     updateSettings
451 464
 };
452 465
 
453
-export default connect(mapStateToProps, mapDispatchToProps)(translate(Prejoin));
466
+export default connect(mapStateToProps, mapDispatchToProps)(Prejoin);

+ 2
- 1
react/features/prejoin/components/web/dialogs/JoinByPhoneDialog.tsx Wyświetl plik

@@ -216,9 +216,10 @@ class JoinByPhoneDialog extends PureComponent<IProps, State> {
216 216
  * Maps (parts of) the redux state to the React {@code Component} props.
217 217
  *
218 218
  * @param {Object} state - The redux state.
219
+ * @param {Object} _ownProps - Component's own props.
219 220
  * @returns {Object}
220 221
  */
221
-function mapStateToProps(state: IReduxState) {
222
+function mapStateToProps(state: IReduxState, _ownProps: any) {
222 223
     return {
223 224
         dialInNumber: getDefaultDialInNumber(state),
224 225
         dialOutNumber: getFullDialOutNumber(state),

Ładowanie…
Anuluj
Zapisz