-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
127 lines (123 loc) · 3.27 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
115
116
117
118
119
120
121
122
123
124
125
126
127
import React from 'react';
import {
StyleSheet,
StatusBar,
Text,
View,
Image,
ScrollView
} from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons';
import Story from './components/Story';
import Post from './components/Post';
import { posts, stories } from './data.js';
export default function App() {
return (
<>
<StatusBar barStyle="dark-content" />
<View style={styles.container}>
<View style={styles.topBar}>
<SimpleLineIcons name="camera" size={32} />
<Image source={require('./assets/instagram.png')} />
<Ionicons name="ios-send" size={32} />
</View>
<ScrollView showsVerticalScrollIndicator={false} style={styles.content}>
<View style={styles.stories}>
<View style={styles.legends}>
<Text>Stories</Text>
<View style={styles.watchAll}>
<Ionicons name="md-arrow-dropright" size={20} />
<Text style={{ paddingLeft: 5 }}>Watch All</Text>
</View>
</View>
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
>
{stories.map((story, index) => (
<Story key={index} userName={story.userName} url={story.url} />
))}
</ScrollView>
</View>
{/* handling the posts */}
{posts.map((post, index) => (
<Post
key={index}
avatar={post.avatar}
userName={post.username}
location={post.location}
postPic={post.postPic}
description={post.description}
likes={post.likes}
comments={post.comments}
time={post.time}
/>
))}
</ScrollView>
<View style={styles.navigationBar}>
<Ionicons name="md-home" size={32} />
<Ionicons name="ios-search" size={32} />
<SimpleLineIcons name="plus" size={32} />
<SimpleLineIcons name="heart" size={32} />
<Ionicons name="md-person" size={32} />
</View>
</View>
</>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffff'
},
topBar: {
height: 50,
marginTop: 24,
backgroundColor: '#fff',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingLeft: 10,
paddingRight: 10,
shadowColor: '#c3c3c3',
shadowOffset: {
width: 0,
height: 1
},
shadowOpacity: 0.2,
shadowRadius: 1.41,
elevation: 2
},
content: {
flex: 1,
backgroundColor: '#fff'
},
stories: {
height: 125,
backgroundColor: '#fff',
paddingTop: 10,
paddingBottom: 10
},
watchAll: {
flexDirection: 'row',
justifyContent: 'space-between'
},
navigationBar: {
height: 50,
backgroundColor: '#fff',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingLeft: 10,
paddingRight: 10,
borderColor: '#c3c3c3',
borderTopWidth: 0.5
},
legends: {
flexDirection: 'row',
paddingRight: 10,
paddingLeft: 10,
justifyContent: 'space-between'
}
});