-
Notifications
You must be signed in to change notification settings - Fork 15
/
App.js
113 lines (108 loc) · 4.28 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
import {StatusBar} from 'expo-status-bar';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {Image, StyleSheet, SafeAreaView} from "react-native";
const Tab = createBottomTabNavigator();
// Icons
import {HomeFilled, Home, Search, SearchFilled, Reel, ReelFilled, Shop, ShopFilled} from "./icons";
// screens
import HomeScreen from "./screens/home";
import SearchScreen from "./screens/search";
import ReelScreen from "./screens/reel";
import ShopScreen from "./screens/shop";
import ProfileScreen from "./screens/profile";
export default function App() {
return (
<NavigationContainer>
<StatusBar style="dark" />
<SafeAreaView style={{flex: 1}}>
<Tab.Navigator
screenOptions={{
headerShown: false,
tabBarStyle: {
backgroundColor: '#fff',
borderTopWidth: 1,
borderTopColor: '#DBDBDB',
height: 50,
paddingTop: 15,
paddingBottom: 15
},
tabBarShowLabel: false,
tabBarActiveTintColor: '#000',
tabBarInactiveTintColor: '#333'
}}
>
<Tab.Screen
name="home"
component={HomeScreen}
options={{
tabBarIcon: ({focused, color}) => {
if (focused)
return <HomeFilled fill={color}/>
return <Home fill={color}/>
}
}}
/>
<Tab.Screen
name="search"
component={SearchScreen}
options={{
tabBarIcon: ({focused, color}) => {
if (focused)
return <SearchFilled fill={color}/>
return <Search fill={color}/>
}
}}
/>
<Tab.Screen
name="reel"
component={ReelScreen}
options={{
tabBarIcon: ({focused, color}) => {
if (focused)
return <ReelFilled fill={color}/>
return <Reel fill={color}/>
}
}}
/>
<Tab.Screen
name="shop"
component={ShopScreen}
options={{
tabBarIcon: ({focused, color}) => {
if (focused)
return <ShopFilled fill={color}/>
return <Shop fill={color}/>
}
}}
/>
<Tab.Screen
name="profile"
component={ProfileScreen}
options={{
tabBarIcon: ({focused, color}) => {
return <Image
style={{
...styles.avatar,
borderWidth: focused ? 1 : 0
}}
source={{
uri: 'https://pbs.twimg.com/profile_images/1469715048436277258/141ZXcHO_400x400.jpg',
}}
/>
}
}}
/>
</Tab.Navigator>
</SafeAreaView>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
avatar: {
width: 24,
height: 24,
borderRadius: 24,
borderColor: '#000'
}
})