2017-02-07 14:45:51 +00:00
|
|
|
/* @flow */
|
|
|
|
|
2017-01-25 22:11:44 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2017-03-01 02:55:12 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2018-06-27 09:43:13 +00:00
|
|
|
import { Platform } from '../../base/react';
|
2017-02-16 20:00:54 +00:00
|
|
|
|
2018-06-27 10:20:46 +00:00
|
|
|
import { CHROME, EDGE, FIREFOX, SAFARI } 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
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The type of the React {@code Component} props of
|
|
|
|
* {@link UnsupportedDesktopBrowser}.
|
2017-01-25 22:11:44 +00:00
|
|
|
*/
|
2018-10-30 05:02:23 +00:00
|
|
|
type Props = {
|
|
|
|
|
2017-02-23 16:56:25 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The function to translate human-readable text.
|
2017-02-23 16:56:25 +00:00
|
|
|
*/
|
2018-10-30 05:02:23 +00:00
|
|
|
t: Function
|
|
|
|
};
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2018-10-30 05:02:23 +00:00
|
|
|
/**
|
|
|
|
* 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` }>
|
2017-02-02 16:01:03 +00:00
|
|
|
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
|
2017-01-25 22:11:44 +00:00
|
|
|
<a
|
2017-03-01 02:55:12 +00:00
|
|
|
className = { `${_SNS}__link` }
|
2017-02-02 16:01:03 +00:00
|
|
|
href = { CHROME } >Chrome</a>,
|
|
|
|
<a
|
2017-03-01 02:55:12 +00:00
|
|
|
className = { `${_SNS}__link` }
|
2017-02-16 20:00:54 +00:00
|
|
|
href = { FIREFOX }>Firefox</a> or
|
2017-02-28 03:22:32 +00:00
|
|
|
{
|
|
|
|
this._renderOSSpecificBrowserDownloadLink()
|
|
|
|
}
|
2017-02-02 16:01:03 +00:00
|
|
|
</p>
|
2017-01-25 22:11:44 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-02-16 20:00:54 +00:00
|
|
|
|
|
|
|
/**
|
2017-02-28 03:22:32 +00:00
|
|
|
* Depending on the platform returns the link to Safari browser.
|
2017-02-16 20:00:54 +00:00
|
|
|
*
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
* @private
|
|
|
|
*/
|
2017-02-28 03:22:32 +00:00
|
|
|
_renderOSSpecificBrowserDownloadLink() {
|
|
|
|
let link;
|
|
|
|
let text;
|
2017-02-16 20:00:54 +00:00
|
|
|
|
2017-02-28 03:22:32 +00:00
|
|
|
switch (Platform.OS) {
|
|
|
|
case 'macos':
|
|
|
|
link = SAFARI;
|
|
|
|
text = 'Safari';
|
|
|
|
break;
|
2017-02-16 20:00:54 +00:00
|
|
|
|
2017-02-28 03:22:32 +00:00
|
|
|
case 'windows':
|
2018-06-27 10:20:46 +00:00
|
|
|
link = EDGE;
|
|
|
|
text = 'Edge';
|
2017-02-28 03:22:32 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (typeof link !== 'undefined') {
|
2017-02-16 20:00:54 +00:00
|
|
|
return (
|
|
|
|
<a
|
2017-03-01 02:55:12 +00:00
|
|
|
className = { `${_SNS}__link` }
|
2017-02-28 03:22:32 +00:00
|
|
|
href = { link }>
|
|
|
|
{
|
|
|
|
text
|
|
|
|
}
|
|
|
|
</a>
|
2017-02-16 20:00:54 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2017-01-25 22:11:44 +00:00
|
|
|
}
|
2017-02-02 16:01:03 +00:00
|
|
|
|
2017-02-23 16:56:25 +00:00
|
|
|
export default translate(UnsupportedDesktopBrowser);
|