forked from testshallpass/react-native-dropdownalert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.js
36 lines (35 loc) · 1014 Bytes
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {StatusBar, Platform, Dimensions} from 'react-native';
export const DEFAULT_IMAGE_DIMENSIONS = 36;
export const WINDOW = Dimensions.get('window');
export const HEIGHT = WINDOW.height;
export const WIDTH = WINDOW.width;
export const IS_ANDROID = Platform.OS === 'android';
const IS_IOS = Platform.OS === 'ios';
const PLATFORM_VERSION = parseInt(Platform.Version, 10);
export const IS_IOS_BELOW_11 = IS_IOS && PLATFORM_VERSION < 11;
export const TYPE = {
info: 'info',
warn: 'warn',
error: 'error',
success: 'success',
custom: 'custom',
};
export const ACTION = {
automatic: 'automatic',
cancel: 'cancel',
pan: 'pan',
programmatic: 'programmatic',
tap: 'tap',
};
export function getDefaultStatusBarStyle() {
if (StatusBar._defaultProps) {
return StatusBar._defaultProps.barStyle.value;
}
return 'default';
}
export function getDefaultStatusBarBackgroundColor() {
if (StatusBar._defaultProps) {
return StatusBar._defaultProps.backgroundColor.value;
}
return 'black';
}