AuthLoading.js
2.87 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
121
122
123
124
125
126
127
128
import React,{ Component } from 'react'
import {View,Text,Linking,RefreshControl,Image,ScrollView,Dimensions,TextInput,TouchableOpacity,StatusBar,StyleSheet} from 'react-native'
import { post, get, put, delete as remove } from 'axios'
import AsyncStorage from '@react-native-community/async-storage';
class MainPage extends Component {
state = {
refreshing:false,
}
constructor(props) {
super(props)
AsyncStorage.getItem('isFirst',(err,result) => {
JSON.parse(result)? this.props.navigation.navigate('App'):
this.props.navigation.navigate('Guidance')
})
this.props.navigation.navigate('Guidance')
}
_onRefresh = () => {
this.setState({refreshing: true});
this.setState({
refreshing:false,
})
}
componentDidMount() {
async () => {
try {
let url = await firebase().getInitialLink();
console.log('incoming url', url);
}
catch(err) {
console.log(err)
}
}
Linking.addEventListener('url', this.handleOpenURL);
}
componentWillUnmount() {
Linking.removeEventListener('url', this.handleOpenURL);
}
handleOpenURL(event) {
console.log(event.url);
const route = e.url.replace(/.*?:\/\//g, '');
// do something with the url, in our case navigate(route)
}
render() {
return (
<View style={{height:"100%",width:"100%",backgroundColor:"white"}}>
</View>
)
}
}
const style=StyleSheet.create({
list_pick_event: {
paddingTop:17,
paddingBottom:17,
borderBottomColor:"#BBB9B9",
borderTopColor:"#BBB9B9",
borderBottomWidth:0.5,
},
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
avatar : {
width:32,
height:32,
borderRadius:100,
},
detail: {
marginLeft:15,
flex:1,
flexDirection:"row",
},
hit: {
fontSize:9,
fontWeight:"bold"
},
date: {
marginLeft:9,
fontSize:9,
color:"black"
},
userWrapper : {
flex:1,
flexDirection:"row",
paddingTop:13,
paddingBottom:17,
borderBottomColor:"#AEAEAE",
borderBottomWidth:1,
},
nickname : {
marginLeft:10,
fontSize:13,
fontWeight:"bold",
color:"black"
},
title : {
fontSize:13,
fontWeight:"bold",
color:"black"
},
like : {
marginTop:3,
fontSize:10,
color:"red",
marginLeft:5,
},
titleWrapper : {
marginTop:17,
paddingLeft:19,
flex:1,
flexDirection:"row"
}
})
export default MainPage