mirror of
https://github.com/vercel/commerce.git
synced 2025-03-15 15:02:32 +00:00
17 lines
494 B
TypeScript
17 lines
494 B
TypeScript
|
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'
|
||
|
}
|