jiti-meet/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js

74 lines
1.8 KiB
JavaScript
Raw Normal View History

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