Update react-hook-form, focus login on tab press
This commit is contained in:
parent
2c43a8e0d2
commit
77277c8c3e
24 changed files with 169 additions and 101 deletions
31
crabfit-frontend/src/utils/index.ts
Normal file
31
crabfit-frontend/src/utils/index.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
export const detect_browser = () => {
|
||||
// Opera 8.0+
|
||||
const isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
||||
|
||||
// Firefox 1.0+
|
||||
const isFirefox = typeof InstallTrigger !== 'undefined';
|
||||
|
||||
// Safari 3.0+ "[object HTMLElementConstructor]"
|
||||
const isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && window['safari'].pushNotification));
|
||||
|
||||
// Internet Explorer 6-11
|
||||
const isIE = /*@cc_on!@*/false || !!document.documentMode;
|
||||
|
||||
// Edge 20+
|
||||
const isEdge = !isIE && !!window.StyleMedia;
|
||||
|
||||
// Chrome 1 - 79
|
||||
const isChrome = !!window.chrome;
|
||||
|
||||
// Edge (based on chromium) detection
|
||||
// eslint-disable-next-line
|
||||
const isEdgeChromium = isChrome && (navigator.userAgent.indexOf("Edg") != -1);
|
||||
|
||||
if (isEdgeChromium) return 'edge_chromium';
|
||||
if (isChrome) return 'chrome';
|
||||
if (isEdge) return 'edge';
|
||||
if (isIE) return 'ie';
|
||||
if (isSafari) return 'safari';
|
||||
if (isFirefox) return 'firefox';
|
||||
if (isOpera) return 'opera';
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue