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 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { isBrowsersOptimal } from '../../base/environment';
  4. import { translate } from '../../base/i18n';
  5. import { CHROME, FIREFOX } 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. {
  46. this._showFirefox() && <>or <a
  47. className = { `${_SNS}__link` }
  48. href = { FIREFOX }>Firefox</a></>
  49. }
  50. </p>
  51. </div>
  52. );
  53. }
  54. /**
  55. * Returns whether or not a link to download Firefox is displayed.
  56. *
  57. * @private
  58. * @returns {boolean}
  59. */
  60. _showFirefox() {
  61. return isBrowsersOptimal('firefox');
  62. }
  63. }
  64. export default translate(UnsupportedDesktopBrowser);