-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
117 lines (115 loc) · 3.64 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
114
115
116
117
import 'react-native-gesture-handler';
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createMaterialBottomTabNavigator} from '@react-navigation/material-bottom-tabs';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import QrScanner from './src/screens/QrScanner';
import ReceiptPage from './src/screens/ReceiptPage';
import AccountPage from './src/screens/AccountPage';
import HomeScreen from './src/screens/HomeScreen';
import Rewards from './src/screens/Rewards';
import Locator from './src/screens/StoreLocator';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import {useSelector} from 'react-redux';
import {enableScreens} from 'react-native-screens';
enableScreens();
const Tab = createMaterialBottomTabNavigator();
const Stack = createNativeStackNavigator();
export default function App() {
const isClicked = useSelector(state => state.isClicked);
console.log('isClicked', isClicked);
return (
<>
{isClicked == false ? (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
options={{headerShown: false}}
component={HomeScreen}
/>
</Stack.Navigator>
</NavigationContainer>
) : (
<NavigationContainer>
<Tab.Navigator
initialRouteName= "Qr Scanner"
activeColor="#02d9c0"
inactiveColor="#b3acab"
barStyle={{backgroundColor: 'white'}}>
<Tab.Screen
name="Qr Scanner"
component={QrScanner}
options={{
tabBarLabel: 'Qr Scanner',
tabBarIcon: ({color}) => (
<MaterialCommunityIcons
name="qrcode-scan"
color={color}
size={25}
/>
),
}}
/>
<Tab.Screen
name="Receipt"
component={ReceiptPage}
options={{
tabBarLabel: 'Receipt',
tabBarIcon: ({color}) => (
<MaterialCommunityIcons
name="receipt"
color={color}
size={25}
/>
),
}}
/>
<Tab.Screen
name="Rewards"
component={Rewards}
options={{
tabBarLabel: 'Rewards',
tabBarIcon: ({color}) => (
<MaterialCommunityIcons
name="coin"
color={color}
size={25}
/>
),
}}
/>
<Tab.Screen
name="Locator"
component={Locator}
options={{
tabBarLabel: 'Store Locator',
tabBarIcon: ({color}) => (
<MaterialCommunityIcons
name="map-marker-path"
color={color}
size={25}
/>
),
}}
/>
<Tab.Screen
name="Account"
component={AccountPage}
options={{
tabBarLabel: 'Account',
tabBarIcon: ({color, size}) => (
<MaterialCommunityIcons
name="wallet-outline"
color={color}
size={25}
/>
),
}}
/>
</Tab.Navigator>
</NavigationContainer>
)}
</>
);
}