@@ -4,46 +4,58 @@ import { AppRegistry,View,Text,StyleSheet
4
4
5
5
export default class home extends Component {
6
6
static navigationOptions = {
7
- title : 'Welcome' ,
7
+ title : 'Welcome' ,
8
8
} ;
9
9
render ( ) {
10
10
const { navigate } = this . props . navigation ;
11
11
return (
12
- < View style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } >
13
- < Text style = { { margin : 10 , fontWeight : 'bold' , color : '#000' } } > Hello from home</ Text >
12
+ < View style = { styles . container } >
13
+ < Text style = { styles . pageName } > Hello from home</ Text >
14
14
15
- < TouchableOpacity
16
- style = { styles . cat }
17
- onPress = { ( ) => navigate ( 'Products' , { cat :'electronics' } ) }
18
- > < Text Text style = { { color : '#fff' } } > Electronics > </ Text >
15
+ < TouchableOpacity
16
+ style = { styles . cat }
17
+ onPress = { ( ) => navigate ( 'Products' , { cat :'electronics' , id : '1' } ) } >
18
+ < Text style = { styles . btnText } > Electronics > </ Text >
19
19
</ TouchableOpacity >
20
20
21
- < TouchableOpacity
22
- style = { styles . cat }
23
- onPress = { ( ) => navigate ( 'Products' , { cat :'automobiles' } ) }
24
- > < Text Text style = { { color : '#fff' } } > Automobiles > </ Text >
21
+ < TouchableOpacity
22
+ style = { styles . cat }
23
+ onPress = { ( ) => navigate ( 'Products' , { cat :'automobiles' , id : '2' } ) } >
24
+ < Text style = { styles . btnText } > Automobiles > </ Text >
25
25
</ TouchableOpacity >
26
26
27
27
< TouchableOpacity
28
- style = { styles . cat }
29
- onPress = { ( ) => navigate ( 'Products' , { cat :'Movies' } ) }
30
- > < Text Text style = { { color : '#fff' } } > Movies > </ Text >
31
- </ TouchableOpacity >
28
+ style = { styles . cat }
29
+ onPress = { ( ) => navigate ( 'Products' , { cat :'Movies' , id : '3' } ) } >
30
+ < Text style = { styles . btnText } > Movies > </ Text >
31
+ </ TouchableOpacity >
32
32
33
33
< TouchableOpacity
34
- style = { styles . cat }
35
- onPress = { ( ) => navigate ( 'Products' , { cat :'Books' } ) }
36
- > < Text Text style = { { color : '#fff' } } > Books > </ Text >
34
+ style = { styles . cat }
35
+ onPress = { ( ) => navigate ( 'Products' , { cat :'Books' , id : '4' } ) } >
36
+ < Text style = { styles . btnText } > Books > </ Text >
37
37
</ TouchableOpacity >
38
38
39
+
39
40
</ View >
40
41
) ;
41
42
}
42
43
}
43
44
const styles = StyleSheet . create ( {
45
+ container :{
46
+ display :'flex' , alignItems :'center' ,
47
+ justifyContent :'center'
48
+ } ,
44
49
cat :{
45
50
backgroundColor :'blue' ,
46
51
padding :10 , margin :10 , width :'95%'
52
+ } ,
53
+ pageName :{
54
+ margin :10 , fontWeight :'bold' ,
55
+ color :'#000' , textAlign :'center'
56
+ } ,
57
+ btnText :{
58
+ color :'#fff' , fontWeight :'bold'
47
59
}
48
60
} )
49
61
AppRegistry . registerComponent ( 'home' , ( ) => home ) ;
0 commit comments