-
Notifications
You must be signed in to change notification settings - Fork 44
/
index.ios.js
133 lines (123 loc) · 3.05 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
ScrollView,
NavigatorIOS,
TouchableOpacity,
} = React;
import { setTheme, MKColor } from 'react-native-material-kit';
// customize the material design theme
setTheme({
primaryColor: MKColor.Purple,
primaryColorRGB: MKColor.RGBPurple,
accentColor: MKColor.Amber,
});
var Buttons = require('./app/buttons');
var TextFields = require('./app/textfields');
var Toggles = require('./app/toggles');
var Progress = require('./app/progress');
var Sliders = require('./app/sliders');
var Cards = require('./app/cards');
var Home = React.createClass({
render: function () {
return (
<ScrollView style={styles.list}
contentContainerStyle={styles.container}>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Buttons',
component: Buttons,
});
}}>
<Text style={styles.pushLabel}>Buttons</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Cards',
component: Cards,
});
}}>
<Text style={styles.pushLabel}>Cards</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Loading',
component: Progress,
});
}}>
<Text style={styles.pushLabel}>Loading</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Sliders',
component: Sliders,
});
}}>
<Text style={styles.pushLabel}>Sliders</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Text Fields',
component: TextFields,
});
}}>
<Text style={styles.pushLabel}>Text Fields</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => {
this.props.navigator.push({
title: 'Toggles',
component: Toggles,
});
}}>
<Text style={styles.pushLabel}>Toggles</Text>
</TouchableOpacity>
</ScrollView>
);
}
});
var Example = React.createClass({
render: function () {
return (
<NavigatorIOS
style={{flex:1}}
initialRoute={{
component: Home,
title: 'Examples',
}}
/>
);
},
});
var styles = StyleSheet.create({
list: {
backgroundColor: '#F5FCFF',
paddingTop: 20,
},
container: {
flex: 1,
alignItems: 'center',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginTop: 20, marginBottom: 0,
},
pushLabel: {
padding: 10,
color: '#2196F3',
}
});
AppRegistry.registerComponent('Example', () => Example);