-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
120 lines (114 loc) · 4.97 KB
/
App.js
File metadata and controls
120 lines (114 loc) · 4.97 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
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
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { BarCodeScanner } from 'expo-barcode-scanner';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Activities from "./src/Activity/Activities"
import ActivityMenu from "./src/Activity/ActivityMenu"
import ActivityDetailMenu from "./src/Activity/ActivityDetailMenu"
import Barcode from "./src/Barcode"
import Gallery from "./src/Gallery"
import Homes from "./src/HotelInfo/Homes"
import Signup from "./src/Signup"
import LanguageSelectionScreen from './src/LanguageSelectionScreen';
import Menuside from './src/Menuside';
import Detailsactivity from './src/Activity/Detailsactivity';
import Restaurants from './src/Restorant/Restaurants';
import Index from './src/Index';
import Hotelinfo from './src/HotelInfo/Hotelinfo'
import Hotelinfodescription from './src/HotelInfo/Hotelinfodescription'
import HotelinfodescriptionM from './src/HotelInfo/Hotelinfodes'
import Restaurantscategory from './src/Restorant/Restaurantscategory'
import Restaurantscategorymenu from './src/Restorant/Restaurantscategorymenu'
import Rcatsidemenu from './src/Restorant/Rcatsidemenu'
import Rcatmenusidemenu from './src/Restorant/Rcatmenusidemenu'
import RoomCSideMenu from './src/RoomServise/RoomCSidemenu'
import RoomCheckout from './src/RoomServise/CheckOut'
import EventDesMenu from './src/Event/EventDesMenu'
import Success from './src/Activity/Success';
const Stack = createNativeStackNavigator();
import AsyncStorage from '@react-native-async-storage/async-storage';
import {View,Text, Image} from 'react-native'
// import * as ScreenOrientation from 'expo-screen-orientation';
// ScreenOrientation.unlockAsync()
export const PageContext = React.createContext();
var aa = ""
export default class App extends React.Component{
constructor(props){
super(props);
this.state={
Islogin:"",
isLoading:true,
hasPermission:null
}
}
async componentDidMount(){
await AsyncStorage.getItem("@Login_key")
.then(value => {
this.setState({Islogin:value });
this.setState({isLoading: false });
// aa = value
// console.log("aa")
})
const status = BarCodeScanner.requestPermissionsAsync();
this.setState({hasPermission :status === 'granted'})
console.disableYellowBox = true;
}
render(){
AsyncStorage.getItem("@Login_key")
.then(value => {
this.setState({Islogin:value });
// this.setState({isLoading: false });
// aa = value
// console.log("aa")
})
// console.disableYellowBox = true;
// AsyncStorage.clear()
return (
!this.state.isLoading?(
this.state.Islogin == "1" ? (
<PageContext.Provider>
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }} initialRouteName={"Menuside"}>
<Stack.Screen name="Menuside" component={Menuside}/>
<Stack.Screen name="Activities" component={Activities} />
<Stack.Screen name="Gallery" component={Gallery}/>
<Stack.Screen name="Homes" component={Homes}/>
<Stack.Screen name="LanguageSelectionScreen" component={LanguageSelectionScreen}/>
<Stack.Screen name="ActivityDetailMenu" component={ActivityDetailMenu}/>
<Stack.Screen name="ActivityMenu" component={ActivityMenu}/>
<Stack.Screen name="Detailsactivity" component={Detailsactivity}/>
<Stack.Screen name="Restaurants" component={Restaurants}/>
<Stack.Screen name="Hotelinfo" component={Hotelinfo}/>
<Stack.Screen name="Hotelinfodescription" component={Hotelinfodescription}/>
<Stack.Screen name="HotelinfodescriptionM" component={HotelinfodescriptionM}/>
<Stack.Screen name="Restaurantscategory" component={Restaurantscategory}/>
<Stack.Screen name="Restaurantscategorymenu" component={Restaurantscategorymenu}/>
<Stack.Screen name="Rcatsidemenu" component={Rcatsidemenu}/>
<Stack.Screen name="EventDesMenu" component={EventDesMenu}/>
<Stack.Screen name="Rcatmenusidemenu" component={Rcatmenusidemenu}/>
<Stack.Screen name="RoomCSideMenu" component={RoomCSideMenu}/>
<Stack.Screen name="RoomCheckout" component={RoomCheckout}/>
<Stack.Screen name="Success" component={Success}/>
</Stack.Navigator>
</NavigationContainer>
</PageContext.Provider>
)
:(
<PageContext.Provider>
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Index" component={Index}/>
<Stack.Screen name="Barcode" component={Barcode}/>
<Stack.Screen name="Signup" component={Signup}/>
</Stack.Navigator>
</NavigationContainer>
</PageContext.Provider>
)
):(
<View style={{flex:1}}>
<Image source={require('./assets/splash.png')}/>
</View>
)
)
}
}