-
Notifications
You must be signed in to change notification settings - Fork 1
/
loadingScene.js
117 lines (105 loc) · 3.51 KB
/
loadingScene.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, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
TouchableOpacity,
MapView,
Dimensions,
Image,
Alert,
PropTypes,
AsyncStorage,
TouchableHighlight
} from 'react-native';
import FBSDK , {LoginManager,AccessToken} from 'react-native-fbsdk';
import loadingStyles from './loadingSceneStyles'
import SplashScreen from 'react-native-splash-screen'
var SCREEN_WIDTH = require('Dimensions').get('window').width;
var BaseConfig = Navigator.SceneConfigs.FloatFromRight;
const { width, height } = Dimensions.get('window')
var CustomLeftToRightGesture = Object.assign({}, BaseConfig.gestures.pop, {
// Make it snap back really quickly after canceling pop
snapVelocity: 8,
// Make it so we can drag anywhere on the screen
edgeHitWidth: SCREEN_WIDTH,
});
var CustomSceneConfig = Object.assign({}, BaseConfig, {
// A very tighly wound spring will make this transition fast
springTension: 100,
springFriction: 1,
// Use our custom gesture defined above
gestures: {
pop: CustomLeftToRightGesture,
}
});
var PageOne = React.createClass ( {
_handlePressId(Id) {
this.props.navigator.replace({id: Id,});
},
_TestRegistration(){
var self = this;
LoginManager.logInWithReadPermissions(['public_profile']).then(function(result){
if (result.isCancelled){
this._handlePress2;
}
else{
AccessToken.getCurrentAccessToken().then(
(data) => {
AsyncStorage.getItem('databaseTOKEN').then((value)=>{
if(value == null){
AsyncStorage.setItem('databaseTOKEN',JSON.stringify(data.accessToken));
}
});
self._handlePressId(2);
})
}})
},
_checkToken(){
AsyncStorage.getItem('databaseTOKEN').then((value)=>{
if(value !== null){
this._handlePressId(2);
}})
},
render() {
return (
<Image
source = {require('./images/Rectangle.png')}
style = {{width : width}}>
{this._checkToken()}
<TouchableOpacity onPress={() => this._handlePressId(7)}>
<Image
source = {require('./images/policy.png')}
style = {loadingStyles.Policy}/>
</TouchableOpacity>
<View style={loadingStyles.container}>
<Image
style={loadingStyles.imageLogo}
source={require('./images/logo2.png')}/>
<Text style={loadingStyles.welcome}>Welcome to RunnerPro</Text>
<Text style = {loadingStyles.TextRunnForGood}>Everything you need to be health</Text>
<Text style = {loadingStyles.TextRunnForGood}>& beat your goals</Text>
<TouchableOpacity onPress={() => this._handlePressId(5)}>
<View
style={loadingStyles.buttonSingUpWithEmail} >
<Text style={loadingStyles.buttomGetText}>Sing Up with Email</Text>
</View>
</TouchableOpacity>
<TouchableOpacity onPress={this._TestRegistration}>
<View style={loadingStyles.buttonSingUpWithFacebook}>
<Text style={loadingStyles.buttomGetText}>Sing Up with Facebook</Text>
</View>
</TouchableOpacity>
<View style={{flex:0.1}}>
<TouchableOpacity onPress ={() => this._handlePressId(4)}>
<Text style={loadingStyles.text}> Alredy have my account </Text>
</TouchableOpacity>
</View>
</View>
</Image>
)
}
});
module.exports = PageOne;