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.
j8
Vlad Piersec 5 years ago
parent
commit
4975f15345

+ 22
- 0
css/_prejoin.scss View File

@@ -55,6 +55,23 @@
55 55
             margin: 0;
56 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 77
     &-btn-options {
@@ -150,6 +167,11 @@
150 167
                 @include name-placeholder;
151 168
             }
152 169
         }
170
+
171
+        &--text {
172
+            margin: 16px 0;
173
+            outline: none;
174
+        }
153 175
     }
154 176
 
155 177
     &-avatar.avatar {

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

@@ -15,7 +15,7 @@ import { connect } from '../../base/redux';
15 15
 import { getDisplayName, updateSettings } from '../../base/settings';
16 16
 import ActionButton from './buttons/ActionButton';
17 17
 import {
18
-    areJoinByPhoneButtonsVisible,
18
+    isJoinByPhoneButtonVisible,
19 19
     isDeviceStatusVisible,
20 20
     isJoinByPhoneDialogVisible
21 21
 } from '../functions';
@@ -35,6 +35,11 @@ type Props = {
35 35
      */
36 36
     deviceStatusVisible: boolean,
37 37
 
38
+    /**
39
+     * If join by phone button should be visible.
40
+     */
41
+    hasJoinByPhoneButton: boolean,
42
+
38 43
     /**
39 44
      * Flag signaling if a user is logged in or not.
40 45
      */
@@ -80,11 +85,6 @@ type Props = {
80 85
      */
81 86
     showDialog: boolean,
82 87
 
83
-    /**
84
-     * If join by phone buttons should be visible.
85
-     */
86
-    hasJoinByPhoneButtons: boolean,
87
-
88 88
     /**
89 89
      * Used for translation.
90 90
      */
@@ -210,11 +210,11 @@ class Prejoin extends Component<Props, State> {
210 210
     render() {
211 211
         const {
212 212
             deviceStatusVisible,
213
+            hasJoinByPhoneButton,
213 214
             isAnonymousUser,
214 215
             joinConference,
215 216
             joinConferenceWithoutAudio,
216 217
             name,
217
-            hasJoinByPhoneButtons,
218 218
             showDialog,
219 219
             t
220 220
         } = this.props;
@@ -251,7 +251,7 @@ class Prejoin extends Component<Props, State> {
251 251
                                             src = { IconVolumeOff } />
252 252
                                         { t('prejoin.joinWithoutAudio') }
253 253
                                     </div>
254
-                                    <div
254
+                                    {hasJoinByPhoneButton && <div
255 255
                                         className = 'prejoin-preview-dropdown-btn'
256 256
                                         onClick = { _showDialog }>
257 257
                                         <Icon
@@ -259,12 +259,13 @@ class Prejoin extends Component<Props, State> {
259 259
                                             size = { 24 }
260 260
                                             src = { IconPhone } />
261 261
                                         { t('prejoin.joinAudioByPhone') }
262
-                                    </div>
262
+                                    </div>}
263 263
                                 </div> }
264 264
                                 isOpen = { showJoinByPhoneButtons }
265 265
                                 onClose = { _onDropdownClose }>
266 266
                                 <ActionButton
267
-                                    hasOptions = { hasJoinByPhoneButtons }
267
+                                    disabled = { !name }
268
+                                    hasOptions = { true }
268 269
                                     onClick = { joinConference }
269 270
                                     onOptionsClick = { _onOptionsClick }
270 271
                                     type = 'primary'>
@@ -312,7 +313,7 @@ function mapStateToProps(state): Object {
312 313
         name: getDisplayName(state),
313 314
         roomName: getRoomName(state),
314 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,6 +21,11 @@ type Props = {
21 21
      */
22 22
     className?: string,
23 23
 
24
+    /**
25
+     * If the button is disabled or not.
26
+     */
27
+    disabled?: boolean,
28
+
24 29
     /**
25 30
      * If the button has options.
26 31
      */
@@ -47,18 +52,28 @@ type Props = {
47 52
  *
48 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 67
     const cls = className ? `${className} ${ownClassName}` : ownClassName;
53 68
 
54 69
     return (
55 70
         <div
56 71
             className = { cls }
57
-            onClick = { onClick }>
72
+            onClick = { clickHandler }>
58 73
             {children}
59 74
             {hasOptions && <div
60 75
                 className = 'prejoin-btn-options'
61
-                onClick = { onOptionsClick }>
76
+                onClick = { optionsClickHandler }>
62 77
                 <Icon
63 78
                     className = 'prejoin-btn-icon'
64 79
                     size = { 14 }

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

@@ -96,7 +96,7 @@ class ParticipantName extends Component<Props> {
96 96
                 value = { value } />
97 97
         )
98 98
             : <div
99
-                className = 'prejoin-preview-name'
99
+                className = 'prejoin-preview-name prejoin-preview-name--text'
100 100
                 onKeyDown = { _onKeyDown }
101 101
                 tabIndex = '0' >
102 102
                 {value}

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

@@ -23,12 +23,12 @@ function applyMuteOptionsToTrack(track, shouldMute) {
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 28
  * @param {Object} state - The state of the app.
29 29
  * @returns {boolean}
30 30
  */
31
-export function areJoinByPhoneButtonsVisible(state: Object): boolean {
31
+export function isJoinByPhoneButtonVisible(state: Object): boolean {
32 32
     return Boolean(getDialOutUrl(state) && getDialOutStatusUrl(state));
33 33
 }
34 34
 

Loading…
Cancel
Save