|
1 | 1 | /**
|
2 |
| -* AboutPage |
3 |
| -* @flow |
4 |
| -**/ |
| 2 | + * AboutPage |
| 3 | + * @flow |
| 4 | + **/ |
5 | 5 | 'use strict'
|
6 |
| -var React=require('react'); |
7 |
| -var ReactNative=require('react-native'); |
8 |
| -var{ |
9 |
| - Image, |
10 |
| - ScrollView, |
11 |
| - StyleSheet, |
12 |
| - Platform, |
13 |
| - Linking, |
14 |
| - Text, |
15 |
| - View, |
16 |
| -}=ReactNative; |
17 |
| -var NavigationBar=require('./NavigationBar') |
18 |
| -var AboutPage=React.createClass({ |
19 |
| - render:function() { |
20 |
| - var navigationBar=Platform.OS==="android"? |
21 |
| - <NavigationBar |
22 |
| - leftButtonIcon={require('../res/images/ic_menu_white_24dp.png')} |
23 |
| - onLeftButtonClick={()=>this.props.drawer.openDrawer()} |
24 |
| - title='About'/>: |
25 |
| - <NavigationBar |
26 |
| - title='About'/>; |
27 |
| - return( |
28 |
| - <View style={styles.container}> |
29 |
| - {navigationBar} |
30 |
| - <View style={styles.content}> |
31 |
| - <Text style={{}}> |
32 |
| - This is a GitHub most popular repositories viewer with React Native. |
33 |
| - </Text> |
34 |
| - <Text style={styles.blogText} |
35 |
| - onPress={()=>Linking.openURL('http://github.com/crazycodeboy')} |
36 |
| - > |
37 |
| - This project is open source in GitHub. |
38 |
| - </Text> |
39 |
| - <Text style={{marginTop:20,fontWeight:'600'}}> |
40 |
| - About Me: |
41 |
| - </Text> |
42 |
| - <View |
43 |
| - style={styles.textLayout}> |
44 |
| - <Text style={styles.blogName}>GitHub: </Text> |
45 |
| - <Text |
46 |
| - style={styles.blogText} |
47 |
| - onPress={()=>Linking.openURL('http://github.com/crazycodeboy')} |
48 |
| - > |
49 |
| - github.com/crazycodeboy |
50 |
| - </Text> |
51 |
| - </View> |
52 |
| - <View |
53 |
| - style={styles.textLayout}> |
54 |
| - <Text style={styles.blogName}>CSDN: </Text> |
55 |
| - <Text |
56 |
| - style={styles.blogText} |
57 |
| - onPress={()=>Linking.openURL('http://blog.csdn.net/fengyuzhengfan/')} |
58 |
| - > |
59 |
| - blog.csdn.net/fengyuzhengfan/ |
60 |
| - </Text> |
61 |
| - </View> |
62 |
| - <View |
63 |
| - style={styles.textLayout}> |
64 |
| - <Text style={styles.blogName}>jianshu: </Text> |
65 |
| - <Text |
66 |
| - style={styles.blogText} |
67 |
| - onPress={()=>Linking.openURL('http://jianshu.com/users/ca3943a4172a/latest_articles')} |
68 |
| - > |
69 |
| - jianshu.com/users/ca3943a4172a/latest_articles |
70 |
| - </Text> |
71 |
| - </View> |
72 |
| - <View |
73 |
| - style={styles.textLayout}> |
74 |
| - <Text style={styles.blogName}>Emai: </Text> |
75 |
| - <Text |
76 |
| - style={styles.blogText} |
77 |
| - //onPress={()=>Linking.openURL('email:crazycodeboy@gmail.com')} |
78 |
| - > |
79 |
| - |
80 |
| - </Text> |
81 |
| - </View> |
| 6 | +import React, {Component} from 'react'; |
| 7 | + |
| 8 | +import { |
| 9 | + Image, |
| 10 | + ScrollView, |
| 11 | + StyleSheet, |
| 12 | + Platform, |
| 13 | + Linking, |
| 14 | + Text, |
| 15 | + View, |
| 16 | +} from 'react-native' |
| 17 | +import NavigationBar from './NavigationBar' |
| 18 | +class AboutPage extends Component { |
| 19 | + render() { |
| 20 | + var navigationBar = Platform.OS === "android" ? |
| 21 | + <NavigationBar |
| 22 | + leftButtonIcon={require('../res/images/ic_menu_white_24dp.png')} |
| 23 | + onLeftButtonClick={()=>this.props.drawer.openDrawer()} |
| 24 | + title='About'/> : |
| 25 | + <NavigationBar |
| 26 | + title='About'/>; |
| 27 | + return ( |
| 28 | + <View style={styles.container}> |
| 29 | + {navigationBar} |
| 30 | + <View style={styles.content}> |
| 31 | + <Text style={{}}> |
| 32 | + This is a GitHub most popular repositories viewer with React Native. |
| 33 | + </Text> |
| 34 | + <Text style={styles.blogText} |
| 35 | + onPress={()=>Linking.openURL('http://github.com/crazycodeboy')} |
| 36 | + > |
| 37 | + This project is open source in GitHub. |
| 38 | + </Text> |
| 39 | + <Text style={{marginTop: 20, fontWeight: '600'}}> |
| 40 | + About Me: |
| 41 | + </Text> |
| 42 | + <View |
| 43 | + style={styles.textLayout}> |
| 44 | + <Text style={styles.blogName}>GitHub: </Text> |
| 45 | + <Text |
| 46 | + style={styles.blogText} |
| 47 | + onPress={()=>Linking.openURL('http://github.com/crazycodeboy')} |
| 48 | + > |
| 49 | + github.com/crazycodeboy |
| 50 | + </Text> |
| 51 | + </View> |
| 52 | + <View |
| 53 | + style={styles.textLayout}> |
| 54 | + <Text style={styles.blogName}>CSDN: </Text> |
| 55 | + <Text |
| 56 | + style={styles.blogText} |
| 57 | + onPress={()=>Linking.openURL('http://blog.csdn.net/fengyuzhengfan/')} |
| 58 | + > |
| 59 | + blog.csdn.net/fengyuzhengfan/ |
| 60 | + </Text> |
| 61 | + </View> |
| 62 | + <View |
| 63 | + style={styles.textLayout}> |
| 64 | + <Text style={styles.blogName}>jianshu: </Text> |
| 65 | + <Text |
| 66 | + style={styles.blogText} |
| 67 | + onPress={()=>Linking.openURL('http://jianshu.com/users/ca3943a4172a/latest_articles')} |
| 68 | + > |
| 69 | + jianshu.com/users/ca3943a4172a/latest_articles |
| 70 | + </Text> |
| 71 | + </View> |
| 72 | + <View |
| 73 | + style={styles.textLayout}> |
| 74 | + <Text style={styles.blogName}>Emai: </Text> |
| 75 | + <Text |
| 76 | + style={styles.blogText} |
| 77 | + //onPress={()=>Linking.openURL('email:crazycodeboy@gmail.com')} |
| 78 | + > |
| 79 | + |
| 80 | + </Text> |
| 81 | + </View> |
| 82 | + </View> |
82 | 83 | </View>
|
83 |
| - </View> |
84 |
| - ); |
85 |
| - }, |
86 |
| -}); |
| 84 | + ); |
| 85 | + } |
| 86 | +} |
| 87 | +; |
87 | 88 | const styles = StyleSheet.create({
|
88 |
| - container: { |
89 |
| - flex: 1, backgroundColor: '#fff' |
90 |
| - }, |
91 |
| - content:{ |
92 |
| - paddingTop:20, |
93 |
| - paddingLeft:10, |
94 |
| - paddingRight:10 |
95 |
| - }, |
96 |
| - textLayout:{ |
97 |
| - flexDirection:'row',alignItems:'center' |
98 |
| - }, |
99 |
| - blogName:{ |
100 |
| - fontSize:13,color:'gray',fontWeight:'400' |
101 |
| - }, |
102 |
| - blogText:{ |
103 |
| - color:'dodgerblue',fontSize:13,textDecorationLine: 'underline' |
104 |
| - }, |
| 89 | + container: { |
| 90 | + flex: 1, backgroundColor: '#fff' |
| 91 | + }, |
| 92 | + content: { |
| 93 | + paddingTop: 20, |
| 94 | + paddingLeft: 10, |
| 95 | + paddingRight: 10 |
| 96 | + }, |
| 97 | + textLayout: { |
| 98 | + flexDirection: 'row', alignItems: 'center' |
| 99 | + }, |
| 100 | + blogName: { |
| 101 | + fontSize: 13, color: 'gray', fontWeight: '400' |
| 102 | + }, |
| 103 | + blogText: { |
| 104 | + color: 'dodgerblue', fontSize: 13, textDecorationLine: 'underline' |
| 105 | + }, |
105 | 106 | })
|
106 |
| -module.exports=AboutPage |
| 107 | +module.exports = AboutPage |
0 commit comments