Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 390f51b

Browse files
author
soliury
committed
add about page
1 parent f711bd0 commit 390f51b

File tree

17 files changed

+249
-4
lines changed

17 files changed

+249
-4
lines changed
12.2 KB
Loading
24.1 KB
Loading

Source/logo/IOS/noder-Icon.psd

-275 KB
Binary file not shown.

app/components/Setting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Setting extends Component {
2626

2727

2828
onAboutPress() {
29-
29+
this.props.router.toAbout()
3030
}
3131

3232

app/configs/Router.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var Topic = require('../containers/Topic')
66
var Comments = require('../containers/Comments')
77
var Message = require('../containers/Message')
88
var QRCode = require('../containers/QRCode')
9+
var About = require('../containers/About')
910

1011
// Config
1112
var sceneConfig = require('./sceneConfig')
@@ -77,7 +78,17 @@ class Router {
7778
})
7879
}
7980

80-
replaceWithHome(){
81+
82+
toAbout() {
83+
this.push({}, {
84+
component: About,
85+
name: 'about',
86+
sceneConfig: sceneConfig.customFloatFromBottom
87+
})
88+
}
89+
90+
91+
replaceWithHome() {
8192
this.navigator.popToTop()
8293
}
8394
}

app/configs/config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
var packageObj = require('../../package.json')
2+
13
module.exports = {
24
domain: 'https://cnodejs.org',
35
apiPath: '/api/v1',
46
bgImgUri: 'http://7lrzfj.com1.z0.glb.clouddn.com/soliury213H.png',
5-
replySuffix: '\n\nFrom\040[Noder](https://github.com/soliury/noder-react-native)'
7+
replySuffix: '\n\nFrom\040[Noder](https://github.com/soliury/noder-react-native)',
8+
sourceInGithub: 'https://github.com/soliury/noder-react-native',
9+
sourceNameInGithub: 'noder-react-native',
10+
package: packageObj,
11+
author: {
12+
blog: 'http://lingyong.me',
13+
cnodeName: 'soliury'
14+
},
15+
cnodeAbout: 'https://cnodejs.org/about'
616
}

app/configs/sceneConfig.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ var popGestureConfig = Object.assign({}, baseConfig.gestures.pop, {
1414
});
1515

1616

17+
var fullPopGestureConfig = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom.gestures.pop, {
18+
edgeHitWidth: width
19+
})
20+
21+
1722
exports.customFloatFromRight = Object.assign({}, baseConfig, {
1823
gestures: {
1924
pop: popGestureConfig
2025
}
21-
});
26+
})
27+
28+
29+
exports.customFloatFromBottom = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom, {
30+
gestures: {
31+
pop: fullPopGestureConfig
32+
}
33+
})

app/containers/About.js

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
var React = require('react-native')
2+
var BlurView = require('react-native-blur').BlurView
3+
var { Icon } = require('react-native-icons')
4+
5+
6+
var config = require('../configs/config')
7+
var window = require('../util/window')
8+
var { width, height } = window.get()
9+
10+
11+
var {
12+
View,
13+
Component,
14+
PropTypes,
15+
Text,
16+
StyleSheet,
17+
Image,
18+
ActivityIndicatorIOS,
19+
TouchableOpacity
20+
} = React
21+
22+
class Home extends Component {
23+
constructor(props) {
24+
super(props)
25+
}
26+
27+
28+
_onSourceInGithubPress() {
29+
window.link(config.sourceInGithub)
30+
}
31+
32+
33+
render() {
34+
return (
35+
<Image
36+
style={styles.bgWall}
37+
source={{uri:config.bgImgUri}}
38+
>
39+
<BlurView
40+
blurType="dark"
41+
style={styles.container}>
42+
43+
44+
<Image
45+
style={styles.noderLogo}
46+
source={require('image!logo')}
47+
/>
48+
49+
50+
<Text style={styles.title}>Noder
51+
<Text style={{fontSize:18,color:'rgba(255,255,255,0.6)'}}>
52+
{' v' + config.package.version}
53+
</Text>
54+
</Text>
55+
56+
<TouchableOpacity onPress={() => window.link(config.cnodeAbout)}>
57+
<Text style={styles.subTitle}>For CNodejs.org</Text>
58+
</TouchableOpacity>
59+
60+
61+
<TouchableOpacity onPress={() => this.props.router.toUser({
62+
userName:config.author.cnodeName
63+
})}>
64+
<Text style={styles.subTitle}>@soliury</Text>
65+
</TouchableOpacity>
66+
67+
68+
<Icon
69+
name='ion|ios-arrow-thin-down'
70+
size={60}
71+
color='rgba(255,255,255,0.5)'
72+
style={styles.arrow}/>
73+
74+
75+
<View style={styles.footer}>
76+
<View style={styles.row}>
77+
<TouchableOpacity onPress={this._onSourceInGithubPress.bind(this)}>
78+
<Icon
79+
name='ion|social-github'
80+
size={40}
81+
color='rgba(255,204,0,1)'
82+
style={styles.rowIcon}/>
83+
</TouchableOpacity>
84+
</View>
85+
86+
<View style={styles.row}>
87+
<TouchableOpacity onPress={()=> window.link(config.author.blog)}>
88+
<Image
89+
style={styles.blog}
90+
source={require('image!blog')}
91+
></Image>
92+
</TouchableOpacity>
93+
</View>
94+
</View>
95+
</BlurView>
96+
</Image>
97+
)
98+
}
99+
}
100+
101+
Home.propTypes = {
102+
actions: PropTypes.object,
103+
state: PropTypes.object
104+
}
105+
106+
var styles = StyleSheet.create({
107+
bgWall: {
108+
height: height,
109+
width: width
110+
},
111+
noderLogo: {
112+
height: 150,
113+
width: 150
114+
},
115+
container: {
116+
width: width,
117+
height: height,
118+
flexDirection: 'column',
119+
alignItems: 'center',
120+
paddingTop: 30
121+
},
122+
title: {
123+
marginTop: 20,
124+
fontSize: 30,
125+
color: 'rgba(255,255,255,0.7)',
126+
borderBottomWidth: 1,
127+
borderBottomColor: 'rgba(255,255,255,0.1)',
128+
129+
},
130+
subTitle: {
131+
marginTop: 10,
132+
fontSize: 16,
133+
color: 'rgba(255,255,255,0.5)'
134+
},
135+
row: {
136+
flexDirection: 'row',
137+
justifyContent: 'center',
138+
height: 40,
139+
alignItems: 'center'
140+
},
141+
rowIcon: {
142+
height: 40,
143+
width: 40
144+
},
145+
footer: {
146+
position: 'absolute',
147+
bottom: 0,
148+
width: width,
149+
flexDirection: 'column',
150+
justifyContent: 'center',
151+
alignItems: 'center'
152+
},
153+
arrow: {
154+
marginTop: 40,
155+
height: 50,
156+
width: 50
157+
},
158+
blog: {
159+
height: 20,
160+
width: 100,
161+
opacity: 0.5
162+
}
163+
})
164+
165+
module.exports = Home
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"scale" : "1x",
6+
"filename" : "[email protected]"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x",
11+
"filename" : "[email protected]"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x",
16+
"filename" : "[email protected]"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
6.11 KB
Loading

0 commit comments

Comments
 (0)