UNPKG

985 BJavaScriptView Raw
1import React from 'react'
2
3export default class BrowserDetection {
4 static isFF = () => typeof InstallTrigger !== 'undefined'
5 static isIE = () => window.ActiveXObject || 'ActiveXObject' in window
6 /*
7 isIEsxe = check for windows Internet Explorer v6-11
8 see: https://tinyurl.com/yy88yz9k for more info
9 */
10 static isIEsxe = () => /*@cc_on!@*/false || !!document.documentMode
11 static isSafari = () => navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1
12 static isMobile = () => {
13 try {
14 document.createEvent('TouchEvent')
15 return true
16 } catch (e) {
17 return false
18 }
19 }
20}
21
22export const IEUpgradeMessage = () => {
23 return (
24 <div style={{ margin: '10px' }}>
25 <h1>Oops! Unfortunately, we are having trouble loading the site with this version
26 of Internet Explorer. Please try using <a href="https://www.google.com/chrome/">
27 Chrome</a> as your web browser.</h1>
28 </div>
29 )
30}