Browse Source

fix(prejoin_page): Always show 'join without audio' & add disabled button.

* The prejoin page always displays the 'join without audio' option.
* The join button will be disabled if there is no input.
* Fix some CSS for the case when the user is not anonymous.
master
Vlad Piersec 5 years ago
parent
commit
4975f15345

+ 22
- 0
css/_prejoin.scss View File

55
             margin: 0;
55
             margin: 0;
56
             padding: 0;
56
             padding: 0;
57
         }
57
         }
58
+
59
+        &--disabled {
60
+            background: #5E6D7A;
61
+            border: 1px solid #5E6D7A;
62
+            color: #AFB6BC;
63
+            cursor: initial;
64
+
65
+            .prejoin-btn-icon {
66
+                & > svg {
67
+                    fill: #AFB6BC;
68
+                }
69
+            }
70
+
71
+            .prejoin-btn-options {
72
+                border-left: 1px solid #AFB6BC;
73
+            }
74
+        }
58
     }
75
     }
59
 
76
 
60
     &-btn-options {
77
     &-btn-options {
150
                 @include name-placeholder;
167
                 @include name-placeholder;
151
             }
168
             }
152
         }
169
         }
170
+
171
+        &--text {
172
+            margin: 16px 0;
173
+            outline: none;
174
+        }
153
     }
175
     }
154
 
176
 
155
     &-avatar.avatar {
177
     &-avatar.avatar {

+ 12
- 11
react/features/prejoin/components/Prejoin.js View File

15
 import { getDisplayName, updateSettings } from '../../base/settings';
15
 import { getDisplayName, updateSettings } from '../../base/settings';
16
 import ActionButton from './buttons/ActionButton';
16
 import ActionButton from './buttons/ActionButton';
17
 import {
17
 import {
18
-    areJoinByPhoneButtonsVisible,
18
+    isJoinByPhoneButtonVisible,
19
     isDeviceStatusVisible,
19
     isDeviceStatusVisible,
20
     isJoinByPhoneDialogVisible
20
     isJoinByPhoneDialogVisible
21
 } from '../functions';
21
 } from '../functions';
35
      */
35
      */
36
     deviceStatusVisible: boolean,
36
     deviceStatusVisible: boolean,
37
 
37
 
38
+    /**
39
+     * If join by phone button should be visible.
40
+     */
41
+    hasJoinByPhoneButton: boolean,
42
+
38
     /**
43
     /**
39
      * Flag signaling if a user is logged in or not.
44
      * Flag signaling if a user is logged in or not.
40
      */
45
      */
80
      */
85
      */
81
     showDialog: boolean,
86
     showDialog: boolean,
82
 
87
 
83
-    /**
84
-     * If join by phone buttons should be visible.
85
-     */
86
-    hasJoinByPhoneButtons: boolean,
87
-
88
     /**
88
     /**
89
      * Used for translation.
89
      * Used for translation.
90
      */
90
      */
210
     render() {
210
     render() {
211
         const {
211
         const {
212
             deviceStatusVisible,
212
             deviceStatusVisible,
213
+            hasJoinByPhoneButton,
213
             isAnonymousUser,
214
             isAnonymousUser,
214
             joinConference,
215
             joinConference,
215
             joinConferenceWithoutAudio,
216
             joinConferenceWithoutAudio,
216
             name,
217
             name,
217
-            hasJoinByPhoneButtons,
218
             showDialog,
218
             showDialog,
219
             t
219
             t
220
         } = this.props;
220
         } = this.props;
251
                                             src = { IconVolumeOff } />
251
                                             src = { IconVolumeOff } />
252
                                         { t('prejoin.joinWithoutAudio') }
252
                                         { t('prejoin.joinWithoutAudio') }
253
                                     </div>
253
                                     </div>
254
-                                    <div
254
+                                    {hasJoinByPhoneButton && <div
255
                                         className = 'prejoin-preview-dropdown-btn'
255
                                         className = 'prejoin-preview-dropdown-btn'
256
                                         onClick = { _showDialog }>
256
                                         onClick = { _showDialog }>
257
                                         <Icon
257
                                         <Icon
259
                                             size = { 24 }
259
                                             size = { 24 }
260
                                             src = { IconPhone } />
260
                                             src = { IconPhone } />
261
                                         { t('prejoin.joinAudioByPhone') }
261
                                         { t('prejoin.joinAudioByPhone') }
262
-                                    </div>
262
+                                    </div>}
263
                                 </div> }
263
                                 </div> }
264
                                 isOpen = { showJoinByPhoneButtons }
264
                                 isOpen = { showJoinByPhoneButtons }
265
                                 onClose = { _onDropdownClose }>
265
                                 onClose = { _onDropdownClose }>
266
                                 <ActionButton
266
                                 <ActionButton
267
-                                    hasOptions = { hasJoinByPhoneButtons }
267
+                                    disabled = { !name }
268
+                                    hasOptions = { true }
268
                                     onClick = { joinConference }
269
                                     onClick = { joinConference }
269
                                     onOptionsClick = { _onOptionsClick }
270
                                     onOptionsClick = { _onOptionsClick }
270
                                     type = 'primary'>
271
                                     type = 'primary'>
312
         name: getDisplayName(state),
313
         name: getDisplayName(state),
313
         roomName: getRoomName(state),
314
         roomName: getRoomName(state),
314
         showDialog: isJoinByPhoneDialogVisible(state),
315
         showDialog: isJoinByPhoneDialogVisible(state),
315
-        hasJoinByPhoneButtons: areJoinByPhoneButtonsVisible(state)
316
+        hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state)
316
     };
