-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.ios.js
82 lines (74 loc) · 1.97 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions
} = React;
var WINDOW_WIDTH = Dimensions.get('window').width;
var DateView = require('./components/date'),
TimeView = require('./components/time'),
WeatherView = require('./components/weather'),
StockView = require('./components/stock'),
TwitterView = require('./components/twitter'),
GithubView = require('./components/github'),
CalendarView = require('./components/calendar');
var MagicMirror = React.createClass({
render: function() {
var stocks = ['FB', 'TWTR', 'AAPL', 'GOOGL', 'MSFT', 'TSLA'],
twitterUsers = ['berniesanders', 'robinpowered', 'elonmusk'];
return (
<View style={styles.container}>
<View style={styles.row}>
<DateView></DateView>
</View>
<View style={styles.row}>
<TimeView></TimeView>
</View>
<View style={[styles.row, styles.margin, {marginTop: -10}]}>
<WeatherView></WeatherView>
</View>
<View style={[styles.row, styles.margin]}>
<TwitterView users={twitterUsers}></TwitterView>
</View>
<View style={[styles.row, styles.margin]}>
<GithubView></GithubView>
</View>
<View style={[styles.row, styles.margin]}>
<CalendarView></CalendarView>
</View>
<View style={styles.stocks}>
<StockView style={{width: '100%'}} symbols={stocks}></StockView>
</View>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#000'
},
row: {
flexDirection: 'row',
justifyContent: 'flex-end',
marginBottom: 0
},
margin: {
marginBottom: 30
},
stocks: {
flex: 1,
position: 'absolute',
bottom: 0,
left: 0,
right: 0
}
});
AppRegistry.registerComponent('MagicMirror', () => MagicMirror);