You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UnsupportedDesktopBrowser.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { Platform } from '../../base/react';
  4. import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
  5. import HideNotificationBarStyle from './HideNotificationBarStyle';
  6. /**
  7. * Describes styles namespace for this component.
  8. *
  9. * @type {string}
  10. */
  11. const NS = 'unsupported-desktop-browser';
  12. /**
  13. * React component representing unsupported browser page.
  14. *
  15. * @class UnsupportedDesktopBrowser
  16. */
  17. export default class UnsupportedDesktopBrowser extends Component {
  18. /**
  19. * Renders the component.
  20. *
  21. * @returns {ReactElement}
  22. */
  23. render() {
  24. return (
  25. <div className = { NS }>
  26. <h2 className = { `${NS}__title` }>
  27. It looks like you're using a browser we don't support.
  28. </h2>
  29. <p className = { `${NS}__description` }>
  30. Please try again with the latest version of&nbsp;
  31. <a
  32. className = { `${NS}__link` }
  33. href = { CHROME } >Chrome</a>,&nbsp;
  34. <a
  35. className = { `${NS}__link` }
  36. href = { FIREFOX }>Firefox</a> or&nbsp;
  37. {
  38. this._renderOSSpecificBrowserDownloadLink()
  39. }
  40. </p>
  41. <HideNotificationBarStyle />
  42. </div>
  43. );
  44. }
  45. /**
  46. * Depending on the platform returns the link to Safari browser.
  47. *
  48. * @returns {ReactElement|null}
  49. * @private
  50. */
  51. _renderOSSpecificBrowserDownloadLink() {
  52. let link;
  53. let text;
  54. switch (Platform.OS) {
  55. case 'macos':
  56. link = SAFARI;
  57. text = 'Safari';
  58. break;
  59. case 'windows':
  60. link = IE;
  61. text = 'Internet Explorer';
  62. break;
  63. }
  64. if (typeof link !== 'undefined') {
  65. return (
  66. <a
  67. className = { `${NS}__link` }
  68. href = { link }>
  69. {
  70. text
  71. }
  72. </a>
  73. );
  74. }
  75. return null;
  76. }
  77. }