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

UnsupportedDesktopBrowser.js 2.2KB

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