您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

UnsupportedDesktopBrowser.js 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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> and&nbsp;
  45. <a
  46. className = { `${_SNS}__link` }
  47. href = { FIREFOX }>Firefox</a>&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. /*
  70. case 'windows':
  71. link = EDGE;
  72. text = 'Edge';
  73. break;
  74. */
  75. }
  76. if (typeof link !== 'undefined') {
  77. return (
  78. <span>
  79. or&nbsp;
  80. <a
  81. className = { `${_SNS}__link` }
  82. href = { link }>
  83. {
  84. text
  85. }
  86. </a>
  87. </span>
  88. );
  89. }
  90. return null;
  91. }
  92. }
  93. export default translate(UnsupportedDesktopBrowser);