-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
134 lines (118 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import React from 'react';
import { TouchableOpacity, View, Platform } from 'react-native';
import { createSwitchNavigator, createAppContainer } from 'react-navigation';
import { createDrawerNavigator } from 'react-navigation-drawer';
import { createStackNavigator } from 'react-navigation-stack';
import { Root } from 'native-base';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import reducer from './src/components/app/reducer';
import thunk from 'redux-thunk';
import * as Font from 'expo-font';
import { Ionicons } from '@expo/vector-icons';
import Amplify from '@aws-amplify/core';
import awsmobile from './aws-exports';
import AuthLoadingScreen from './src/components/screens/AuthLoadingScreen';
import WelcomeScreen from './src/components/screens/WelcomeScreen';
import SignUpScreen from './src/components/screens/SignUpScreen';
import SignInScreen from './src/components/screens/SignInScreen';
import ForgetPasswordScreen from './src/components/screens/ForgetPasswordScreen';
import HomeScreen from './src/components/screens/HomeScreen';
import SettingsScreen from './src/components/screens/SettingsScreen';
import TagLogScreen from './src/components/screens/TagLogScreen';
import ImagePickerExample from './src/components/screens/PhotoRecord';
import { useFonts } from 'expo-font';
import { AppTabNavigator } from './appTabNavigatorConfig';
import { DrawerComponent } from './DrawerComponent';
Amplify.configure(awsmobile);
const HEADER_HEIGHT = Platform.OS === 'ios' ? 60 : 50;
const AppStackNavigator = createStackNavigator({
Header: {
screen: AppTabNavigator,
navigationOptions: ({ navigation }) => ({
headerLeft: (
<TouchableOpacity onPress={() => navigation.toggleDrawer()}>
<View style={{ paddingHorizontal: 30 }}>
<Ionicons size={32} name="md-menu" />
</View>
</TouchableOpacity>
)
})
}
});
const AppDrawerNavigator = createDrawerNavigator(
{
Menu: AppStackNavigator,
['Report Tags']: HomeScreen,
['Tag Log']: TagLogScreen,
Settings: SettingsScreen,
['Sign Out']: SettingsScreen,
ImagePickerExample: ImagePickerExample,
},
{
contentComponent: DrawerComponent
}
);
const authStackNavigationOptions = {
initialRouteName: 'Welcome',
defaultNavigationOptions: {
headerStyle: {
backgroundColor: '#fff'
},
headerTintColor: '#000',
headerShown: true,
backgroundColor: 'white'
}
};
const AuthStackNavigator = createStackNavigator(
{
Welcome: {
screen: WelcomeScreen,
navigationOptions: () => ({
title: `BTT - Tag Reporter`,
headerBackTitle: 'Back',
backgroundColor: 'white',
headerShown: false
}),
cardStyle: { backgroundColor: 'transparent' }
},
SignUp: {
screen: SignUpScreen,
navigationOptions: () => ({
title: `Register`
})
},
SignIn: {
screen: SignInScreen,
navigationOptions: () => ({
title: `Login`
})
},
ForgetPassword: {
screen: ForgetPasswordScreen,
navigationOptions: () => ({
title: `Reset Password`
})
}
},
authStackNavigationOptions
);
const appNav = createSwitchNavigator({
Authloading: AuthLoadingScreen,
Auth: AuthStackNavigator,
App: AppDrawerNavigator,
ForgetPassword: ForgetPasswordScreen
});
const AppContainer = createAppContainer(appNav);
const store = createStore(reducer, applyMiddleware(thunk));
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<Root>
<AppContainer />
</Root>
</Provider>
);
}
}