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.

UnsupportedBrowserPage.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import React, { Component } from 'react';
  2. /**
  3. * Array of all supported browsers.
  4. */
  5. const SUPPORTED_BROWSERS = [
  6. {
  7. link: 'http://google.com/chrome',
  8. name: 'chrome',
  9. plugin: false,
  10. title: 'Chrome 44+'
  11. }, {
  12. link: 'http://www.chromium.org/',
  13. name: 'chromium',
  14. plugin: false,
  15. title: 'Chromium 44+'
  16. }, {
  17. link: 'http://www.opera.com',
  18. name: 'opera',
  19. plugin: false,
  20. title: 'Opera 32+'
  21. }, {
  22. link: 'http://www.getfirefox.com/',
  23. name: 'firefox',
  24. plugin: false,
  25. title: 'Firefox and Iceweasel 40+'
  26. }, {
  27. link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
  28. name: 'ie',
  29. plugin: 'Temasys 0.8.854+',
  30. title: 'IE'
  31. }, {
  32. link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
  33. name: 'safari',
  34. plugin: 'Temasys 0.8.854+',
  35. title: 'Safari'
  36. }
  37. ];
  38. /**
  39. * React component representing unsupported browser page.
  40. *
  41. * @class UnsupportedBrowserPage
  42. */
  43. export default class UnsupportedBrowserPage extends Component {
  44. /**
  45. * Renders the component.
  46. *
  47. * @returns {ReactElement}
  48. */
  49. render() {
  50. return (
  51. <div className = 'unsupported-browser-wrapper'>
  52. <div className = 'unsupported-browser'>
  53. <div className = 'unsupported-browser__content'>
  54. <h2 className = 'unsupported-browser__title'>
  55. This application is currently only supported by
  56. </h2>
  57. { this._getSupportedBrowsersLayout() }
  58. </div>
  59. </div>
  60. </div>
  61. );
  62. }
  63. /**
  64. * Generates layout for the list of supported browsers.
  65. *
  66. * @returns {ReactElement}
  67. * @private
  68. */
  69. _getSupportedBrowsersLayout() {
  70. return (
  71. <div className = 'browser-list'>
  72. { SUPPORTED_BROWSERS.map(this._getSupportedBrowser) }
  73. </div>
  74. );
  75. }
  76. /**
  77. * Method that generated layout for supported browser object.
  78. *
  79. * @param {Object} browser - Object containing information about supported
  80. * browser.
  81. * @returns {ReactElement}
  82. * @private
  83. */
  84. _getSupportedBrowser(browser) {
  85. let pluginHtml = null;
  86. const logoClassName = `browser__logo browser__logo_${browser.name}`;
  87. // Browsers not supporting WebRTC could support application
  88. // with Temasys plugin installed.
  89. if (browser.plugin) {
  90. const className = 'browser__text_small';
  91. pluginHtml = <p className = { className }>({ browser.plugin })</p>;
  92. }
  93. return (
  94. <div className = 'browser'>
  95. <div className = 'browser__text'>
  96. { browser.title }
  97. { pluginHtml }
  98. </div>
  99. <div className = 'browser__tile'>
  100. <div className = { logoClassName } />
  101. <a
  102. className = 'browser__link'
  103. href = { browser.link }>
  104. <div className = 'browser__button'>DOWNLOAD</div>
  105. </a>
  106. </div>
  107. </div>
  108. );
  109. }
  110. }