2021-07-18 18:34:03 +02:00
|
|
|
import { Platform } from 'react-native';
|
2021-05-29 07:57:40 +02:00
|
|
|
import { getSystemName, isTablet, getDeviceType } from 'react-native-device-info';
|
2020-12-18 22:15:38 +01:00
|
|
|
|
|
|
|
const isMacCatalina = getSystemName() === 'Mac OS X';
|
2021-07-18 18:34:03 +02:00
|
|
|
const isDesktop = getDeviceType() === 'Desktop';
|
2021-07-20 15:10:45 +02:00
|
|
|
const getIsTorCapable = () => {
|
2021-07-18 18:34:03 +02:00
|
|
|
let capable = true;
|
|
|
|
if (Platform.OS === 'android' && Platform.Version < 26) {
|
|
|
|
capable = false;
|
|
|
|
} else if (isDesktop) {
|
|
|
|
capable = false;
|
|
|
|
}
|
|
|
|
return capable;
|
|
|
|
};
|
2020-12-18 22:15:38 +01:00
|
|
|
|
2021-07-20 15:10:45 +02:00
|
|
|
export const isHandset = getDeviceType() === 'Handset';
|
|
|
|
export const isTorCapable = getIsTorCapable();
|
|
|
|
export { isMacCatalina, isDesktop, isTablet };
|