-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
53 lines (49 loc) · 1.59 KB
/
App.js
File metadata and controls
53 lines (49 loc) · 1.59 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
/* eslint-disable react/no-unstable-nested-components */
import * as React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import HomeScreen from './screen/Home';
// import SettingsScreen from './screen/SettingsScreen';
import Ionicons from 'react-native-vector-icons/Ionicons';
import ScanScreen from './screen/QrCode';
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({route}) => ({
headerShown: true,
tabBarIcon: ({focused, color, size}) => {
let iconName;
if (route.name === 'Home') {
iconName = focused ? 'qr-code' : 'qr-code';
} else if (route.name === 'QrCode') {
iconName = focused ? 'qr-code' : 'qr-code';
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: 'tomato',
tabBarInactiveTintColor: 'gray',
})}>
<Tab.Screen
name="Home"
options={{
title: 'HOME',
unmountOnBlur: true,
headerShown: false,
}}
component={HomeScreen}
/>
<Tab.Screen
name="QrCode"
options={{
headerShown: false,
title: 'SCAN QR',
}}
component={ScanScreen}
/>
</Tab.Navigator>
</NavigationContainer>
);
}