-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
104 lines (89 loc) · 2.92 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
import { StatusBar } from 'expo-status-bar';
import React, { useEffect, useRef, useState } from 'react';
import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Ionicons, FontAwesome5 } from '@expo/vector-icons';
import KeyPad from './screens/Keypad';
import Contacts from './screens/Contacts';
import Favorites from './screens/Favorites';
import VoiceMail from './screens/Voicemail';
import Recents from './screens/Recents';
const Tab = createBottomTabNavigator()
let device_width = Dimensions.get("window").width;
let device_height = Dimensions.get("window").height;
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator initialRouteName={"Keypad"} screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Keypad') {
iconName = focused
? 'keypad'
: 'keypad'
return <Ionicons name={iconName} size={size} color={color} />;
} else if (route.name === 'Contacts') {
iconName = focused
? 'people'
: 'people-sharp'
return <Ionicons name={iconName} size={size} color={color} />;
} else if (route.name === 'Recents') {
iconName = focused
? 'clock'
: 'clock'
return <FontAwesome5 name={iconName} size={size} color={color} />;
} else if (route.name === 'Voicemail') {
iconName = focused
? 'voicemail'
: 'voicemail'
return <FontAwesome5 name={iconName} size={size} color={color} />;
} else if (route.name === 'Favorites') {
iconName = focused
? 'star'
: 'star'
return <Ionicons name={iconName} size={size} color={color} />;
}
},
})}
>
<Tab.Screen name="Favorites" component={Favorites} />
<Tab.Screen name="Recents" component={Recents} />
<Tab.Screen name="Keypad" component={KeyPad} />
<Tab.Screen name="Contacts" component={Contacts} />
<Tab.Screen name="Voicemail" component={VoiceMail} />
</Tab.Navigator>
</NavigationContainer >
);
}
const styles = StyleSheet.create({
container: {
height: device_height
},
button: {
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#e0e0e0',
fontWeight: 'bold',
padding: 5,
margin: 10,
width: 75,
height: 75,
borderRadius: 1200,
},
dialer_text: {
color: "#2b2b2b",
fontSize: 30,
fontWeight: '600'
},
dialer_subtext: {
color: "#2b2b2b",
fontSize: 15,
},
dialer_view: {
flex: 1,
marginTop: 20,
flexDirection: 'column',
paddingVertical: 150
}
});