-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
43 lines (38 loc) · 949 Bytes
/
App.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
import React from 'react';
import { AppRegistry, FlatList, StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
state = {
upcoming_pass: "",
time: "",
}
_onRefresh() {
this.setState({refreshing: true});
fetchData().then(() => {
this.setState({refreshing: false});
});
}
render() {
return (
<View >
<View style={{flex: 0, flexDirection: 'row'}}>
<View style={{width: 500, height: 40, backgroundColor: 'steelblue'}} />
</View>
<FlatList
data={[
{key: 'pass_1 - Time'},
{key: 'pass_2 - Time'},
{key: 'pass_3 - Time'},
//API calls add key value pairs
]}
renderItem={({item}) => <Text style={styles.item}>{item.key}</Text>}
/>
</View>
);
}
}
const styles = StyleSheet.create({
item: {
fontSize: 32,
height: 40,
},
})