Skip to content

Commit

Permalink
feat(authentication/native): hide login button for 8x8.vc (#13881)
Browse files Browse the repository at this point in the history
* feat(authentication): hide login button for 8x8.vc
  • Loading branch information
Calinteodor authored Oct 2, 2023
1 parent cb7146f commit 32ac299
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ interface IProps {
*/
_alternativeCancelText?: boolean;

/**
* Is confirm button hidden?
*/
_isConfirmHidden?: boolean;

/**
* Redux store dispatch function.
*/
Expand Down Expand Up @@ -56,11 +61,14 @@ class WaitForOwnerDialog extends Component<IProps> {
* @returns {ReactElement}
*/
render() {
const { _isConfirmHidden } = this.props;

return (
<ConfirmDialog
cancelLabel = { this.props._alternativeCancelText ? 'dialog.WaitingForHostButton' : 'dialog.Cancel' }
confirmLabel = 'dialog.IamHost'
descriptionKey = 'dialog.WaitForHostMsg'
isConfirmHidden = { _isConfirmHidden }
onCancel = { this._onCancel }
onSubmit = { this._onLogin } />
);
Expand Down Expand Up @@ -97,9 +105,11 @@ class WaitForOwnerDialog extends Component<IProps> {
*/
function mapStateToProps(state: IReduxState) {
const { membersOnly, lobbyWaitingForHost } = state['features/base/conference'];
const { locationURL } = state['features/base/connection'];

return {
_alternativeCancelText: membersOnly && lobbyWaitingForHost
_alternativeCancelText: membersOnly && lobbyWaitingForHost,
_isConfirmHidden: locationURL?.hostname?.includes('8x8.vc')
};
}

Expand Down
19 changes: 14 additions & 5 deletions react/features/base/dialog/components/native/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ interface IProps extends AbstractProps, WithTranslation {
*/
isConfirmDestructive?: Boolean;

/**
* Whether or not the confirm button is hidden.
*/
isConfirmHidden?: Boolean;

/**
* Dialog title.
*/
Expand All @@ -60,7 +65,8 @@ class ConfirmDialog extends AbstractDialog<IProps> {
* @static
*/
static defaultProps = {
isConfirmDestructive: false
isConfirmDestructive: false,
isConfirmHidden: false
};

/**
Expand Down Expand Up @@ -95,6 +101,7 @@ class ConfirmDialog extends AbstractDialog<IProps> {
children,
confirmLabel,
isConfirmDestructive,
isConfirmHidden,
t,
title
} = this.props;
Expand All @@ -118,10 +125,12 @@ class ConfirmDialog extends AbstractDialog<IProps> {
label = { t(cancelLabel || 'dialog.confirmNo') }
onPress = { this._onCancel }
style = { styles.dialogButton } />
<Dialog.Button
label = { t(confirmLabel || 'dialog.confirmYes') }
onPress = { this._onSubmit }
style = { dialogButtonStyle } />
{
!isConfirmHidden && <Dialog.Button
label = { t(confirmLabel || 'dialog.confirmYes') }
onPress = { this._onSubmit }
style = { dialogButtonStyle } />
}
</Dialog.Container>
);
}
Expand Down

0 comments on commit 32ac299

Please sign in to comment.