You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.ts 648B

1234567891011121314151617181920212223242526272829303132
  1. import Platform from '../react/Platform';
  2. /**
  3. * Returns whether or not the current environment is a mobile device.
  4. *
  5. * @returns {boolean}
  6. */
  7. export function isMobileBrowser() {
  8. return Platform.OS === 'android' || Platform.OS === 'ios';
  9. }
  10. /**
  11. * Returns whether or not the current environment is an ios mobile device.
  12. *
  13. * @returns {boolean}
  14. */
  15. export function isIosMobileBrowser() {
  16. return Platform.OS === 'ios';
  17. }
  18. /**
  19. * Returns whether or not the current environment is an ipad device.
  20. *
  21. * @returns {boolean}
  22. */
  23. export function isIpadMobileBrowser() {
  24. // @ts-ignore
  25. return isIosMobileBrowser() && Platform.isPad;
  26. }