-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
114 lines (111 loc) · 2.98 KB
/
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
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
// According to https://www.youtube.com/watch?v=LdKtugH-sb8&t=516s
// But using capital letters for hex numbers
// and double quote marks instead of single.
import React from 'react';
import {
TouchableOpacity,
Platform,
StyleSheet,
Text,
View,
Image,
FlatList
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import VideoItem from './components/videoItem';
import data from './data.json';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={{ height: 25 }} />
<View style={styles.navBar}>
<Image
source={require('./images/logo.png')}
style={{ height: 22, width: 98 }}
/>
<View style={styles.rightNav}>
<TouchableOpacity>
<Icon name="search" style={styles.navItem} size={25} />
</TouchableOpacity>
<TouchableOpacity>
<Icon name="account-circle" style={styles.navItem} size={25} />
</TouchableOpacity>
</View>
</View>
<View style={styles.body}>
<FlatList
data={data.items}
renderItem={video => <VideoItem video={video.item} />}
keyExtractor={item => item.id}
ItemSeparatorComponent={() => <View style={styles.itemSep} />}
/>
</View>
<View style={styles.tabBar}>
<TouchableOpacity style={styles.tabItem}>
<Icon name="home" size={25} />
<Text style={styles.tabTitle}>Home</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.tabItem}>
<Icon name="whatshot" size={25} />
<Text style={styles.tabTitle}>Trending</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.tabItem}>
<Icon name="subscriptions" size={25} />
<Text style={styles.tabTitle}>Subscriptions</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.tabItem}>
<Icon name="folder" size={25} />
<Text style={styles.tabTitle}>Library</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1
},
navBar: {
height: 55,
backgroundColor: 'white',
//paddingVertical: 30,
//paddingTop: 26,
paddingHorizontal: 15,
elevation: 3,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between'
},
rightNav: {
flexDirection: 'row'
},
navItem: {
marginLeft: 25
},
body: {
flex: 1
},
tabBar: {
backgroundColor: '#FFFFFF',
height: 60,
borderTopWidth: 0.5,
borderColor: '#E5E5E5',
flexDirection: 'row',
justifyContent: 'space-around'
},
tabItem: {
alignItems: 'center',
justifyContent: 'center'
},
tabTitle: {
fontSize: 11,
color: '#3C3C3C',
paddingTop: 4
},
itemSep: {
height: 3,
backgroundColor: '#E5E5E5'
}
});