-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppStyles.js
47 lines (44 loc) · 1.13 KB
/
AppStyles.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
import { StyleSheet, Dimensions } from 'react-native';
// screen sizing
const { width, height } = Dimensions.get('window');
// orientation must fixed
const SCREEN_WIDTH = width < height ? width : height;
const recipeNumColums = 2;
// item size
const RECIPE_ITEM_HEIGHT = 150;
const RECIPE_ITEM_MARGIN = 20;
// 2 photos per width
export const RecipeCard = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
marginLeft: RECIPE_ITEM_MARGIN,
marginTop: 20,
width: (SCREEN_WIDTH - (recipeNumColums + 1) * RECIPE_ITEM_MARGIN) / recipeNumColums,
height: RECIPE_ITEM_HEIGHT + 75,
borderColor: '#cccccc',
borderWidth: 0.5,
borderRadius: 15
},
photo: {
width: (SCREEN_WIDTH - (recipeNumColums + 1) * RECIPE_ITEM_MARGIN) / recipeNumColums,
height: RECIPE_ITEM_HEIGHT,
borderRadius: 15,
borderBottomLeftRadius: 0,
borderBottomRightRadius: 0
},
title: {
flex: 1,
fontSize: 17,
fontWeight: 'bold',
color: '#444444',
marginTop: 3,
marginRight: 5,
marginLeft: 5,
},
category: {
marginTop: 5,
marginBottom: 5
}
});