-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoy.js
More file actions
58 lines (55 loc) · 1.62 KB
/
Boy.js
File metadata and controls
58 lines (55 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Created by penn on 2016/12/14.
*/
import React, {Component} from 'react';
import {
View,
StyleSheet,
Text,
} from 'react-native'
import Girl from './Girl'
import NavigationBar from './js/common/NavigationBar'
export default class Boy extends Component {
constructor(props) {
super(props);
this.state = {
what: ''
}
}
render() {
let what = this.state.what === '' ? '' : '我收到了女孩回赠的:' + this.state.what;
return (
<View style={styles.container}>
<NavigationBar
title='Boy'
style={{backgroundColor: '#6495ED'}}
/>
<Text style={styles.tips}>Hello I am boy.</Text>
<Text style={styles.tips}
onPress={()=> {
this.props.navigator.push({
component: Girl,
name: 'Girl',
params: {
what: '一枝玫瑰',
onCallback: (what)=> {
this.setState({
what: what,
})
}
}
})
}}>
送花给女孩.</Text>
<Text style={styles.tips}>{what}</Text>
</View>)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
tips: {
fontSize: 29
}
})