1
1
import React , { Component } from "react" ;
2
2
import { StyleSheet , Text , ScrollView , View , Button } from "react-native" ;
3
- import getGLReactImplementation from "./gl-react-implementation" ;
4
- const { name } = getGLReactImplementation ( ) ;
3
+ import { name } from "./gl-react-implementation" ;
5
4
import Item from "./Item" ;
6
5
import * as examples from "./examples" ;
7
6
import * as tests from "./tests" ;
8
- import Router from "./Router" ;
9
7
10
8
const styles = StyleSheet . create ( {
11
9
container : {
12
10
flex : 1 ,
13
11
backgroundColor : "#f9f9f9" ,
14
- flexDirection : "column" ,
12
+ flexDirection : "column"
15
13
} ,
16
14
list : {
17
15
flex : 1 ,
18
16
backgroundColor : "#fff" ,
19
- marginBottom : 50 ,
17
+ marginBottom : 50
20
18
} ,
21
19
subHeader : {
22
20
padding : 10 ,
23
- paddingVertical : 40 ,
21
+ paddingVertical : 40
24
22
} ,
25
23
title : {
26
24
flex : 1 ,
27
25
flexDirection : "row" ,
28
26
alignItems : "center" ,
29
- justifyContent : "center" ,
27
+ justifyContent : "center"
30
28
} ,
31
29
titleText : {
32
30
fontWeight : "bold" ,
33
31
color : "#fff" ,
34
- fontSize : 18 ,
32
+ fontSize : 18
35
33
} ,
36
34
sectionTitle : {
37
35
fontWeight : "bold" ,
38
36
color : "#000" ,
39
37
fontSize : 18 ,
40
- padding : 10 ,
41
- } ,
38
+ padding : 10
39
+ }
42
40
} ) ;
43
41
44
42
export default class Home extends Component {
@@ -48,37 +46,33 @@ export default class Home extends Component {
48
46
< View style = { styles . title } >
49
47
< Text style = { styles . titleText } > { name } </ Text >
50
48
</ View >
51
- ) ,
52
- } ,
49
+ )
50
+ }
53
51
} ;
54
52
props : {
55
- navigator : * ,
53
+ navigation : *
56
54
} ;
57
55
render ( ) {
58
- const { navigator } = this . props ;
56
+ const { navigation } = this . props ;
59
57
return (
60
58
< ScrollView style = { styles . container } >
61
59
< View style = { styles . subHeader } >
62
60
< Button
63
- onPress = { ( ) => navigator . push ( Router . getRoute ( "about" ) ) }
61
+ onPress = { ( ) => navigation . navigate ( "about" ) }
64
62
color = "#e24"
65
63
title = "What is gl-react ?"
66
64
/>
67
65
</ View >
68
66
< View style = { styles . list } >
69
- < Text style = { styles . sectionTitle } >
70
- Examples
71
- </ Text >
67
+ < Text style = { styles . sectionTitle } > Examples</ Text >
72
68
{ Object . keys ( examples ) . map ( ex => (
73
- < Item key = { ex } id = { ex } navigator = { navigator } { ...examples [ ex ] } />
69
+ < Item key = { ex } id = { ex } navigation = { navigation } { ...examples [ ex ] } />
74
70
) ) }
75
71
</ View >
76
72
< View style = { styles . list } >
77
- < Text style = { styles . sectionTitle } >
78
- Tests
79
- </ Text >
73
+ < Text style = { styles . sectionTitle } > Tests</ Text >
80
74
{ Object . keys ( tests ) . map ( ex => (
81
- < Item key = { ex } id = { ex } navigator = { navigator } { ...tests [ ex ] } />
75
+ < Item key = { ex } id = { ex } navigation = { navigation } { ...tests [ ex ] } />
82
76
) ) }
83
77
</ View >
84
78
</ ScrollView >
0 commit comments