Skip to content

Commit

Permalink
add about page
Browse files Browse the repository at this point in the history
  • Loading branch information
soliury committed Jul 25, 2015
1 parent f711bd0 commit 390f51b
Show file tree
Hide file tree
Showing 17 changed files with 249 additions and 4 deletions.
Binary file added Source/logo/IOS/noder-Icon-300px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/logo/IOS/noder-Icon-450px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/logo/IOS/noder-Icon.psd
Binary file not shown.
2 changes: 1 addition & 1 deletion app/components/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Setting extends Component {


onAboutPress() {

this.props.router.toAbout()
}


Expand Down
13 changes: 12 additions & 1 deletion app/configs/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var Topic = require('../containers/Topic')
var Comments = require('../containers/Comments')
var Message = require('../containers/Message')
var QRCode = require('../containers/QRCode')
var About = require('../containers/About')

// Config
var sceneConfig = require('./sceneConfig')
Expand Down Expand Up @@ -77,7 +78,17 @@ class Router {
})
}

replaceWithHome(){

toAbout() {
this.push({}, {
component: About,
name: 'about',
sceneConfig: sceneConfig.customFloatFromBottom
})
}


replaceWithHome() {
this.navigator.popToTop()
}
}
Expand Down
12 changes: 11 additions & 1 deletion app/configs/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
var packageObj = require('../../package.json')

module.exports = {
domain: 'https://cnodejs.org',
apiPath: '/api/v1',
bgImgUri: 'http://7lrzfj.com1.z0.glb.clouddn.com/soliury213H.png',
replySuffix: '\n\nFrom\040[Noder](https://github.com/soliury/noder-react-native)'
replySuffix: '\n\nFrom\040[Noder](https://github.com/soliury/noder-react-native)',
sourceInGithub: 'https://github.com/soliury/noder-react-native',
sourceNameInGithub: 'noder-react-native',
package: packageObj,
author: {
blog: 'http://lingyong.me',
cnodeName: 'soliury'
},
cnodeAbout: 'https://cnodejs.org/about'
}
14 changes: 13 additions & 1 deletion app/configs/sceneConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ var popGestureConfig = Object.assign({}, baseConfig.gestures.pop, {
});


var fullPopGestureConfig = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom.gestures.pop, {
edgeHitWidth: width
})


exports.customFloatFromRight = Object.assign({}, baseConfig, {
gestures: {
pop: popGestureConfig
}
});
})


exports.customFloatFromBottom = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom, {
gestures: {
pop: fullPopGestureConfig
}
})
165 changes: 165 additions & 0 deletions app/containers/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
var React = require('react-native')
var BlurView = require('react-native-blur').BlurView
var { Icon } = require('react-native-icons')


var config = require('../configs/config')
var window = require('../util/window')
var { width, height } = window.get()


var {
View,
Component,
PropTypes,
Text,
StyleSheet,
Image,
ActivityIndicatorIOS,
TouchableOpacity
} = React

class Home extends Component {
constructor(props) {
super(props)
}


_onSourceInGithubPress() {
window.link(config.sourceInGithub)
}


render() {
return (
<Image
style={styles.bgWall}
source={{uri:config.bgImgUri}}
>
<BlurView
blurType="dark"
style={styles.container}>


<Image
style={styles.noderLogo}
source={require('image!logo')}
/>


<Text style={styles.title}>Noder
<Text style={{fontSize:18,color:'rgba(255,255,255,0.6)'}}>
{' v' + config.package.version}
</Text>
</Text>

<TouchableOpacity onPress={() => window.link(config.cnodeAbout)}>
<Text style={styles.subTitle}>For CNodejs.org</Text>
</TouchableOpacity>


<TouchableOpacity onPress={() => this.props.router.toUser({
userName:config.author.cnodeName
})}>
<Text style={styles.subTitle}>@soliury</Text>
</TouchableOpacity>


<Icon
name='ion|ios-arrow-thin-down'
size={60}
color='rgba(255,255,255,0.5)'
style={styles.arrow}/>


<View style={styles.footer}>
<View style={styles.row}>
<TouchableOpacity onPress={this._onSourceInGithubPress.bind(this)}>
<Icon
name='ion|social-github'
size={40}
color='rgba(255,204,0,1)'
style={styles.rowIcon}/>
</TouchableOpacity>
</View>

<View style={styles.row}>
<TouchableOpacity onPress={()=> window.link(config.author.blog)}>
<Image
style={styles.blog}
source={require('image!blog')}
></Image>
</TouchableOpacity>
</View>
</View>
</BlurView>
</Image>
)
}
}

Home.propTypes = {
actions: PropTypes.object,
state: PropTypes.object
}

var styles = StyleSheet.create({
bgWall: {
height: height,
width: width
},
noderLogo: {
height: 150,
width: 150
},
container: {
width: width,
height: height,
flexDirection: 'column',
alignItems: 'center',
paddingTop: 30
},
title: {
marginTop: 20,
fontSize: 30,
color: 'rgba(255,255,255,0.7)',
borderBottomWidth: 1,
borderBottomColor: 'rgba(255,255,255,0.1)',

},
subTitle: {
marginTop: 10,
fontSize: 16,
color: 'rgba(255,255,255,0.5)'
},
row: {
flexDirection: 'row',
justifyContent: 'center',
height: 40,
alignItems: 'center'
},
rowIcon: {
height: 40,
width: 40
},
footer: {
position: 'absolute',
bottom: 0,
width: width,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
},
arrow: {
marginTop: 40,
height: 50,
width: 50
},
blog: {
height: 20,
width: 100,
opacity: 0.5
}
})

module.exports = Home
23 changes: 23 additions & 0 deletions iOS/Images.xcassets/blog.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "[email protected]"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions iOS/Images.xcassets/logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "[email protected]"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"moment": "2.10.3",
"query-string": "2.3.0",
"react-native": "0.7.1",
"react-native-blur": "^0.5.4",
"react-native-button": "1.2.0",
"react-native-camera": "0.3.3",
"react-native-html-render": "^1.0.2",
Expand Down

0 comments on commit 390f51b

Please sign in to comment.