-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
108 lines (104 loc) · 2.89 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
import React from "react";
import { StyleSheet, Image } from "react-native";
import Header from "./components/Header";
import NewPostForm from "./screens/NewPostForm";
import PostFeed from "./screens/PostFeed";
import CommentFeed from "./screens/CommentFeed";
import GalleryView from "./screens/GalleryView";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createStackNavigator } from "@react-navigation/stack";
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();
function Home() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="PostFeed" component={PostFeed} />
<Stack.Screen
name="Comments"
component={CommentFeed}
/>
</Stack.Navigator>
);
}
export default function App() {
return (
<>
<Header />
<NavigationContainer
initialRouteName="Feed"
styles={styles.navContainer}
>
<Tab.Navigator
screenOptions={{
tabBarActiveTintColor: "darkviolet",
tabBarInactiveTintColor: "cadetblue",
headerShown: false,
tabBarStyle: {
height: 100,
position: "absolute",
backgroundColor: "gold",
},
tabBarHideOnKeyboard: "true",
}}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({ focused, color, size }) => {
return (
<Image
style={{ width: 40, height: 40 }}
source={require("./assets/feed.png")}
/>
);
},
}}
/>
<Tab.Screen
name="Add Post"
component={NewPostForm}
options={{
tabBarIcon: ({ focused, color, size }) => {
return (
<Image
style={{ width: 40, height: 40 }}
source={require("./assets/spraycan.png")}
/>
);
},
}}
/>
<Tab.Screen
name="Gallery View"
component={GalleryView}
options={{
tabBarIcon: ({ focused, color, size }) => {
return (
<Image
style={{ width: 40, height: 40 }}
source={require("./assets/grid.png")}
/>
);
},
}}
/>
</Tab.Navigator>
</NavigationContainer>
</>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
thumbnail: {
width: 300,
height: 300,
resizeMode: "contain",
},
});