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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import React, { Component } from 'react';
  2. /**
  3. * The list of all browsers supported by the application.
  4. */
  5. const SUPPORTED_BROWSERS = [
  6. {
  7. link: 'http://google.com/chrome',
  8. name: 'chrome',
  9. title: 'Chrome 44+'
  10. }, {
  11. link: 'http://www.chromium.org/',
  12. name: 'chromium',
  13. title: 'Chromium 44+'
  14. }, {
  15. link: 'http://www.getfirefox.com/',
  16. name: 'firefox',
  17. title: 'Firefox and Iceweasel 40+'
  18. }, {
  19. link: 'http://www.opera.com',
  20. name: 'opera',
  21. title: 'Opera 32+'
  22. }, {
  23. link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
  24. name: 'ie',
  25. plugin: 'Temasys 0.8.854+',
  26. title: 'IE'
  27. }, {
  28. link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
  29. name: 'safari',
  30. plugin: 'Temasys 0.8.854+',
  31. title: 'Safari'
  32. }
  33. ];
  34. /**
  35. * React component representing unsupported browser page.
  36. *
  37. * @class UnsupportedDesktopBrowser
  38. */
  39. export default class UnsupportedDesktopBrowser extends Component {
  40. /**
  41. * Renders the component.
  42. *
  43. * @returns {ReactElement}
  44. */
  45. render() {
  46. const ns = 'unsupported-desktop-browser';
  47. return (
  48. <div className = { `${ns}-wrapper` }>
  49. <div className = { ns }>
  50. <div className = { `${ns}__content` }>
  51. <h2 className = { `${ns}__title` }>
  52. This application is currently only supported by
  53. </h2>
  54. {
  55. this._renderSupportedBrowsers()
  56. }
  57. </div>
  58. </div>
  59. </div>
  60. );
  61. }
  62. /**
  63. * Renders a specific browser supported by the application.
  64. *
  65. * @param {Object} browser - The (information about the) browser supported
  66. * by the application to render.
  67. * @private
  68. * @returns {ReactElement}
  69. */
  70. _renderSupportedBrowser(browser) {
  71. const { link, name, plugin, title } = browser;
  72. const ns = 'supported-browser';
  73. // Browsers which do not support WebRTC could support the application
  74. // with the Temasys plugin.
  75. const pluginElement
  76. = plugin
  77. ? <p className = { `${ns}__text_small` }>{ plugin }</p>
  78. : null;
  79. return (
  80. <div
  81. className = { ns }
  82. key = { name }>
  83. <div className = { `${ns}__text` }>
  84. {
  85. title
  86. }
  87. {
  88. pluginElement
  89. }
  90. </div>
  91. <div className = { `${ns}__tile` }>
  92. <div
  93. className = { `${ns}__logo ${ns}__logo_${name}` } />
  94. <a
  95. className = { `${ns}__link` }
  96. href = { link }>
  97. <div className = { `${ns}__button` }>DOWNLOAD</div>
  98. </a>
  99. </div>
  100. </div>
  101. );
  102. }
  103. /**
  104. * Renders the list of browsers supported by the application.
  105. *
  106. * @private
  107. * @returns {ReactElement}
  108. */
  109. _renderSupportedBrowsers() {
  110. return (
  111. <div className = 'supported-browser-list'>
  112. {
  113. SUPPORTED_BROWSERS.map(this._renderSupportedBrowser)
  114. }
  115. </div>
  116. );
  117. }
  118. }