-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tabs.jsx
61 lines (53 loc) · 2 KB
/
Tabs.jsx
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
import React from 'react'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { StyleSheet, View, Text, Image } from 'react-native';
import WhatsApp from './Screens/WhatsApp';
import WhatsAppBusiness from './Screens/WhatsAppBusiness';
const Tab = createBottomTabNavigator();
export const Tabs = () =>{
const TabBarIcon = ({focused, img}) => {
let image = img == 'business' ? require(`./assets/whatsapp-business.png`) : require(`./assets/whatsapp2.png`);
return (
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
<Image
source={image}
resizeMode="contain"
style={{
width: focused ? 60 : 40 ,
height: focused ? 60 : 40,
marginBottom: focused ? 30 : 0,
}}
/>
</View>
)};
return (
<Tab.Navigator
screenOptions={{
tabBarShowLabel: false,
tabBarStyle: {
backgroundColor: "#000",
position: "absolute",
bottom: 0,
left: 0,
right: 0,
elevation: 0,
borderTopColor: "green",
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
marginHorizontal: 3
// marginBottom: 10,
},
headerStyle: {
backgroundColor: "#f4511e",
},
headerTintColor: "#fff"
}}
>
<Tab.Screen name="WhatsApp" component={WhatsApp} options={{
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} img="personal" /> }} />
<Tab.Screen name="WhatsApp Business" component={WhatsAppBusiness} options={{
tabBarIcon: ({focused}) => <TabBarIcon focused={focused} img="business" /> }} />
</Tab.Navigator>
)
}
export default Tabs