-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSplashScreen.js
122 lines (64 loc) · 2.29 KB
/
SplashScreen.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
import {
SafeAreaView,
Platform,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Alert,
TouchableOpacity,
TextInput,
Image,
ImageBackground,
Linking,
FlatList,
Dimensions,
} from 'react-native';
import React, {Component} from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import AsyncStorage from '@react-native-community/async-storage';
const GLOBAL = require('./Global');
class SplashScreen extends React.Component {
getData = async () => {
try {
const tokenvalue = await AsyncStorage.getItem('token')
const value = await AsyncStorage.getItem('userID')
const lang = await AsyncStorage.getItem('lang')
// alert(JSON.stringify(value))
if(value != null && tokenvalue != null && lang!= null) {
GLOBAL.userID = value
GLOBAL.token = tokenvalue
GLOBAL.lang = lang
this.props.navigation.navigate('ManageScreen')
}else{
this.props.navigation.navigate('StyleScreen')
}
} catch(e) {
// error reading value
}
}
componentDidMount () {
// alert(JSON.stringify(GLOBAL.userID))
this.timeoutCheck = setTimeout(() => {
// this.getData()
this.getData();
},1000);
}
render() {
return (
<View style={{flex:1,backgroundColor:'white'}}>
<StatusBar
backgroundColor = "black"
/>
<ImageBackground
style={{height:'100%',width:'100%',resizeMode:'contain',justifyContent:'center'}}
source={require('./splash.png')}>
<Image style={{height:150,width:150,resizeMode:'contain',alignSelf:'center'}} source={require('./newlogo.png')} />
<Text style={{fontSize:20,fontFamily:'AvenirLTStd-Heavy',color:'#1357A2',marginTop:20,alignSelf:'center'}}>Afghanistan's Patriot Majority Orbit</Text>
</ImageBackground>
</View>
);
}
}
export default SplashScreen;