From 52e9e90b3a0dac8c87e4b6305be50499f6fecf3a Mon Sep 17 00:00:00 2001 From: Avram Tudor Date: Mon, 20 Sep 2021 11:38:46 +0300 Subject: [PATCH] fix(jaas) do not show overriden unsupported browser page for jaas users (#9962) --- .../DefaultUnsupportedDesktopBrowser.js | 73 ++++++++++++++++++ .../JaasUnsupportedDesktopBrowser.js | 1 + .../components/PageSelector.js | 19 +++++ .../components/UnsupportedDesktopBrowser.js | 74 +------------------ .../unsupported-browser/components/index.js | 3 +- 5 files changed, 95 insertions(+), 75 deletions(-) create mode 100644 react/features/unsupported-browser/components/DefaultUnsupportedDesktopBrowser.js create mode 100644 react/features/unsupported-browser/components/JaasUnsupportedDesktopBrowser.js create mode 100644 react/features/unsupported-browser/components/PageSelector.js diff --git a/react/features/unsupported-browser/components/DefaultUnsupportedDesktopBrowser.js b/react/features/unsupported-browser/components/DefaultUnsupportedDesktopBrowser.js new file mode 100644 index 0000000000..69f11b56b2 --- /dev/null +++ b/react/features/unsupported-browser/components/DefaultUnsupportedDesktopBrowser.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 { + /** + * Renders the component. + * + * @returns {ReactElement} + */ + render() { + return ( +
+

+ It looks like you're using a browser we don't support. +

+

+ Please try again with the latest version of  + Chrome  + { + this._showFirefox() && <>or Firefox + } +

+
+ ); + } + + /** + * Returns whether or not a link to download Firefox is displayed. + * + * @private + * @returns {boolean} + */ + _showFirefox() { + return isBrowsersOptimal('firefox'); + } +} + +export default translate(JaasUnsupportedDesktopBrowser); diff --git a/react/features/unsupported-browser/components/JaasUnsupportedDesktopBrowser.js b/react/features/unsupported-browser/components/JaasUnsupportedDesktopBrowser.js new file mode 100644 index 0000000000..6a6727099d --- /dev/null +++ b/react/features/unsupported-browser/components/JaasUnsupportedDesktopBrowser.js @@ -0,0 +1 @@ +export { default } from './DefaultUnsupportedDesktopBrowser'; diff --git a/react/features/unsupported-browser/components/PageSelector.js b/react/features/unsupported-browser/components/PageSelector.js new file mode 100644 index 0000000000..256e7413b1 --- /dev/null +++ b/react/features/unsupported-browser/components/PageSelector.js @@ -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 ; + } + + return ; +}; + +export default PageSelector; diff --git a/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js b/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js index ed138ff5f7..6a6727099d 100644 --- a/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js +++ b/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js @@ -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 { - /** - * Renders the component. - * - * @returns {ReactElement} - */ - render() { - return ( -
-

- It looks like you're using a browser we don't support. -

-

- Please try again with the latest version of  - Chrome  - { - this._showFirefox() && <>or Firefox - } -

-
- ); - } - - /** - * 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'; diff --git a/react/features/unsupported-browser/components/index.js b/react/features/unsupported-browser/components/index.js index fc0d8e0fd2..9c688ddfc5 100644 --- a/react/features/unsupported-browser/components/index.js +++ b/react/features/unsupported-browser/components/index.js @@ -1,2 +1 @@ -export { default as UnsupportedDesktopBrowser } - from './UnsupportedDesktopBrowser'; +export { default as UnsupportedDesktopBrowser } from './PageSelector';