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

Commit 0ad8f4a

Browse files
author
soliury
committed
add publish, ci
1 parent 912535b commit 0ad8f4a

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

app/components/Nav.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ var styles = StyleSheet.create({
8484
},
8585
navCenter: {
8686
textAlign: 'center',
87-
flex: 2
87+
flex: 2,
88+
color: '#3498DB'
8889
}
8990
})
9091

app/configs/Router.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var Comments = require('../containers/Comments')
77
var Message = require('../containers/Message')
88
var QRCode = require('../containers/QRCode')
99
var About = require('../containers/About')
10+
var Publish = require('../containers/Publish')
1011

1112
// Config
1213
var sceneConfig = require('./sceneConfig')
@@ -88,6 +89,15 @@ class Router {
8889
}
8990

9091

92+
toPublish() {
93+
this.push({}, {
94+
component: Publish,
95+
name: 'publish',
96+
sceneConfig: customFloatFromRight
97+
})
98+
}
99+
100+
91101
replaceWithHome() {
92102
this.navigator.popToTop()
93103
}

app/containers/Publish.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
var React = require('react-native')
2+
3+
var Nav = require('../components/Nav')
4+
5+
var window = require('../util/window')
6+
var { width, height } = window.get()
7+
8+
9+
var {
10+
Component,
11+
View,
12+
Text,
13+
StyleSheet
14+
} = React
15+
16+
17+
class Publish extends Component {
18+
constructor(props) {
19+
super(props)
20+
}
21+
22+
23+
render() {
24+
var router = this.props.router
25+
26+
var navs = {
27+
Left: {
28+
text: '返回',
29+
onPress: ()=> {
30+
router.pop()
31+
}
32+
},
33+
Center: {
34+
text: '发表帖子'
35+
},
36+
Right: {
37+
text: '发布',
38+
onPress: ()=> {
39+
40+
}
41+
}
42+
}
43+
return (
44+
<View style={styles.container}>
45+
<Nav
46+
navs={navs}
47+
></Nav>
48+
</View>
49+
)
50+
}
51+
}
52+
53+
var styles = StyleSheet.create({})
54+
55+
module.exports = Publish
56+
57+

app/containers/User.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ class User extends Component {
175175
let authorName = userInfo.loginname
176176
let githubName = userInfo.githubUsername
177177
let pubTopicIcon = (
178-
<TouchableOpacity>
178+
<TouchableOpacity
179+
onPress={()=>{
180+
this.props.router.toPublish()
181+
}}
182+
>
179183
<Icon
180184
name='ion|ios-compose'
181185
size={34}

0 commit comments

Comments
 (0)