317
     };
317
 }
318
 }
318
 
319
 

+ 19
- 4
react/features/prejoin/components/buttons/ActionButton.js View File

21
      */
21
      */
22
     className?: string,
22
     className?: string,
23
 
23
 
24
+    /**
25
+     * If the button is disabled or not.
26
+     */
27
+    disabled?: boolean,
28
+
24
     /**
29
     /**
25
      * If the button has options.
30
      * If the button has options.
26
      */
31
      */
47
  *
52
  *
48
  * @returns {ReactElement}
53
  * @returns {ReactElement}
49
  */
54
  */
50
-function ActionButton({ children, className, hasOptions, type, onClick, onOptionsClick }: Props) {
51
-    const ownClassName = `prejoin-btn ${classNameByType[type]}`;
55
+function ActionButton({ children, className, disabled, hasOptions, type, onClick, onOptionsClick }: Props) {
56
+    let ownClassName = 'prejoin-btn';
57
+    let clickHandler = onClick;
58
+    let optionsClickHandler = onOptionsClick;
59
+
60
+    if (disabled) {
61
+        clickHandler = null;
62
+        optionsClickHandler = null;
63
+        ownClassName = `${ownClassName} prejoin-btn--disabled`;
64
+    } else {
65
+        ownClassName = `${ownClassName} ${classNameByType[type]}`;
66
+    }
52
     const cls = className ? `${className} ${ownClassName}` : ownClassName;
67
     const cls = className ? `${className} ${ownClassName}` : ownClassName;
53
 
68
 
54
     return (
69
     return (
55
         <div
70
         <div
56
             className = { cls }
71
             className = { cls }
57
-            onClick = { onClick }>
72
+            onClick = { clickHandler }>
58
             {children}
73
             {children}
59
             {hasOptions && <div
74
             {hasOptions && <div
60
                 className = 'prejoin-btn-options'
75
                 className = 'prejoin-btn-options'
61
-                onClick = { onOptionsClick }>
76
+                onClick = { optionsClickHandler }>
62
                 <Icon
77
                 <Icon
63
                     className = 'prejoin-btn-icon'
78
                     className = 'prejoin-btn-icon'
64
                     size = { 14 }
79
                     size = { 14 }

+ 1
- 1
react/features/prejoin/components/preview/ParticipantName.js View File

96
                 value = { value } />
96
                 value = { value } />
97
         )
97
         )
98
             : <div
98
             : <div
99
-                className = 'prejoin-preview-name'
99
+                className = 'prejoin-preview-name prejoin-preview-name--text'
100
                 onKeyDown = { _onKeyDown }
100
                 onKeyDown = { _onKeyDown }
101
                 tabIndex = '0' >
101
                 tabIndex = '0' >
102
                 {value}
102
                 {value}

+ 2
- 2
react/features/prejoin/functions.js View File

23
 }
23
 }
24
 
24
 
25
 /**
25
 /**
26
- * Selector for the visibility of the 'join by phone' buttons.
26
+ * Selector for the visibility of the 'join by phone' button.
27
  *
27
  *
28
  * @param {Object} state - The state of the app.
28
  * @param {Object} state - The state of the app.
29
  * @returns {boolean}
29
  * @returns {boolean}
30
  */
30
  */
31
-export function areJoinByPhoneButtonsVisible(state: Object): boolean {
31
+export function isJoinByPhoneButtonVisible(state: Object): boolean {
32
     return Boolean(getDialOutUrl(state) && getDialOutStatusUrl(state));
32
     return Boolean(getDialOutUrl(state) && getDialOutStatusUrl(state));
33
 }
33
 }
34
 
34
 

Loading…
Cancel
Save