-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
109 lines (98 loc) · 2.34 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
import React from 'react';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import { Ionicons } from '@expo/vector-icons';
import { createStackNavigator } from 'react-navigation-stack';
import { createAppContainer } from 'react-navigation';
import { Provider } from 'react-redux';
import store from './src/public/redux/store';
import NavigationService from "./src/components/Navigationservice";
import Login from './src/screens/Login';
import Register from './src/screens/Register';
import Home from './src/screens/Home';
import Viewbook from "./src/screens/Viewbook";
import History from "./src/screens/History";
import Account from "./src/screens/Account";
import RequestBook from "./src/screens/Request";
const AppNavigator = createStackNavigator({
Login: {
screen: Login,
navigationOptions: {
header: null
}
},
Register: {
screen: Register,
navigationOptions: {
header: null
}
},
Home: {
screen: Home,
navigationOptions: {
header: null
}
},
Viewbook: {
screen: Viewbook,
navigationOptions: {
headerTransparent: {
position: 'absolute',
backgroundColor: 'transparent',
zIndex: 100,
top: 0,
left: 0,
right: 0,
color: 'white',
},
}
},
History: {
screen: History,
navigationOptions: {
header: null
}
},
Account: {
screen: Account,
navigationOptions: {
header: null
}
},
Request: {
screen: RequestBook,
navigationOptions: {
header: null
}
}
})
const AppContainer = createAppContainer(AppNavigator);
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
isReady: false,
};
}
async componentDidMount() {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
...Ionicons.font,
'Airbnb Cereal App': require('./assets/fonts/AirbnbCerealBook.ttf'),
});
this.setState({ isReady: true });
}
render() {
if (!this.state.isReady) {
return <AppLoading />;
}
return (
<Provider store={store}>
<AppContainer ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef)
}} />
</Provider>
);
}
}