Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Vlad Piersec4975f1534505
diff --git a/css/_prejoin.scss b/css/_prejoin.scss
index 83f1de9d32..e98a30623b 100644
--- a/css/_prejoin.scss
+++ b/css/_prejoin.scss
@@ -55,6 +55,23 @@
margin: 0;
padding: 0;
}
+
+ &--disabled {
+ background: #5E6D7A;
+ border: 1px solid #5E6D7A;
+ color: #AFB6BC;
+ cursor: initial;
+
+ .prejoin-btn-icon {
+ & > svg {
+ fill: #AFB6BC;
+ }
+ }
+
+ .prejoin-btn-options {
+ border-left: 1px solid #AFB6BC;
+ }
+ }
}
&-btn-options {
@@ -150,6 +167,11 @@
@include name-placeholder;
}
}
+
+ &--text {
+ margin: 16px 0;
+ outline: none;
+ }
}
&-avatar.avatar {
diff --git a/react/features/prejoin/components/Prejoin.js b/react/features/prejoin/components/Prejoin.js
index 900c69cd49..fd06a77ccb 100644
--- a/react/features/prejoin/components/Prejoin.js
+++ b/react/features/prejoin/components/Prejoin.js
@@ -15,7 +15,7 @@ import { connect } from '../../base/redux';
import { getDisplayName, updateSettings } from '../../base/settings';
import ActionButton from './buttons/ActionButton';
import {
- areJoinByPhoneButtonsVisible,
+ isJoinByPhoneButtonVisible,
isDeviceStatusVisible,
isJoinByPhoneDialogVisible
} from '../functions';
@@ -35,6 +35,11 @@ type Props = {
*/
deviceStatusVisible: boolean,
+ /**
+ * If join by phone button should be visible.
+ */
+ hasJoinByPhoneButton: boolean,
+
/**
* Flag signaling if a user is logged in or not.
*/
@@ -80,11 +85,6 @@ type Props = {
*/
showDialog: boolean,
- /**
- * If join by phone buttons should be visible.
- */
- hasJoinByPhoneButtons: boolean,
-
/**
* Used for translation.
*/
@@ -210,11 +210,11 @@ class Prejoin extends Component<Props, State> {
render() {
const {
deviceStatusVisible,
+ hasJoinByPhoneButton,
isAnonymousUser,
joinConference,
joinConferenceWithoutAudio,
name,
- hasJoinByPhoneButtons,
showDialog,
t
} = this.props;
@@ -251,7 +251,7 @@ class Prejoin extends Component<Props, State> {
src = { IconVolumeOff } />
{ t('prejoin.joinWithoutAudio') }
</div>
- <div
+ {hasJoinByPhoneButton && <div
className = 'prejoin-preview-dropdown-btn'
onClick = { _showDialog }>
<Icon
@@ -259,12 +259,13 @@ class Prejoin extends Component<Props, State> {
size = { 24 }
src = { IconPhone } />
{ t('prejoin.joinAudioByPhone') }
- </div>
+ </div>}
</div> }
isOpen = { showJoinByPhoneButtons }
onClose = { _onDropdownClose }>
<ActionButton
- hasOptions = { hasJoinByPhoneButtons }
+ disabled = { !name }
+ hasOptions = { true }
onClick = { joinConference }
onOptionsClick = { _onOptionsClick }
type = 'primary'>
@@ -312,7 +313,7 @@ function mapStateToProps(state): Object {
name: getDisplayName(state),
roomName: getRoomName(state),
showDialog: isJoinByPhoneDialogVisible(state),
- hasJoinByPhoneButtons: areJoinByPhoneButtonsVisible(state)
+ hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state)
};
}
diff --git a/react/features/prejoin/components/buttons/ActionButton.js b/react/features/prejoin/components/buttons/ActionButton.js
index 783e172351..c477153058 100644
--- a/react/features/prejoin/components/buttons/ActionButton.js
+++ b/react/features/prejoin/components/buttons/ActionButton.js
@@ -21,6 +21,11 @@ type Props = {
*/
className?: string,
+ /**
+ * If the button is disabled or not.
+ */
+ disabled?: boolean,
+
/**
* If the button has options.
*/
@@ -47,18 +52,28 @@ type Props = {
*
* @returns {ReactElement}
*/
-function ActionButton({ children, className, hasOptions, type, onClick, onOptionsClick }: Props) {
- const ownClassName = `prejoin-btn ${classNameByType[type]}`;
+function ActionButton({ children, className, disabled, hasOptions, type, onClick, onOptionsClick }: Props) {
+ let ownClassName = 'prejoin-btn';
+ let clickHandler = onClick;
+ let optionsClickHandler = onOptionsClick;
+
+ if (disabled) {
+ clickHandler = null;
+ optionsClickHandler = null;
+ ownClassName = `${ownClassName} prejoin-btn--disabled`;
+ } else {
+ ownClassName = `${ownClassName} ${classNameByType[type]}`;
+ }
const cls = className ? `${className} ${ownClassName}` : ownClassName;
return (
<div
className = { cls }
- onClick = { onClick }>
+ onClick = { clickHandler }>
{children}
{hasOptions && <div
className = 'prejoin-btn-options'
- onClick = { onOptionsClick }>
+ onClick = { optionsClickHandler }>
<Icon
className = 'prejoin-btn-icon'
size = { 14 }
diff --git a/react/features/prejoin/components/preview/ParticipantName.js b/react/features/prejoin/components/preview/ParticipantName.js
index 9b10ea7e09..a0f4577c69 100644
--- a/react/features/prejoin/components/preview/ParticipantName.js
+++ b/react/features/prejoin/components/preview/ParticipantName.js
@@ -96,7 +96,7 @@ class ParticipantName extends Component<Props> {
value = { value } />
)
: <div
- className = 'prejoin-preview-name'
+ className = 'prejoin-preview-name prejoin-preview-name--text'
onKeyDown = { _onKeyDown }
tabIndex = '0' >
{value}
diff --git a/react/features/prejoin/functions.js b/react/features/prejoin/functions.js
index 2de66c6440..167aaae0f0 100644
--- a/react/features/prejoin/functions.js
+++ b/react/features/prejoin/functions.js
@@ -23,12 +23,12 @@ function applyMuteOptionsToTrack(track, shouldMute) {
}
/**
- * Selector for the visibility of the 'join by phone' buttons.
+ * Selector for the visibility of the 'join by phone' button.
*
* @param {Object} state - The state of the app.
* @returns {boolean}
*/
-export function areJoinByPhoneButtonsVisible(state: Object): boolean {
+export function isJoinByPhoneButtonVisible(state: Object): boolean {
return Boolean(getDialOutUrl(state) && getDialOutStatusUrl(state));
}