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

89 lines
2.2 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';
2017-02-16 20:00:54 +00:00
import { Platform } from '../../base/react';
import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
import HideNotificationBarStyle from './HideNotificationBarStyle';
2017-01-25 22:11:44 +00:00
2017-02-16 20:00:54 +00:00
/**
* Describes styles namespace for this component.
*
* @type {string}
*/
const NS = 'unsupported-desktop-browser';
2017-01-25 22:11:44 +00:00
/**
* React component representing unsupported browser page.
*
* @class UnsupportedDesktopBrowser
*/
export default class UnsupportedDesktopBrowser extends Component {
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
return (
2017-02-16 20:00:54 +00:00
<div className = { NS }>
<h2 className = { `${NS}__title` }>
It looks like you're using a browser we don't support.
</h2>
2017-02-16 20:00:54 +00:00
<p className = { `${NS}__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-02-16 20:00:54 +00:00
className = { `${NS}__link` }
href = { CHROME } >Chrome</a>,&nbsp;
<a
2017-02-16 20:00:54 +00:00
className = { `${NS}__link` }
href = { FIREFOX }>Firefox</a> or&nbsp;
{
this._renderOSSpecificBrowserDownloadLink()
}
</p>
<HideNotificationBarStyle />
2017-01-25 22:11:44 +00:00
</div>
);
}
2017-02-16 20:00:54 +00:00
/**
* Depending on the platform returns the link to Safari browser.
2017-02-16 20:00:54 +00:00
*
* @returns {ReactElement|null}
* @private
*/
_renderOSSpecificBrowserDownloadLink() {
let link;
let text;
2017-02-16 20:00:54 +00:00
switch (Platform.OS) {
case 'macos':
link = SAFARI;
text = 'Safari';
break;
2017-02-16 20:00:54 +00:00
case 'windows':
link = IE;
text = 'Internet Explorer';
break;
}
if (typeof link !== 'undefined') {
2017-02-16 20:00:54 +00:00
return (
<a
className = { `${NS}__link` }
href = { link }>
{
text
}
</a>
2017-02-16 20:00:54 +00:00
);
}
return null;
}
2017-01-25 22:11:44 +00:00
}