mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Cursor for Product View
This commit is contained in:
16
lib/browser.ts
Normal file
16
lib/browser.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as Bowser from 'bowser'
|
||||
|
||||
export function isDesktop(): boolean {
|
||||
const browser = Bowser.getParser(window.navigator.userAgent)
|
||||
return browser.getPlatform().type === 'desktop'
|
||||
}
|
||||
|
||||
export function isMobile(): boolean {
|
||||
const browser = Bowser.getParser(window.navigator.userAgent)
|
||||
return browser.getPlatform().type === 'mobile'
|
||||
}
|
||||
|
||||
export function isTablet(): boolean {
|
||||
const browser = Bowser.getParser(window.navigator.userAgent)
|
||||
return browser.getPlatform().type === 'tablet'
|
||||
}
|
Reference in New Issue
Block a user