Repository navigation
Expand file tree
/
Copy pathTestScreens.js
More file actions
82 lines (69 loc) · 2.01 KB
/
Copy pathTestScreens.js
File metadata and controls
82 lines (69 loc) · 2.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// @flow
import React from 'react';
import {
Button,
View,
} from 'react-native';
import PropTypes from 'prop-types'
import { Title } from './Common';
export class HomeScreen extends React.Component {
render() {
const navigate = this.props.navigation.navigate;
return (
<View>
<Title>Home</Title>
<Button
onPress={() => navigate('DrawerOpen')}
title="Open Drawer" />
<Title>{this.props.userName}, {this.props.email}</Title>
<Button
onPress={this.props.onUpdateUserName}
title="Update Username" />
<Title>{this.props.timestamp}</Title>
<Button
onPress={this.props.onUpdateTimestamp}
title="Update Timestamp" />
<Title>{this.props.description}</Title>
<Button
onPress={this.props.onGetDescription}
title="Get @cheeming bio" />
</View>
);
}
}
HomeScreen.propTypes = {
userName: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
timestamp: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
onUpdateUserName: PropTypes.func.isRequired,
onUpdateTimestamp: PropTypes.func.isRequired,
onGetDescription: PropTypes.func.isRequired,
}
export class ProfileScreen extends React.Component {
render() {
return (
<View>
<Title>Profile</Title>
</View>
);
}
}
export class AboutScreen extends React.Component {
render() {
const navigation = this.props.navigation;
return (
<View>
<Title>About</Title>
<Button
onPress={() => navigation.goBack()}
title="Go Back" />
</View>
);
}
}
export default {
HomeScreen,
ProfileScreen,
AboutScreen,
};