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

UnsupportedDesktopBrowser.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { Platform } from '../../base/react';
  4. import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
  5. /**
  6. * Describes styles namespace for this component.
  7. *
  8. * @type {string}
  9. */
  10. const NS = 'unsupported-desktop-browser';
  11. /**
  12. * React component representing unsupported browser page.
  13. *
  14. * @class UnsupportedDesktopBrowser
  15. */
  16. export default class UnsupportedDesktopBrowser extends Component {
  17. /**
  18. * Renders the component.
  19. *
  20. * @returns {ReactElement}
  21. */
  22. render() {
  23. return (
  24. <div className = { NS }>
  25. <h2 className = { `${NS}__title` }>
  26. It looks like you're using a browser we don't support.
  27. </h2>
  28. <p className = { `${NS}__description` }>
  29. Please try again with the latest version of&nbsp;
  30. <a
  31. className = { `${NS}__link` }
  32. href = { CHROME } >Chrome</a>,&nbsp;
  33. <a
  34. className = { `${NS}__link` }
  35. href = { FIREFOX }>Firefox</a> or&nbsp;
  36. { this._showSafariLinkIfRequired() }
  37. { this._showIELinkIfRequired() }.
  38. </p>
  39. </div>
  40. );
  41. }
  42. /**
  43. * Depending on the platform returns the link to IE browser.
  44. *
  45. * @returns {ReactElement|null}
  46. * @private
  47. */
  48. _showIELinkIfRequired() {
  49. if (Platform.OS === 'windows') {
  50. return (
  51. <a
  52. className = { `${NS}__link` }
  53. href = { IE }>IE</a>
  54. );
  55. }
  56. return null;
  57. }
  58. /**
  59. * Depending on the platform returns the link to Safari browser.
  60. *
  61. * @returns {ReactElement|null}
  62. * @private
  63. */
  64. _showSafariLinkIfRequired() {
  65. if (Platform.OS === 'mac') {
  66. return (
  67. <a
  68. className = { `${NS}__link` }
  69. href = { SAFARI }>Safari</a>
  70. );
  71. }
  72. return null;
  73. }
  74. }