-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
117 lines (111 loc) · 2.79 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 {
Image,
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
View,
} from 'react-native';
import {appPersist, store} from './src/redux/store';
//navigation
import {createAppContainer, createSwitchNavigator} from 'react-navigation';
//screen
import HomeScreen from './src/screens/HomeScreen';
import {PersistGate} from 'redux-persist/integration/react';
//redux
import {Provider} from 'react-redux';
import React from 'react';
import WishlistScreen from './src/screens/WishlistScreen';
import {createBottomTabNavigator} from 'react-navigation-tabs';
const switchNavigator = createSwitchNavigator({
homeStack: createBottomTabNavigator(
{
Home: {
screen: HomeScreen,
navigationOptions: {
tabBarIcon: ({focused}) => {
let icon =
focused === true
? require('./src/images/home_icon.png')
: require('./src/images/home_n_icon.png');
return <Image source={icon} style={styles.tabIcon} />;
},
},
},
Wishlist: {
screen: WishlistScreen,
navigationOptions: {
tabBarIcon: ({focused}) => {
let icon =
focused === true
? require('./src/images/wish_icon.png')
: require('./src/images/wish_n_icon.png');
return <Image source={icon} style={styles.tabIcon} />;
},
},
},
},
{
tabBarOptions: {
showLabel: false,
activeTintColor: '#FF543C',
inactiveTintColor: 'black',
tabStyle: {
height: 50,
zIndex: 99,
borderColor: 'white',
borderTopWidth: 0,
},
labelStyle: {
fontSize: 12,
paddingTop: 2,
paddingBottom: 3,
fontFamily: 'halfmoon_bold',
},
},
},
),
});
const App = createAppContainer(switchNavigator);
// const App = () => {
// return (
// <>
// <StatusBar barStyle="dark-content" />
// <SafeAreaView>
// <ScrollView
// contentInsetAdjustmentBehavior="automatic"
// style={styles.scrollView}>
// <View style={styles.container}>
// <Text>Open up App.js to start working with your app</Text>
// </View>
// </ScrollView>
// </SafeAreaView>
// </>
// );
// };
const styles = StyleSheet.create({
scrollView: {
backgroundColor: '#fff',
},
container: {
flex: 1,
backgroundColor: '#fff',
justifyContent: 'center',
alignItems: 'center',
},
tabIcon: {
width: 30,
height: 30,
},
});
export default () => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={appPersist}>
<App />
</PersistGate>
</Provider>
);
};