-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.js
More file actions
84 lines (69 loc) · 2.38 KB
/
App.js
File metadata and controls
84 lines (69 loc) · 2.38 KB
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
/*
_____ .___.__
_/ ____\___________ __| _/|__| ____________ ___________
\ __\/ __ \_ __ \/ __ | | | / _ \___ // __ \_ __ \
| | \ ___/| | \/ /_/ | | | ( <_> ) /\ ___/| | \/
|__| \___ >__| \____ | |__| \____/_____ \\___ >__|
\/ \/ \/ \/
*/
import 'react-native-gesture-handler';
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
StatusBar,
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import AntDesign from 'react-native-vector-icons/AntDesign';
import { primaryColor, secondaryColor } from './helper';
//screens
import ScanScreen from './src/screens/Scan'
import CreateScreen from './src/screens/Create';
import WifiScreen from './src/screens/Wifi';
const Tab = createBottomTabNavigator();
//set icon name with route
function renderIcon({ route, size, color }) {
// console.log({ route, size, color })
switch (route.name) {
case 'Oku':
return (<Ionicons size={size} color={color} name="scan" />)
break;
case 'Oluştur':
return (<MaterialCommunityIcons size={size} color={color} name="qrcode-plus" />)
break;
case 'Wifi':
return (<AntDesign size={size} color={color} name="wifi" />)
break;
default:
return (<Ionicons size={size} color={color} name="scan" />)
break;
}
}
const App: () => React$Node = () => {
return (
<NavigationContainer>
<StatusBar backgroundColor={primaryColor} barStyle="light-content" />
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
return renderIcon({ route, focused, color, size })
},
})}
tabBarOptions={{
activeTintColor: secondaryColor,
inactiveTintColor: primaryColor,
}}
>
<Tab.Screen name="Oku" component={ScanScreen} />
<Tab.Screen name="Oluştur" component={CreateScreen} />
<Tab.Screen name="Wifi" component={WifiScreen} />
</Tab.Navigator>
</NavigationContainer>
);
};
export default App;