Files
jitsi-meet/react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js

101 lines
2.4 KiB
JavaScript
Raw Normal View History

2017-02-07 16:45:51 +02:00
/* @flow */
2017-01-25 16:11:44 -06:00
import React, { Component } from 'react';
2017-02-28 20:55:12 -06:00
import { translate } from '../../base/i18n';
import { Platform } from '../../base/react';
2017-02-16 14:00:54 -06:00
import { CHROME, EDGE, FIREFOX, SAFARI } from './browserLinks';
2017-01-25 16:11:44 -06:00
2017-02-16 14:00:54 -06:00
/**
2017-02-28 20:55:12 -06:00
* The namespace of the CSS styles of UnsupportedDesktopBrowser.
2017-02-16 14:00:54 -06:00
*
2017-02-27 22:31:55 -06:00
* @private
2017-02-16 14:00:54 -06:00
* @type {string}
*/
2017-02-28 20:55:12 -06:00
const _SNS = 'unsupported-desktop-browser';
2017-02-16 14:00:54 -06:00
2017-01-25 16:11:44 -06:00
/**
* The type of the React {@code Component} props of
* {@link UnsupportedDesktopBrowser}.
2017-01-25 16:11:44 -06: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 16:11:44 -06:00
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
return (
2017-02-28 20:55:12 -06:00
<div className = { _SNS }>
<h2 className = { `${_SNS}__title` }>
It looks like you're using a browser we don't support.
</h2>
2017-02-28 20:55:12 -06:00
<p className = { `${_SNS}__description` }>
2017-02-07 16:45:51 +02:00
Please try again with the latest version of&nbsp;
2017-01-25 16:11:44 -06:00
<a
2017-02-28 20:55:12 -06:00
className = { `${_SNS}__link` }
href = { CHROME } >Chrome</a>,&nbsp;
<a
2017-02-28 20:55:12 -06:00
className = { `${_SNS}__link` }
2017-02-16 14:00:54 -06:00
href = { FIREFOX }>Firefox</a> or&nbsp;
{
this._renderOSSpecificBrowserDownloadLink()
}
</p>
2017-01-25 16:11:44 -06:00
</div>
);
}
2017-02-16 14:00:54 -06:00
/**
* Depending on the platform returns the link to Safari browser.
2017-02-16 14:00:54 -06:00
*
* @returns {ReactElement|null}
* @private
*/
_renderOSSpecificBrowserDownloadLink() {
let link;
let text;
2017-02-16 14:00:54 -06:00
switch (Platform.OS) {
case 'macos':
link = SAFARI;
text = 'Safari';
break;
2017-02-16 14:00:54 -06:00
case 'windows':
link = EDGE;
text = 'Edge';
break;
}
if (typeof link !== 'undefined') {
2017-02-16 14:00:54 -06:00
return (
<a
2017-02-28 20:55:12 -06:00
className = { `${_SNS}__link` }
href = { link }>
{
text
}
</a>
2017-02-16 14:00:54 -06:00
);
}
return null;
}
2017-01-25 16:11:44 -06:00
}
export default translate(UnsupportedDesktopBrowser);