forked from samuel1112/v2er
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
103 lines (93 loc) · 2.86 KB
/
index.ios.js
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
NavigatorIOS,
TabBarIOS
} = React;
var TabBarItemIOS = TabBarIOS.Item;
var TopicList = require('./App/View/TopicList/TopicList');
var NodeMap = require('./App/View/NodeMap/NodeMap');
/*
dispatch_once(&onceToken, ^{
systemIcons = @{
@"more": @(UITabBarSystemItemMore),
@"favorites": @(UITabBarSystemItemFavorites),
@"featured": @(UITabBarSystemItemFeatured),
@"topRated": @(UITabBarSystemItemTopRated),
@"recents": @(UITabBarSystemItemRecents),
@"contacts": @(UITabBarSystemItemContacts),
@"history": @(UITabBarSystemItemHistory),
@"bookmarks": @(UITabBarSystemItemBookmarks),
@"search": @(UITabBarSystemItemSearch),
@"downloads": @(UITabBarSystemItemDownloads),
@"mostRecent": @(UITabBarSystemItemMostRecent),
@"mostViewed": @(UITabBarSystemItemMostViewed),
};
});
*/
function _icon(imageUri) {
return {
uri: imageUri,
isStatic: true
};
}
var v2er = React.createClass({
getInitialState: function() {
return {
selectedTab: 'latestTab'
};
},
render: function() {
// console.log('12123123');
return (
<TabBarIOS selectedTab={this.state.selectedTab}>
<TabBarItemIOS accessibilityLabel={"Latest"}
selected={this.state.selectedTab === 'latestTab'}
title="latest"
name="latestTab"
icon={_icon('recents')}
onPress={() => {
this.setState({
selectedTab: 'latestTab'
});
}}>
<NavigatorIOS style={Style.container}
tintColor={'#333344'}
initialRoute={{
title: 'Latest Topic - V2EX',
component: TopicList
}}
itemWrapperStyle={Style.navigator} />
</TabBarItemIOS>
<TabBarItemIOS accessibilityLabel={"Nodes"}
selected={this.state.selectedTab === 'nodeMap'}
title="NodeMap"
name="nodeMap"
icon={_icon('bookmarks')}
onPress={() => {
this.setState({
selectedTab: 'nodeMap'
});
}}>
<NodeMap />
</TabBarItemIOS>
</TabBarIOS>
);
}
});
var Style = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF'
},
navigator: {
backgroundColor: '#EFEFEF'
}
});
AppRegistry.registerComponent('v2er', () => v2er);