-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathcommon-styles.js
41 lines (35 loc) · 861 Bytes
/
common-styles.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
import { Dimensions, Platform } from 'react-native';
export const os = Platform.OS;
export const width = Dimensions.get('window').width;
export const height = Dimensions.get('screen').height;
const DESIGN_DIMENSIONS = { width: 375, height: 812 };
export const getPercentageHeight = (heightParam) => {
return Platform.select({
ios: height * (heightParam / DESIGN_DIMENSIONS.height),
android: heightParam,
});
};
export const getPercentageWidth = (widthParam) => {
return Platform.select({
ios: width * (widthParam / DESIGN_DIMENSIONS.width),
android: widthParam,
});
};
export const textStyle = {
small: {
fontSize: 12,
fontWeight: '200',
},
medium: {
fontSize: 14,
fontWeight: '300',
},
normal: {
fontSize: 16,
fontWeight: '400',
},
heading: {
fontSize: 18,
fontWeight: '800',
},
};