AuthLoading.js 2.87 KB
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