-
-
Notifications
You must be signed in to change notification settings - Fork 407
/
index.ios.js
111 lines (103 loc) · 2.58 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
104
105
106
107
108
109
110
111
/**
* Dribbble App
* Github url: https://github.com/catalinmiron/react-native-dribbble-app
*/
"use strict";
var React = require("react-native");
var {
AppRegistry,
NavigatorIOS,
StyleSheet,
TabBarIOS,
View,
Text
} = React;
var ShotList = require("./app/ShotList"),
Icon = require("react-native-vector-icons/FontAwesome");
var DribbbleApp = React.createClass({
getInitialState: function() {
return {
selectedTab: "default"
};
},
_renderContent: function(category: string, title: ?string) {
return (
<NavigatorIOS style={styles.wrapper}
initialRoute={{
component: ShotList,
title: title,
passProps: {filter: category}
}}
/>
);
},
render: function() {
return (
<TabBarIOS tintColor={"#ea4c89"}>
<Icon.TabBarItem
title="All"
iconName="dribbble"
selectedIconName="dribbble"
selected={this.state.selectedTab === "default"}
onPress={() => {
this.setState({
selectedTab: "default",
});
}}>
{this._renderContent("default", "All")}
</Icon.TabBarItem>
<Icon.TabBarItem
title="Debuts"
iconName="trophy"
selectedIconName="trophy"
selected={this.state.selectedTab === "debuts"}
onPress={() => {
this.setState({
selectedTab: "debuts",
});
}}>
{this._renderContent("debuts", "Debuts")}
</Icon.TabBarItem>
<Icon.TabBarItem
title="Animated"
iconName="heart"
selectedIconName="heart"
selected={this.state.selectedTab === "animated"}
onPress={() => {
this.setState({
selectedTab: "animated",
});
}}>
{this._renderContent("animated", "Animated")}
</Icon.TabBarItem>
<Icon.TabBarItem
title="Rebounds"
iconName="lightbulb-o"
selectedIconName="lightbulb-o"
selected={this.state.selectedTab === "rebounds"}
onPress={() => {
this.setState({
selectedTab: "rebounds",
});
}}>
{this._renderContent("rebounds", "Rebounds")}
</Icon.TabBarItem>
</TabBarIOS>
);
}
});
var styles = StyleSheet.create({
tabContent: {
flex: 1,
alignItems: "center",
},
tabText: {
color: "white",
margin: 50,
},
wrapper: {
flex: 1
}
});
AppRegistry.registerComponent("DribbbleApp", () => DribbbleApp);
module.exports = DribbbleApp;