Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
33 lines
648 B
TypeScript
33 lines
648 B
TypeScript
import Platform from '../react/Platform';
|
|
|
|
/**
|
|
* Returns whether or not the current environment is a mobile device.
|
|
*
|
|
* @returns {boolean}
|
|
*/
|
|
export function isMobileBrowser() {
|
|
return Platform.OS === 'android' || Platform.OS === 'ios';
|
|
}
|
|
|
|
|
|
/**
|
|
* Returns whether or not the current environment is an ios mobile device.
|
|
*
|
|
* @returns {boolean}
|
|
*/
|
|
export function isIosMobileBrowser() {
|
|
return Platform.OS === 'ios';
|
|
}
|
|
|
|
/**
|
|
* Returns whether or not the current environment is an ipad device.
|
|
*
|
|
* @returns {boolean}
|
|
*/
|
|
export function isIpadMobileBrowser() {
|
|
|
|
// @ts-ignore
|
|
return isIosMobileBrowser() && Platform.isPad;
|
|
}
|
|
|