fix(jaas) do not show overriden unsupported browser page for jaas users (#9962)

pull/9976/head jitsi-meet_6346
Avram Tudor 3 years ago committed by GitHub
parent 7ff3b669ee
commit 52e9e90b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 73
      react/features/unsupported-browser/components/DefaultUnsupportedDesktopBrowser.js
  2. 1
      react/features/unsupported-browser/components/JaasUnsupportedDesktopBrowser.js
  3. 19
      react/features/unsupported-browser/components/PageSelector.js
  4. 74
      react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js
  5. 3
      react/features/unsupported-browser/components/index.js

@ -0,0 +1,73 @@
/* @flow */
import React, { Component } from 'react';
import { isBrowsersOptimal } from '../../base/environment';
import { translate } from '../../base/i18n';
import { CHROME, FIREFOX } from './browserLinks';
/**
* The namespace of the CSS styles of UnsupportedDesktopBrowser.
*
* @private
* @type {string}
*/
const _SNS = 'unsupported-desktop-browser';
/**
* The type of the React {@code Component} props of
* {@link JaasUnsupportedDesktopBrowser}.
*/
type Props = {
/**
* The function to translate human-readable text.
*/
t: Function
};
/**
* React component representing unsupported browser page.
*
* @class UnsupportedDesktopBrowser
*/
class JaasUnsupportedDesktopBrowser extends Component<Props> {
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
return (
<div className = { _SNS }>
<h2 className = { `${_SNS}__title` }>
It looks like you're using a browser we don't support.
</h2>
<p className = { `${_SNS}__description` }>
Please try again with the latest version of&nbsp;
<a
className = { `${_SNS}__link` }
href = { CHROME } >Chrome</a>&nbsp;
{
this._showFirefox() && <>or <a
className = { `${_SNS}__link` }
href = { FIREFOX }>Firefox</a></>
}
</p>
</div>
);
}
/**
* Returns whether or not a link to download Firefox is displayed.
*
* @private
* @returns {boolean}
*/
_showFirefox() {
return isBrowsersOptimal('firefox');
}
}
export default translate(JaasUnsupportedDesktopBrowser);

@ -0,0 +1 @@
export { default } from './DefaultUnsupportedDesktopBrowser';

@ -0,0 +1,19 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { isVpaasMeeting } from '../../jaas/functions';
import JaasUnsupportedDesktopBrowser from './JaasUnsupportedDesktopBrowser';
import UnsupportedDesktopBrowser from './UnsupportedDesktopBrowser';
const PageSelector = () => {
const isJaas = useSelector(isVpaasMeeting);
if (isJaas) {
return <JaasUnsupportedDesktopBrowser />;
}
return <UnsupportedDesktopBrowser />;
};
export default PageSelector;

@ -1,73 +1 @@
/* @flow */
import React, { Component } from 'react';
import { isBrowsersOptimal } from '../../base/environment';
import { translate } from '../../base/i18n';
import { CHROME, FIREFOX } from './browserLinks';
/**
* The namespace of the CSS styles of UnsupportedDesktopBrowser.
*
* @private
* @type {string}
*/
const _SNS = 'unsupported-desktop-browser';
/**
* The type of the React {@code Component} props of
* {@link UnsupportedDesktopBrowser}.
*/
type Props = {
/**
* The function to translate human-readable text.
*/
t: Function
};
/**
* React component representing unsupported browser page.
*
* @class UnsupportedDesktopBrowser
*/
class UnsupportedDesktopBrowser extends Component<Props> {
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
return (
<div className = { _SNS }>
<h2 className = { `${_SNS}__title` }>
It looks like you're using a browser we don't support.
</h2>
<p className = { `${_SNS}__description` }>
Please try again with the latest version of&nbsp;
<a
className = { `${_SNS}__link` }
href = { CHROME } >Chrome</a>&nbsp;
{
this._showFirefox() && <>or <a
className = { `${_SNS}__link` }
href = { FIREFOX }>Firefox</a></>
}
</p>
</div>
);
}
/**
* Returns whether or not a link to download Firefox is displayed.
*
* @private
* @returns {boolean}
*/
_showFirefox() {
return isBrowsersOptimal('firefox');
}
}
export default translate(UnsupportedDesktopBrowser);
export { default } from './DefaultUnsupportedDesktopBrowser';

@ -1,2 +1 @@
export { default as UnsupportedDesktopBrowser }
from './UnsupportedDesktopBrowser';
export { default as UnsupportedDesktopBrowser } from './PageSelector';

Loading…
Cancel
Save