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

UnsupportedDesktopBrowser.js 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { Platform } from '../../base/react';
  4. import { translate } from '../../base/translation';
  5. import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
  6. import HideNotificationBarStyle from './HideNotificationBarStyle';
  7. /**
  8. * The CSS style namespace of UnsupportedDesktopBrowser.
  9. *
  10. * @private
  11. * @type {string}
  12. */
  13. const _NS = 'unsupported-desktop-browser';
  14. /**
  15. * React component representing unsupported browser page.
  16. *
  17. * @class UnsupportedDesktopBrowser
  18. */
  19. class UnsupportedDesktopBrowser extends Component {
  20. /**
  21. * UnsupportedDesktopBrowser component's property types.
  22. *
  23. * @static
  24. */
  25. static propTypes = {
  26. t: React.PropTypes.func
  27. }
  28. /**
  29. * Renders the component.
  30. *
  31. * @returns {ReactElement}
  32. */
  33. render() {
  34. return (
  35. <div className = { _NS }>
  36. <h2 className = { `${_NS}__title` }>
  37. It looks like you're using a browser we don't support.
  38. </h2>
  39. <p className = { `${_NS}__description` }>
  40. Please try again with the latest version of&nbsp;
  41. <a
  42. className = { `${_NS}__link` }
  43. href = { CHROME } >Chrome</a>,&nbsp;
  44. <a
  45. className = { `${_NS}__link` }
  46. href = { FIREFOX }>Firefox</a> or&nbsp;
  47. {
  48. this._renderOSSpecificBrowserDownloadLink()
  49. }
  50. </p>
  51. <HideNotificationBarStyle />
  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 = IE;
  71. text = 'Internet Explorer';
  72. break;
  73. }
  74. if (typeof link !== 'undefined') {
  75. return (
  76. <a
  77. className = { `${_NS}__link` }
  78. href = { link }>
  79. {
  80. text
  81. }
  82. </a>
  83. );
  84. }
  85. return null;
  86. }
  87. }
  88. export default translate(UnsupportedDesktopBrowser);