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.4KB

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