diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-14 06:30:27 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-14 06:30:27 +0800 |
commit | c8b2a975f47bdacd1cc255c92ffbe3906b36e7be (patch) | |
tree | bb0b50577029fb9894250a4e3bf2aaf7bd01a1d8 /packages/instant/src/util | |
parent | 8a64599ca5ad23df8f4aec0b48776c4ae5a78d83 (diff) | |
download | dexon-sol-tools-c8b2a975f47bdacd1cc255c92ffbe3906b36e7be.tar.gz dexon-sol-tools-c8b2a975f47bdacd1cc255c92ffbe3906b36e7be.tar.zst dexon-sol-tools-c8b2a975f47bdacd1cc255c92ffbe3906b36e7be.zip |
feat: change install wallet panel content based on browser and os
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/env.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/packages/instant/src/util/env.ts b/packages/instant/src/util/env.ts new file mode 100644 index 000000000..038ec6c88 --- /dev/null +++ b/packages/instant/src/util/env.ts @@ -0,0 +1,42 @@ +import * as bowser from 'bowser'; + +import { Browser, OperatingSystem } from '../types'; + +export const envUtil = { + getBrowser(): Browser { + if (bowser.chrome) { + return Browser.Chrome; + } else if (bowser.firefox) { + return Browser.Firefox; + } else if (bowser.opera) { + return Browser.Opera; + } else if (bowser.msedge) { + return Browser.Edge; + } else if (bowser.safari) { + return Browser.Safari; + } else { + return Browser.Other; + } + }, + isMobileOperatingSystem(): boolean { + return true; + }, + getOperatingSystem(): OperatingSystem { + return OperatingSystem.iOS; + // if (bowser.android) { + // return OperatingSystem.Android; + // } else if (bowser.ios) { + // return OperatingSystem.iOS; + // } else if (bowser.mac) { + // return OperatingSystem.Mac; + // } else if (bowser.windows) { + // return OperatingSystem.Windows; + // } else if (bowser.windowsphone) { + // return OperatingSystem.WindowsPhone; + // } else if (bowser.linux) { + // return OperatingSystem.Linux; + // } else { + // return OperatingSystem.Other; + // } + }, +}; |