forked from redbaron76/navbar-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.js
93 lines (80 loc) · 2.29 KB
/
utils.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { Platform, Dimensions } from 'react-native';
export function iOS(a, b) {
return Platform.OS == 'ios' ? a : b;
}
export function isIOS() {
return Platform.OS == 'ios';
}
export function iconName(prefix, name) {
return `${prefix}-${name}`;
}
export function fixIconName(icon) {
switch (true) {
case (isIOS() && icon.startsWith('md-')):
return icon.replace('md-', 'ios-');
case (!isIOS() && icon.startsWith('ios-')):
return icon.replace('ios-', 'md-');
default:
return icon;
}
}
export const size = {
iconSize: iOS(30, 28),
iconStyle: {
marginTop: iOS(4, 0),
},
navBarButtonContainer: {
left: iOS(8, 12),
right: iOS(8, 12),
},
navBarButtonText: {
marginBottom: iOS(0, 0),
},
navBarTitleText: {
marginLeft: iOS(0, 16),
fontWeight: iOS('500', '400'),
},
navBarHeight: 44,
statusBarHeight: 20,
screenWidth: Dimensions.get('window').width,
screenHeight: Dimensions.get('window').height,
};
export const font = {
buttonText: iOS('HelveticaNeue-Medium', 'Roboto'),
titleText: iOS('HelveticaNeue-Medium', 'Roboto'),
};
export const color = {
bgNavbarColor: iOS('#f2f2f2', '#212121'),
bgContentColor: iOS('#000000', '#303030'),
bgLoadingColor: iOS('rgba(0,0,0,.8)','rgba(0,0,0,.8)'),
buttonColor: iOS('#387afe', '#ffffff'),
titleColor: iOS('#000000', '#ffffff'),
borderColor: iOS('#ceced2', '#757575'),
white: '#ffffff',
};
export const theme = {
light: {
bgNavbarColor: iOS('#f2f2f2', '#f5f5f5'),
buttonColor: iOS('#387afe', '#707070'),
titleColor: iOS('#000000', '#000000'),
badgeBgColor: iOS('#2b2b2b', '#212121'),
badgeTextColor: iOS('#f2f2f2', '#f5f5f5'),
statusBar: iOS({
style: 'default'
}, {
backgroundColor: '#707070',
})
},
dark: {
bgNavbarColor: iOS('#2b2b2b', '#212121'),
buttonColor: iOS('#ffffff', '#ffffff'),
titleColor: iOS('#ffffff', '#ffffff'),
badgeBgColor: iOS('#f2f2f2', '#f5f5f5'),
badgeTextColor: iOS('#2b2b2b', '#212121'),
statusBar: iOS({
style: 'light-content'
}, {
backgroundColor: '#000000',
})
}
};