|
1 | 1 | import { StatusBar, Platform, Dimensions } from 'react-native'; |
2 | 2 |
|
3 | | -const DEFAULT_IMAGE_DIMENSIONS = 36; |
4 | | -const WINDOW = Dimensions.get('window'); |
5 | | -const HEIGHT = WINDOW.height; |
6 | | -const WIDTH = WINDOW.width; |
| 3 | +export const DEFAULT_IMAGE_DIMENSIONS = 36; |
| 4 | +export const WINDOW = Dimensions.get('window'); |
| 5 | +export const HEIGHT = WINDOW.height; |
| 6 | +export const WIDTH = WINDOW.width; |
| 7 | +export const IS_ANDROID = Platform.OS == 'android'; |
7 | 8 | const IS_IOS = Platform.OS == 'ios'; |
8 | | -const IS_ANDROID = Platform.OS == 'android'; |
9 | | -const IS_IOS_BELOW_11 = IS_IOS && parseInt(Platform.Version, 10) < 11; |
10 | | -const TYPE = { |
| 9 | +const PLATFORM_VERSION = parseInt(Platform.Version, 10); |
| 10 | +export const IS_IOS_BELOW_11 = IS_IOS && PLATFORM_VERSION < 11; |
| 11 | +export const TYPE = { |
11 | 12 | info: 'info', |
12 | 13 | warn: 'warn', |
13 | 14 | error: 'error', |
14 | 15 | success: 'success', |
15 | 16 | custom: 'custom', |
16 | 17 | }; |
17 | | -const ACTION = { |
| 18 | +export const ACTION = { |
18 | 19 | automatic: 'automatic', |
19 | 20 | cancel: 'cancel', |
20 | 21 | pan: 'pan', |
21 | 22 | programmatic: 'programmatic', |
22 | 23 | tap: 'tap', |
23 | 24 | }; |
24 | | -const getDefaultStatusBarStyle = () => { |
| 25 | +export function getDefaultStatusBarStyle() { |
25 | 26 | if (StatusBar._defaultProps) { |
26 | 27 | return StatusBar._defaultProps.barStyle.value; |
27 | 28 | } |
28 | 29 | return 'default'; |
29 | 30 | }; |
30 | | -const getDefaultStatusBarBackgroundColor = () => { |
| 31 | +export function getDefaultStatusBarBackgroundColor() { |
31 | 32 | if (StatusBar._defaultProps) { |
32 | 33 | return StatusBar._defaultProps.backgroundColor.value; |
33 | 34 | } |
34 | 35 | return 'black'; |
35 | 36 | }; |
36 | | - |
37 | | -module.exports = { |
38 | | - DEFAULT_IMAGE_DIMENSIONS, |
39 | | - WINDOW, |
40 | | - HEIGHT, |
41 | | - WIDTH, |
42 | | - IS_IOS, |
43 | | - IS_ANDROID, |
44 | | - IS_IOS_BELOW_11, |
45 | | - TYPE, |
46 | | - ACTION, |
47 | | - getDefaultStatusBarStyle, |
48 | | - getDefaultStatusBarBackgroundColor, |
49 | | -}; |
0 commit comments