fix(lobby) disable invite from lobby screen fix #9209 (#9417)

* fix(lobby) disable invite from lobby screen fix #9209

* fix(lobby) destructered props fix #9209

* fix(lobby) changed const name fix #9209

* fix(lobby) added empty line fix #9209
This commit is contained in:
Calinteodor 2021-06-22 20:07:57 +03:00 committed by GitHub
parent 804d14e112
commit 487da8f231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 4 deletions

View File

@ -29,6 +29,11 @@ type Props = {
*/
name?: string,
/**
* Indicates whether the copy url button should be shown
*/
showCopyUrlButton: boolean,
/**
* Indicates whether the avatar should be shown when video is off
*/
@ -77,6 +82,7 @@ export default class PreMeetingScreen extends PureComponent<Props> {
*/
static defaultProps = {
showAvatar: true,
showCopyUrlButton: true,
showConferenceInfo: true
};
@ -86,8 +92,17 @@ export default class PreMeetingScreen extends PureComponent<Props> {
* @inheritdoc
*/
render() {
const { name, showAvatar, showConferenceInfo, title, videoMuted, videoTrack, visibleButtons } = this.props;
const showSharingButton = allowUrlSharing();
const {
name,
showAvatar,
showConferenceInfo,
showCopyUrlButton,
title,
videoMuted,
videoTrack,
visibleButtons
} = this.props;
const showSharingButton = allowUrlSharing() && showCopyUrlButton;
return (
<div

View File

@ -3,6 +3,7 @@
import React, { PureComponent } from 'react';
import { getConferenceName } from '../../base/conference';
import { getFeatureFlag, INVITE_ENABLED } from '../../base/flags';
import { getLocalParticipant } from '../../base/participants';
import { getFieldValue } from '../../base/react';
import { updateSettings } from '../../base/settings';
@ -56,6 +57,11 @@ export type Props = {
*/
dispatch: Function,
/**
* Indicates whether the copy url button should be shown
*/
showCopyUrlButton: boolean,
/**
* Function to be used to translate i18n labels.
*/
@ -369,8 +375,11 @@ export default class AbstractLobbyScreen<P: Props = Props> extends PureComponent
export function _mapStateToProps(state: Object): $Shape<Props> {
const localParticipant = getLocalParticipant(state);
const participantId = localParticipant?.id;
const inviteEnabledFlag = getFeatureFlag(state, INVITE_ENABLED, true);
const { disableInviteFunctions } = state['features/base/config'];
const { knocking, passwordJoinFailed } = state['features/lobby'];
const { iAmSipGateway } = state['features/base/config'];
const showCopyUrlButton = inviteEnabledFlag || !disableInviteFunctions;
return {
_knocking: knocking,
@ -379,6 +388,7 @@ export function _mapStateToProps(state: Object): $Shape<Props> {
_participantId: participantId,
_participantName: localParticipant?.name,
_passwordJoinFailed: passwordJoinFailed,
_renderPassword: !iAmSipGateway
_renderPassword: !iAmSipGateway,
showCopyUrlButton
};
}

View File

@ -20,8 +20,12 @@ class LobbyScreen extends AbstractLobbyScreen {
* @inheritdoc
*/
render() {
const { showCopyUrlButton, t } = this.props;
return (
<PreMeetingScreen title = { this.props.t(this._getScreenTitleKey()) }>
<PreMeetingScreen
showCopyUrlButton = { showCopyUrlButton }
title = { t(this._getScreenTitleKey()) }>
{ this._renderContent() }
</PreMeetingScreen>
);